optimiser-resource-auction-.../charts/nebulous-optimiser-resource-auction-agent/templates/hpa.yaml
Radosław Piliszek 9701217816 Init repo from the component-template
Change-Id: Ic968ec926d7a6942a053f73910ee142e3cb0a234
2023-09-19 20:15:50 +02:00

29 lines
1018 B
YAML

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "nebulous-optimiser-resource-auction-agent.fullname" . }}
labels:
{{- include "nebulous-optimiser-resource-auction-agent.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "nebulous-optimiser-resource-auction-agent.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}