From ada366e990605c2994ab0992c37519e047be5413 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Thu, 30 Jan 2020 23:52:19 +0000 Subject: [PATCH] [stable/coredns] allow annotations on configmap (#20430) * [stable/coredns] allow annotations on configmap Signed-off-by: Alex Williams * [stable/coredns] remove autoscaler servicemonitor Signed-off-by: Alex Williams --- stable/coredns/Chart.yaml | 2 +- stable/coredns/README.md | 1 + .../templates/configmap-autoscaler.yaml | 10 ++++++--- .../templates/deployment-autoscaler.yaml | 1 + .../templates/servicemonitor-autoscaler.yaml | 21 ------------------- stable/coredns/values.yaml | 6 ++++++ 6 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 stable/coredns/templates/servicemonitor-autoscaler.yaml diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index c548833505..1373e21f0f 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: coredns -version: 1.9.1 +version: 1.9.2 appVersion: 1.6.7 description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS Services keywords: diff --git a/stable/coredns/README.md b/stable/coredns/README.md index 9e0781571d..dc00ca26b5 100644 --- a/stable/coredns/README.md +++ b/stable/coredns/README.md @@ -89,6 +89,7 @@ The command removes all the Kubernetes components associated with the chart and | `autoscaler.resources.limits.memory` | Container maximum memory for cluster-proportional-autoscaler | `10Mi` | | `autoscaler.resources.requests.cpu` | Container requested CPU for cluster-proportional-autoscaler | `20m` | | `autoscaler.resources.requests.memory` | Container requested memory for cluster-proportional-autoscaler | `10Mi` | +| `autoscaler.configmap.annotations` | Annotations to add to autoscaler config map. For example to stop CI renaming them | {} | See `values.yaml` for configuration notes. Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/coredns/templates/configmap-autoscaler.yaml b/stable/coredns/templates/configmap-autoscaler.yaml index f03cc2a8a2..50895ae5b6 100644 --- a/stable/coredns/templates/configmap-autoscaler.yaml +++ b/stable/coredns/templates/configmap-autoscaler.yaml @@ -15,9 +15,13 @@ metadata: kubernetes.io/name: "CoreDNS" {{- end }} app.kubernetes.io/name: {{ template "coredns.name" . }}-autoscaler -{{- if .Values.customLabels }} -{{ toYaml .Values.customLabels | indent 4 }} -{{- end }} + {{- if .Values.customLabels }} + {{- toYaml .Values.customLabels | nindent 4 }} + {{- end }} + {{- if .Values.autoscaler.configmap.annotations }} + annotations: + {{- toYaml .Values.autoscaler.configmap.annotations | nindent 4 }} + {{- end }} data: # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. # If using small nodes, "nodesPerReplica" should dominate. diff --git a/stable/coredns/templates/deployment-autoscaler.yaml b/stable/coredns/templates/deployment-autoscaler.yaml index 8ecafb6949..7ca185239d 100644 --- a/stable/coredns/templates/deployment-autoscaler.yaml +++ b/stable/coredns/templates/deployment-autoscaler.yaml @@ -38,6 +38,7 @@ spec: {{ toYaml .Values.customLabels | nindent 8 }} {{- end }} annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap-autoscaler.yaml") . | sha256sum }} {{- if .Values.isClusterService }} scheduler.alpha.kubernetes.io/critical-pod: '' scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' diff --git a/stable/coredns/templates/servicemonitor-autoscaler.yaml b/stable/coredns/templates/servicemonitor-autoscaler.yaml deleted file mode 100644 index 08f9540df3..0000000000 --- a/stable/coredns/templates/servicemonitor-autoscaler.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- if .Values.autoscaler.enabled }} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "coredns.fullname" . }}-autoscaler - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" - {{- if .Values.isClusterService }} - k8s-app: {{ .Chart.Name }}-autoscaler - kubernetes.io/cluster-service: "true" - kubernetes.io/name: "CoreDNS" - {{- end }} - app.kubernetes.io/name: {{ template "coredns.name" . }}-autoscaler -{{- if .Values.customLabels }} -{{ toYaml .Values.customLabels | indent 4 }} -{{- end }} -{{- end }} diff --git a/stable/coredns/values.yaml b/stable/coredns/values.yaml index 5c1ce0cb39..becf135646 100644 --- a/stable/coredns/values.yaml +++ b/stable/coredns/values.yaml @@ -187,3 +187,9 @@ autoscaler: limits: cpu: "20m" memory: "10Mi" + + # Options for autoscaler configmap + configmap: + ## Annotations for the coredns-autoscaler configmap + # i.e. strategy.spinnaker.io/versioned: "false" to ensure configmap isn't renamed + annotations: {}