optimiser-constraint-checker/charts/nebulous-optimiser-constraint-checker/templates/hpa.yaml
Radosław Piliszek 6c148d897b Init repo from the component-template
Change-Id: Ic3153c8e8a9b78df02a5a8f590ed20dc78d85b95
2023-09-19 20:17:32 +02:00

29 lines
1006 B
YAML

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "nebulous-optimiser-constraint-checker.fullname" . }}
labels:
{{- include "nebulous-optimiser-constraint-checker.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "nebulous-optimiser-constraint-checker.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 }}