From 751d90a70c53b3cb15943cca5ce64aeae4e89378 Mon Sep 17 00:00:00 2001 From: Devin Young Date: Thu, 28 Sep 2023 10:40:26 -0400 Subject: [PATCH 1/2] add support for sidecar containers via extraContainers Signed-off-by: Devin Young . . --- charts/coredns/Chart.yaml | 6 +++--- charts/coredns/README.md | 2 ++ charts/coredns/templates/deployment-autoscaler.yaml | 3 +++ charts/coredns/templates/deployment.yaml | 3 +++ charts/coredns/values.yaml | 11 +++++++++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/charts/coredns/Chart.yaml b/charts/coredns/Chart.yaml index a9672d2..263c74b 100644 --- a/charts/coredns/Chart.yaml +++ b/charts/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: coredns -version: 1.26.0 +version: 1.27.0 appVersion: 1.11.1 home: https://coredns.io icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png @@ -20,5 +20,5 @@ engine: gotpl type: application annotations: artifacthub.io/changes: | - - kind: changed - description: Upgrade CoreDNS to 1.11.1 + - kind: added + description: Added support for sidecar containers via extraContainers diff --git a/charts/coredns/README.md b/charts/coredns/README.md index d71ddd7..b98c4a2 100644 --- a/charts/coredns/README.md +++ b/charts/coredns/README.md @@ -95,6 +95,7 @@ The command removes all the Kubernetes components associated with the chart and | `nodeSelector` | Node labels for pod assignment | {} | | `tolerations` | Tolerations for pod assignment | [] | | `zoneFiles` | Configure custom Zone files | [] | +| `extraContainers` | Optional array of sidecar containers | [] | | `extraVolumes` | Optional array of volumes to create | [] | | `extraVolumeMounts` | Optional array of volumes to mount inside the CoreDNS container | [] | | `extraSecrets` | Optional array of secrets to mount inside the CoreDNS container | [] | @@ -136,6 +137,7 @@ The command removes all the Kubernetes components associated with the chart and | `autoscaler.livenessProbe.timeoutSeconds` | When the probe times out | `5` | | `autoscaler.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `3` | | `autoscaler.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `autoscaler.extraContainers` | Optional array of sidecar containers | [] | | `deployment.enabled` | Optionally disable the main deployment and its respective resources. | `true` | | `deployment.name` | Name of the deployment if `deployment.enabled` is true. Otherwise the name of an existing deployment for the autoscaler or HPA to target. | `""` | | `deployment.annotations` | Annotations to add to the main deployment | `{}` | diff --git a/charts/coredns/templates/deployment-autoscaler.yaml b/charts/coredns/templates/deployment-autoscaler.yaml index 3cba866..d24ec1c 100644 --- a/charts/coredns/templates/deployment-autoscaler.yaml +++ b/charts/coredns/templates/deployment-autoscaler.yaml @@ -93,3 +93,6 @@ spec: {{ toYaml .Values.autoscaler.customFlags | indent 10 }} {{- end }} {{- end }} +{{- if .Values.extraContainers }} +{{ toYaml .Values.extraContainers | indent 8 }} +{{- end }} diff --git a/charts/coredns/templates/deployment.yaml b/charts/coredns/templates/deployment.yaml index da9c8a4..9ca11ba 100644 --- a/charts/coredns/templates/deployment.yaml +++ b/charts/coredns/templates/deployment.yaml @@ -134,6 +134,9 @@ spec: {{- if .Values.securityContext }} securityContext: {{- toYaml .Values.securityContext | nindent 10 }} +{{- end }} +{{- if .Values.extraContainers }} +{{ toYaml .Values.extraContainers | indent 8 }} {{- end }} volumes: - name: config-volume diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index 6ffd360..e187c27 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -218,6 +218,11 @@ zoneFiles: [] # example.com. IN A 192.168.99.102 # *.example.com. IN A 192.168.99.102 +# optional array of sidecar containers +extraContainers: [] +# - name: some-container-name +# image: some-image:latest +# imagePullPolicy: Always # optional array of extra volumes to create extraVolumes: [] # - name: some-volume-name @@ -349,6 +354,12 @@ autoscaler: failureThreshold: 3 successThreshold: 1 + # optional array of sidecar containers + extraContainers: [] + # - name: some-container-name + # image: some-image:latest + # imagePullPolicy: Always + deployment: enabled: true name: "" From 0c0737b05cc34af547709c4592c1d83c2b4b8f21 Mon Sep 17 00:00:00 2001 From: Devin Young Date: Sun, 1 Oct 2023 11:51:05 -0400 Subject: [PATCH 2/2] fix namespacing Signed-off-by: Devin Young --- charts/coredns/templates/deployment-autoscaler.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/coredns/templates/deployment-autoscaler.yaml b/charts/coredns/templates/deployment-autoscaler.yaml index d24ec1c..0bd4822 100644 --- a/charts/coredns/templates/deployment-autoscaler.yaml +++ b/charts/coredns/templates/deployment-autoscaler.yaml @@ -93,6 +93,6 @@ spec: {{ toYaml .Values.autoscaler.customFlags | indent 10 }} {{- end }} {{- end }} -{{- if .Values.extraContainers }} -{{ toYaml .Values.extraContainers | indent 8 }} +{{- if .Values.autoscaler.extraContainers }} +{{ toYaml .Values.autoscaler.extraContainers | indent 8 }} {{- end }}