blob: 57a476b58dfce2f0d8481e4f1527fb2db11e40b0 [file] [log] [blame]
Giorgi Lekveishviliec6b3cc2023-12-01 16:30:04 +04001{{- if and (.Values.hpa.enabled) (not .Values.autoscaler.enabled) }}
2---
3{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
4apiVersion: autoscaling/v2
5{{- else }}
6apiVersion: autoscaling/v2beta2
7{{- end }}
8kind: HorizontalPodAutoscaler
9metadata:
10 name: {{ template "coredns.fullname" . }}
11 labels: {{- include "coredns.labels" . | nindent 4 }}
12{{- if .Values.customLabels }}
13{{ toYaml .Values.customLabels | indent 4 }}
14{{- end }}
15{{- with .Values.customAnnotations }}
16 annotations:
17{{- toYaml . | nindent 4 }}
18{{- end }}
19spec:
20 scaleTargetRef:
21 apiVersion: apps/v1
22 kind: Deployment
23 name: {{ default (include "coredns.fullname" .) .Values.deployment.name }}
24 minReplicas: {{ .Values.hpa.minReplicas }}
25 maxReplicas: {{ .Values.hpa.maxReplicas }}
26 metrics:
27{{ toYaml .Values.hpa.metrics | indent 4 }}
28{{- if .Values.hpa.behavior }}
29 behavior:
30{{ toYaml .Values.hpa.behavior | indent 4 }}
31{{- end }}
32{{- end }}