| Giorgi Lekveishvili | ec6b3cc | 2023-12-01 16:30:04 +0400 | [diff] [blame] | 1 | {{- if .Values.autoscaler.enabled }} |
| 2 | --- |
| 3 | kind: ConfigMap |
| 4 | apiVersion: v1 |
| 5 | metadata: |
| 6 | name: {{ template "coredns.fullname" . }}-autoscaler |
| 7 | namespace: {{ .Release.Namespace }} |
| 8 | labels: {{- include "coredns.labels.autoscaler" . | nindent 4 }} |
| 9 | {{- if .Values.customLabels }} |
| 10 | {{- toYaml .Values.customLabels | nindent 4 }} |
| 11 | {{- end }} |
| 12 | {{- if or .Values.autoscaler.configmap.annotations .Values.customAnnotations }} |
| 13 | annotations: |
| 14 | {{- if .Values.customAnnotations }} |
| 15 | {{- toYaml .Values.customAnnotations | nindent 4 }} |
| 16 | {{- end }} |
| 17 | {{- if .Values.autoscaler.configmap.annotations -}} |
| 18 | {{ toYaml .Values.autoscaler.configmap.annotations | nindent 4 }} |
| 19 | {{- end }} |
| 20 | {{- end }} |
| 21 | data: |
| 22 | # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. |
| 23 | # If using small nodes, "nodesPerReplica" should dominate. |
| 24 | linear: |- |
| 25 | { |
| 26 | "coresPerReplica": {{ .Values.autoscaler.coresPerReplica | float64 }}, |
| 27 | "nodesPerReplica": {{ .Values.autoscaler.nodesPerReplica | float64 }}, |
| 28 | "preventSinglePointFailure": {{ .Values.autoscaler.preventSinglePointFailure }}, |
| 29 | "min": {{ .Values.autoscaler.min | int }}, |
| 30 | "max": {{ .Values.autoscaler.max | int }}, |
| 31 | "includeUnschedulableNodes": {{ .Values.autoscaler.includeUnschedulableNodes }} |
| 32 | } |
| 33 | {{- end }} |