From ec21ad04e4639fd8eba41221bd5e3d3df6689825 Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Sat, 18 Feb 2023 17:02:22 +0100 Subject: [PATCH 1/6] modified Helm chart to mimic Amazon EKS CoreDNS deployment Signed-off-by: Jens-Uwe Walther --- charts/coredns/Chart.yaml | 2 +- .../templates/clusterrole-autoscaler.yaml | 2 +- charts/coredns/templates/clusterrole.yaml | 11 +++- .../clusterrolebinding-autoscaler.yaml | 6 +-- .../coredns/templates/clusterrolebinding.yaml | 13 ++++- .../templates/configmap-autoscaler.yaml | 2 +- charts/coredns/templates/configmap.yaml | 13 +++-- .../templates/deployment-autoscaler.yaml | 6 +-- charts/coredns/templates/deployment.yaml | 2 +- charts/coredns/templates/hpa.yaml | 2 +- .../templates/poddisruptionbudget.yaml | 2 +- charts/coredns/templates/service-metrics.yaml | 2 +- .../templates/serviceaccount-autoscaler.yaml | 2 +- charts/coredns/templates/servicemonitor.yaml | 2 +- charts/coredns/values.yaml | 52 +++++++++++++++++++ 15 files changed, 97 insertions(+), 22 deletions(-) diff --git a/charts/coredns/Chart.yaml b/charts/coredns/Chart.yaml index 09bc4771..cb0ff4a1 100644 --- a/charts/coredns/Chart.yaml +++ b/charts/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: coredns -version: 1.19.7 +version: 1.19.8 appVersion: 1.9.4 home: https://coredns.io icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png diff --git a/charts/coredns/templates/clusterrole-autoscaler.yaml b/charts/coredns/templates/clusterrole-autoscaler.yaml index 241cfac4..957612e3 100644 --- a/charts/coredns/templates/clusterrole-autoscaler.yaml +++ b/charts/coredns/templates/clusterrole-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterrole-autoscaler.name-prefix }}-autoscaler labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/clusterrole.yaml b/charts/coredns/templates/clusterrole.yaml index 4f5c25bc..c8b7dcda 100644 --- a/charts/coredns/templates/clusterrole.yaml +++ b/charts/coredns/templates/clusterrole.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.clusterrole.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} @@ -13,6 +13,15 @@ metadata: kubernetes.io/name: "CoreDNS" {{- end }} app.kubernetes.io/name: {{ template "coredns.name" . }} + {{- if or .Values.clusterrole.annotations .Values.customAnnotations }} + annotations: + {{- if .Values.customAnnotations }} + {{- toYaml .Values.customAnnotations | nindent 4 }} + {{- end }} + {{- if .Values.clusterrole.annotations }} + {{- toYaml .Values.clusterrole.annotations | nindent 4 }} + {{- end }} + {{- end }} rules: - apiGroups: - "" diff --git a/charts/coredns/templates/clusterrolebinding-autoscaler.yaml b/charts/coredns/templates/clusterrolebinding-autoscaler.yaml index 9c7a861d..82358849 100644 --- a/charts/coredns/templates/clusterrolebinding-autoscaler.yaml +++ b/charts/coredns/templates/clusterrolebinding-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterrolebinding-autoscaler.name-prefix }}-autoscaler labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} @@ -24,9 +24,9 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterrole-autoscaler.name-prefix }}-autoscaler subjects: - kind: ServiceAccount - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler namespace: {{ .Release.Namespace }} {{- end }} diff --git a/charts/coredns/templates/clusterrolebinding.yaml b/charts/coredns/templates/clusterrolebinding.yaml index 534a82d1..6780c1dd 100644 --- a/charts/coredns/templates/clusterrolebinding.yaml +++ b/charts/coredns/templates/clusterrolebinding.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.clusterrolebinding.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} @@ -13,10 +13,19 @@ metadata: kubernetes.io/name: "CoreDNS" {{- end }} app.kubernetes.io/name: {{ template "coredns.name" . }} + {{- if or .Values.clusterrolebinding.annotations .Values.customAnnotations }} + annotations: + {{- if .Values.customAnnotations }} + {{- toYaml .Values.customAnnotations | nindent 4 }} + {{- end }} + {{- if .Values.clusterrolebinding.annotations }} + {{- toYaml .Values.clusterrolebinding.annotations | nindent 4 }} + {{- end }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.clusterrole.name }} subjects: - kind: ServiceAccount name: {{ template "coredns.serviceAccountName" . }} diff --git a/charts/coredns/templates/configmap-autoscaler.yaml b/charts/coredns/templates/configmap-autoscaler.yaml index dab4d5a0..dffcf6d7 100644 --- a/charts/coredns/templates/configmap-autoscaler.yaml +++ b/charts/coredns/templates/configmap-autoscaler.yaml @@ -3,7 +3,7 @@ kind: ConfigMap apiVersion: v1 metadata: - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.configmap-autoscaler.name-prefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} diff --git a/charts/coredns/templates/configmap.yaml b/charts/coredns/templates/configmap.yaml index 496f0268..add536ce 100644 --- a/charts/coredns/templates/configmap.yaml +++ b/charts/coredns/templates/configmap.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.configmap.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} @@ -17,10 +17,15 @@ metadata: {{- if .Values.customLabels }} {{ toYaml .Values.customLabels | indent 4 }} {{- end }} -{{- with .Values.customAnnotations }} + {{- if or .Values.configmap.annotations .Values.customAnnotations }} annotations: -{{- toYaml . | nindent 4 }} -{{- end }} + {{- if .Values.customAnnotations }} + {{- toYaml .Values.customAnnotations | nindent 4 }} + {{- end }} + {{- if .Values.configmap.annotations }} + {{- toYaml .Values.configmap.annotations | nindent 4 }} + {{- end }} + {{- end }} data: Corefile: |- {{- range $name, $conf := .Values.extraConfig }} diff --git a/charts/coredns/templates/deployment-autoscaler.yaml b/charts/coredns/templates/deployment-autoscaler.yaml index 30db3b66..c9ee4eff 100644 --- a/charts/coredns/templates/deployment-autoscaler.yaml +++ b/charts/coredns/templates/deployment-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.autoscaler.name-prefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} @@ -52,7 +52,7 @@ spec: scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' {{- end }} spec: - serviceAccountName: {{ template "coredns.fullname" . }}-autoscaler + serviceAccountName: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler {{- $priorityClassName := default .Values.priorityClassName .Values.autoscaler.priorityClassName }} {{- if $priorityClassName }} priorityClassName: {{ $priorityClassName | quote }} @@ -90,7 +90,7 @@ spec: command: - /cluster-proportional-autoscaler - --namespace={{ .Release.Namespace }} - - --configmap={{ template "coredns.fullname" . }}-autoscaler + - --configmap={{ default (include "coredns.fullname" .) .Values.configmap-autoscaler.name-prefix }}-autoscaler - --target=Deployment/{{ default (include "coredns.fullname" .) .Values.deployment.name }} - --logtostderr=true - --v=2 diff --git a/charts/coredns/templates/deployment.yaml b/charts/coredns/templates/deployment.yaml index 7412e19c..75ea7c69 100644 --- a/charts/coredns/templates/deployment.yaml +++ b/charts/coredns/templates/deployment.yaml @@ -147,7 +147,7 @@ spec: volumes: - name: config-volume configMap: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.configmap.name }} items: - key: Corefile path: Corefile diff --git a/charts/coredns/templates/hpa.yaml b/charts/coredns/templates/hpa.yaml index 5fc3cff4..aa85a3c3 100644 --- a/charts/coredns/templates/hpa.yaml +++ b/charts/coredns/templates/hpa.yaml @@ -3,7 +3,7 @@ apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.hpa.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/poddisruptionbudget.yaml b/charts/coredns/templates/poddisruptionbudget.yaml index 5eddb351..1dd83fc1 100644 --- a/charts/coredns/templates/poddisruptionbudget.yaml +++ b/charts/coredns/templates/poddisruptionbudget.yaml @@ -2,7 +2,7 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.pdb.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/service-metrics.yaml b/charts/coredns/templates/service-metrics.yaml index 7e6ce78d..93660f05 100644 --- a/charts/coredns/templates/service-metrics.yaml +++ b/charts/coredns/templates/service-metrics.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "coredns.fullname" . }}-metrics + name: {{ default (include "coredns.fullname" .) .Values.service-metrics.name-prefix }}-metrics labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/serviceaccount-autoscaler.yaml b/charts/coredns/templates/serviceaccount-autoscaler.yaml index d068a035..6ca57caf 100644 --- a/charts/coredns/templates/serviceaccount-autoscaler.yaml +++ b/charts/coredns/templates/serviceaccount-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ template "coredns.fullname" . }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} diff --git a/charts/coredns/templates/servicemonitor.yaml b/charts/coredns/templates/servicemonitor.yaml index d5e68049..43f53f09 100644 --- a/charts/coredns/templates/servicemonitor.yaml +++ b/charts/coredns/templates/servicemonitor.yaml @@ -2,7 +2,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ template "coredns.fullname" . }} + name: {{ default (include "coredns.fullname" .) .Values.servicemonitor.name }} {{- if .Values.prometheus.monitor.namespace }} namespace: {{ .Values.prometheus.monitor.namespace }} {{- end }} diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index e7d21c2f..cda82e41 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -256,10 +256,13 @@ hpa: minReplicas: 1 maxReplicas: 2 metrics: [] + name: "" ## Configue a cluster-proportional-autoscaler for coredns # See https://github.com/kubernetes-incubator/cluster-proportional-autoscaler autoscaler: + # deployment and all other autoscaler related components will be appended with "-autoscaler" + name-prefix: "" # Enabled the cluster-proportional-autoscaler enabled: false @@ -334,3 +337,52 @@ deployment: name: "" ## Annotations for the coredns deployment annotations: {} + +# additional values to mimic Amazon EKS CoreDNS implementation +configmap: + name: "" + ## Annotations for the coredns deployment + annotations: {} + +clusterrole: + name: "" + ## Annotations for the coredns deployment + annotations: {} + +clusterrolebinding: + name: "" + ## Annotations for the coredns deployment + annotations: {} + +# additional changes to have common naming schema across all resources +# see hpa section above +#hpa: +# name: "" + +pdb: + name: "" + +servicemonitor: + name: "" + +# see autoscaler section above +#deployment-autoscaler: +# name: "" + +configmap-autoscaler: + name-prefix: "" + +serviceaccount-autoscaler: + name-prefix: "" + +clusterrole-autoscaler: + name-prefix: "" + +clusterrolebinding-autoscaler: + name-prefix: "" + +serviceaccount-autoscaler: + name-prefix: "" + +service-metrics: + name-prefix: "" From 144ad7c7d3c42ec03bf579fb61d13122e9955bf3 Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Sat, 18 Feb 2023 17:15:46 +0100 Subject: [PATCH 2/6] minor changes due to PDB Signed-off-by: Jens-Uwe Walther --- charts/coredns/templates/poddisruptionbudget.yaml | 2 +- charts/coredns/values.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/coredns/templates/poddisruptionbudget.yaml b/charts/coredns/templates/poddisruptionbudget.yaml index 1dd83fc1..0a619a82 100644 --- a/charts/coredns/templates/poddisruptionbudget.yaml +++ b/charts/coredns/templates/poddisruptionbudget.yaml @@ -2,7 +2,7 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ default (include "coredns.fullname" .) .Values.pdb.name }} + name: {{ default (include "coredns.fullname" .) .Values.podDisruptionBudget.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index cda82e41..c34d77aa 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -359,8 +359,9 @@ clusterrolebinding: #hpa: # name: "" -pdb: - name: "" +# see podDisruptionBudget section above +#pdb: +# name: "" servicemonitor: name: "" From 2322e318b6a7789820372b2d4c33522b5325ea27 Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Sun, 19 Feb 2023 10:32:33 +0100 Subject: [PATCH 3/6] modified values.yaml resources to not contain hyphen in name because this is not supported for Helm Signed-off-by: Jens-Uwe Walther --- .../templates/clusterrole-autoscaler.yaml | 2 +- .../clusterrolebinding-autoscaler.yaml | 6 ++--- .../templates/configmap-autoscaler.yaml | 2 +- .../templates/deployment-autoscaler.yaml | 6 ++--- charts/coredns/templates/service-metrics.yaml | 2 +- .../templates/serviceaccount-autoscaler.yaml | 2 +- charts/coredns/values.yaml | 26 +++++++++---------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/charts/coredns/templates/clusterrole-autoscaler.yaml b/charts/coredns/templates/clusterrole-autoscaler.yaml index 957612e3..a6fe1b6d 100644 --- a/charts/coredns/templates/clusterrole-autoscaler.yaml +++ b/charts/coredns/templates/clusterrole-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: {{ default (include "coredns.fullname" .) .Values.clusterrole-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterroleAutoscaler.namePrefix }}-autoscaler labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/clusterrolebinding-autoscaler.yaml b/charts/coredns/templates/clusterrolebinding-autoscaler.yaml index 82358849..22466839 100644 --- a/charts/coredns/templates/clusterrolebinding-autoscaler.yaml +++ b/charts/coredns/templates/clusterrolebinding-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ default (include "coredns.fullname" .) .Values.clusterrolebinding-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterrolebindingAutoscaler.namePrefix }}-autoscaler labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} @@ -24,9 +24,9 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ default (include "coredns.fullname" .) .Values.clusterrole-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.clusterroleAutoscaler.namePrefix }}-autoscaler subjects: - kind: ServiceAccount - name: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.serviceaccountAutoscaler.namePrefix }}-autoscaler namespace: {{ .Release.Namespace }} {{- end }} diff --git a/charts/coredns/templates/configmap-autoscaler.yaml b/charts/coredns/templates/configmap-autoscaler.yaml index dffcf6d7..a77bf3c4 100644 --- a/charts/coredns/templates/configmap-autoscaler.yaml +++ b/charts/coredns/templates/configmap-autoscaler.yaml @@ -3,7 +3,7 @@ kind: ConfigMap apiVersion: v1 metadata: - name: {{ default (include "coredns.fullname" .) .Values.configmap-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.configmapAutoscaler.namePrefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} diff --git a/charts/coredns/templates/deployment-autoscaler.yaml b/charts/coredns/templates/deployment-autoscaler.yaml index c9ee4eff..1b24005c 100644 --- a/charts/coredns/templates/deployment-autoscaler.yaml +++ b/charts/coredns/templates/deployment-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ default (include "coredns.fullname" .) .Values.autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.autoscaler.namePrefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} @@ -52,7 +52,7 @@ spec: scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' {{- end }} spec: - serviceAccountName: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler + serviceAccountName: {{ default (include "coredns.fullname" .) .Values.serviceaccountAutoscaler.namePrefix }}-autoscaler {{- $priorityClassName := default .Values.priorityClassName .Values.autoscaler.priorityClassName }} {{- if $priorityClassName }} priorityClassName: {{ $priorityClassName | quote }} @@ -90,7 +90,7 @@ spec: command: - /cluster-proportional-autoscaler - --namespace={{ .Release.Namespace }} - - --configmap={{ default (include "coredns.fullname" .) .Values.configmap-autoscaler.name-prefix }}-autoscaler + - --configmap={{ default (include "coredns.fullname" .) .Values.configmapAutoscaler.namePrefix }}-autoscaler - --target=Deployment/{{ default (include "coredns.fullname" .) .Values.deployment.name }} - --logtostderr=true - --v=2 diff --git a/charts/coredns/templates/service-metrics.yaml b/charts/coredns/templates/service-metrics.yaml index 93660f05..b89941cd 100644 --- a/charts/coredns/templates/service-metrics.yaml +++ b/charts/coredns/templates/service-metrics.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ default (include "coredns.fullname" .) .Values.service-metrics.name-prefix }}-metrics + name: {{ default (include "coredns.fullname" .) .Values.servicemetrics.namePrefix }}-metrics labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/templates/serviceaccount-autoscaler.yaml b/charts/coredns/templates/serviceaccount-autoscaler.yaml index 6ca57caf..304e3347 100644 --- a/charts/coredns/templates/serviceaccount-autoscaler.yaml +++ b/charts/coredns/templates/serviceaccount-autoscaler.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ default (include "coredns.fullname" .) .Values.serviceaccount-autoscaler.name-prefix }}-autoscaler + name: {{ default (include "coredns.fullname" .) .Values.serviceaccountAutoscaler.namePrefix }}-autoscaler namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index c34d77aa..98174e43 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -262,7 +262,7 @@ hpa: # See https://github.com/kubernetes-incubator/cluster-proportional-autoscaler autoscaler: # deployment and all other autoscaler related components will be appended with "-autoscaler" - name-prefix: "" + namePrefix: "" # Enabled the cluster-proportional-autoscaler enabled: false @@ -370,20 +370,20 @@ servicemonitor: #deployment-autoscaler: # name: "" -configmap-autoscaler: - name-prefix: "" +configmapAutoscaler: + namePrefix: "" -serviceaccount-autoscaler: - name-prefix: "" +serviceaccountAutoscaler: + namePrefix: "" -clusterrole-autoscaler: - name-prefix: "" +clusterroleAutoscaler: + namePrefix: "" -clusterrolebinding-autoscaler: - name-prefix: "" +clusterrolebindingAutoscaler: + namePrefix: "" -serviceaccount-autoscaler: - name-prefix: "" +serviceaccountAutoscaler: + namePrefix: "" -service-metrics: - name-prefix: "" +servicemetrics: + namePrefix: "" From c0e9369226707363d14e7db1530ff2bcd613359e Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Sun, 19 Feb 2023 10:37:28 +0100 Subject: [PATCH 4/6] added pdb.name because it does not fit intp podDisruptionBudget resource Signed-off-by: Jens-Uwe Walther --- charts/coredns/templates/poddisruptionbudget.yaml | 2 +- charts/coredns/values.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/coredns/templates/poddisruptionbudget.yaml b/charts/coredns/templates/poddisruptionbudget.yaml index 0a619a82..1dd83fc1 100644 --- a/charts/coredns/templates/poddisruptionbudget.yaml +++ b/charts/coredns/templates/poddisruptionbudget.yaml @@ -2,7 +2,7 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ default (include "coredns.fullname" .) .Values.podDisruptionBudget.name }} + name: {{ default (include "coredns.fullname" .) .Values.pdb.name }} labels: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/instance: {{ .Release.Name | quote }} diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index 98174e43..c36ab0d8 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -359,9 +359,8 @@ clusterrolebinding: #hpa: # name: "" -# see podDisruptionBudget section above -#pdb: -# name: "" +pdb: + name: "" servicemonitor: name: "" From 39e8079919be1bdd2487bbe8610ceb3a5662329e Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Sun, 19 Feb 2023 18:05:41 +0100 Subject: [PATCH 5/6] removed critical-pod annotation because it is already invalid Signed-off-by: Jens-Uwe Walther --- charts/coredns/templates/deployment-autoscaler.yaml | 1 - charts/coredns/templates/deployment.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/charts/coredns/templates/deployment-autoscaler.yaml b/charts/coredns/templates/deployment-autoscaler.yaml index 1b24005c..848c9e85 100644 --- a/charts/coredns/templates/deployment-autoscaler.yaml +++ b/charts/coredns/templates/deployment-autoscaler.yaml @@ -48,7 +48,6 @@ spec: 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"}]' {{- end }} spec: diff --git a/charts/coredns/templates/deployment.yaml b/charts/coredns/templates/deployment.yaml index 75ea7c69..50f27f33 100644 --- a/charts/coredns/templates/deployment.yaml +++ b/charts/coredns/templates/deployment.yaml @@ -57,7 +57,6 @@ spec: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- if .Values.isClusterService }} - scheduler.alpha.kubernetes.io/critical-pod: '' scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' {{- end }} {{- if .Values.podAnnotations }} From 862d4ef2f4801fe6efc465357e93c3a93b580086 Mon Sep 17 00:00:00 2001 From: Jens-Uwe Walther Date: Wed, 22 Feb 2023 09:38:43 +0100 Subject: [PATCH 6/6] final commit before submitting PR Signed-off-by: Jens-Uwe Walther --- charts/coredns/values.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index c36ab0d8..8c5efceb 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -355,20 +355,13 @@ clusterrolebinding: annotations: {} # additional changes to have common naming schema across all resources -# see hpa section above -#hpa: -# name: "" - pdb: name: "" servicemonitor: name: "" -# see autoscaler section above -#deployment-autoscaler: -# name: "" - +# all autoscaler related components will be appended with "-autoscaler" configmapAutoscaler: namePrefix: ""