| {{- if and (.Values.hpa.enabled) (not .Values.autoscaler.enabled) }} |
| {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} |
| apiVersion: autoscaling/v2 |
| apiVersion: autoscaling/v2beta2 |
| kind: HorizontalPodAutoscaler |
| name: {{ template "coredns.fullname" . }} |
| namespace: {{ .Release.Namespace }} |
| labels: {{- include "coredns.labels" . | nindent 4 }} |
| {{- if .Values.customLabels }} |
| {{ toYaml .Values.customLabels | indent 4 }} |
| {{- with .Values.customAnnotations }} |
| {{- toYaml . | nindent 4 }} |
| name: {{ default (include "coredns.fullname" .) .Values.deployment.name }} |
| minReplicas: {{ .Values.hpa.minReplicas }} |
| maxReplicas: {{ .Values.hpa.maxReplicas }} |
| {{ toYaml .Values.hpa.metrics | indent 4 }} |
| {{- if .Values.hpa.behavior }} |
| {{ toYaml .Values.hpa.behavior | indent 4 }} |