github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/examples/helm-charts/chart/templates/hpa.yaml (about) 1 {{- if .Values.hpa.enabled -}} 2 apiVersion: autoscaling/v2 3 kind: HorizontalPodAutoscaler 4 metadata: 5 name: {{ template "podinfo.fullname" . }} 6 labels: 7 {{- include "podinfo.labels" . | nindent 4 }} 8 spec: 9 scaleTargetRef: 10 apiVersion: apps/v1 11 kind: Deployment 12 name: {{ template "podinfo.fullname" . }} 13 minReplicas: {{ .Values.replicaCount }} 14 maxReplicas: {{ .Values.hpa.maxReplicas }} 15 metrics: 16 {{- if .Values.hpa.cpu }} 17 - type: Resource 18 resource: 19 name: cpu 20 target: 21 type: Utilization 22 averageUtilization: {{ .Values.hpa.cpu }} 23 {{- end }} 24 {{- if .Values.hpa.memory }} 25 - type: Resource 26 resource: 27 name: memory 28 target: 29 type: AverageValue 30 averageValue: {{ .Values.hpa.memory }} 31 {{- end }} 32 {{- if .Values.hpa.requests }} 33 - type: Pods 34 pods: 35 metric: 36 name: http_requests 37 target: 38 type: AverageValue 39 averageValue: {{ .Values.hpa.requests }} 40 {{- end }} 41 {{- end }}