blob: 79fc4cc84cb1e4fa1cb11b80ff6dc20635de6073 [file] [log] [blame]
Mohammed Naser9ad0d462023-01-15 20:36:37 -05001{{- if and (.Values.hpa.enabled) (not .Values.autoscaler.enabled) }}
2---
3apiVersion: autoscaling/v2beta2
4kind: HorizontalPodAutoscaler
5metadata:
6 name: {{ template "coredns.fullname" . }}
7 labels:
8 app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
9 app.kubernetes.io/instance: {{ .Release.Name | quote }}
10 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
11 {{- if .Values.isClusterService }}
12 k8s-app: {{ .Chart.Name | quote }}
13 kubernetes.io/cluster-service: "true"
14 kubernetes.io/name: "CoreDNS"
15 {{- end }}
16 app.kubernetes.io/name: {{ template "coredns.name" . }}
17{{- if .Values.customLabels }}
18{{ toYaml .Values.customLabels | indent 4 }}
19{{- end }}
20{{- with .Values.customAnnotations }}
21 annotations:
22{{- toYaml . | nindent 4 }}
23{{- end }}
24spec:
25 scaleTargetRef:
26 apiVersion: apps/v1
27 kind: Deployment
28 name: {{ default (include "coredns.fullname" .) .Values.deployment.name }}
29 minReplicas: {{ .Values.hpa.minReplicas }}
30 maxReplicas: {{ .Values.hpa.maxReplicas }}
31 metrics:
32{{ toYaml .Values.hpa.metrics | indent 4 }}
33{{- if .Values.hpa.behavior }}
34 behavior:
35{{ toYaml .Values.hpa.behavior | indent 4 }}
36{{- end }}
37{{- end }}