Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 1 | {{- if and (.Values.hpa.enabled) (not .Values.autoscaler.enabled) }} |
| 2 | --- |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 3 | {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} |
| 4 | apiVersion: autoscaling/v2 |
| 5 | {{- else }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 6 | apiVersion: autoscaling/v2beta2 |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 7 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 8 | kind: HorizontalPodAutoscaler |
| 9 | metadata: |
| 10 | name: {{ template "coredns.fullname" . }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 11 | namespace: {{ .Release.Namespace }} |
| 12 | labels: {{- include "coredns.labels" . | nindent 4 }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 13 | {{- if .Values.customLabels }} |
| 14 | {{ toYaml .Values.customLabels | indent 4 }} |
| 15 | {{- end }} |
| 16 | {{- with .Values.customAnnotations }} |
| 17 | annotations: |
| 18 | {{- toYaml . | nindent 4 }} |
| 19 | {{- end }} |
| 20 | spec: |
| 21 | scaleTargetRef: |
| 22 | apiVersion: apps/v1 |
| 23 | kind: Deployment |
| 24 | name: {{ default (include "coredns.fullname" .) .Values.deployment.name }} |
| 25 | minReplicas: {{ .Values.hpa.minReplicas }} |
| 26 | maxReplicas: {{ .Values.hpa.maxReplicas }} |
| 27 | metrics: |
| 28 | {{ toYaml .Values.hpa.metrics | indent 4 }} |
| 29 | {{- if .Values.hpa.behavior }} |
| 30 | behavior: |
| 31 | {{ toYaml .Values.hpa.behavior | indent 4 }} |
| 32 | {{- end }} |
| 33 | {{- end }} |