From b77eed852dfa7eb529ce909dbad001aaf8498ca4 Mon Sep 17 00:00:00 2001 From: Tyler Nguyen Date: Fri, 23 Jul 2021 22:45:13 +0700 Subject: [PATCH] add: imagePullSecret support for private container registry Signed-off-by: Tyler Nguyen --- stable/coredns/Chart.yaml | 2 +- stable/coredns/README.md | 2 ++ .../coredns/templates/serviceaccount-autoscaler.yaml | 6 ++++++ stable/coredns/templates/serviceaccount.yaml | 6 ++++++ stable/coredns/values.yaml | 12 ++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index 248acd9..13dca33 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: coredns -version: 1.16.2 +version: 1.16.3 appVersion: 1.8.4 home: https://coredns.io icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png diff --git a/stable/coredns/README.md b/stable/coredns/README.md index c98d705..39c6d9c 100644 --- a/stable/coredns/README.md +++ b/stable/coredns/README.md @@ -51,6 +51,7 @@ The command removes all the Kubernetes components associated with the chart and | `image.repository` | The image repository to pull from | coredns/coredns | | `image.tag` | The image tag to pull from | `1.8.4` | | `image.pullPolicy` | Image pull policy | IfNotPresent | +| `image.pullSecrets` | Specify container image pull secrets | `[]` | | `replicaCount` | Number of replicas | 1 | | `resources.limits.cpu` | Container maximum CPU | `100m` | | `resources.limits.memory` | Container maximum memory | `128Mi` | @@ -114,6 +115,7 @@ The command removes all the Kubernetes components associated with the chart and | `autoscaler.image.repository` | The image repository to pull autoscaler from | k8s.gcr.io/cluster-proportional-autoscaler-amd64 | | `autoscaler.image.tag` | The image tag to pull autoscaler from | `1.8.1` | | `autoscaler.image.pullPolicy` | Image pull policy for the autoscaler | IfNotPresent | +| `autoscaler.image.pullSecrets` | Specify container image pull secrets | `[]` | | `autoscaler.priorityClassName` | Optional priority class for the autoscaler pod. `priorityClassName` used if not set. | `""` | | `autoscaler.affinity` | Affinity settings for pod assignment for autoscaler | {} | | `autoscaler.nodeSelector` | Node labels for pod assignment for autoscaler | {} | diff --git a/stable/coredns/templates/serviceaccount-autoscaler.yaml b/stable/coredns/templates/serviceaccount-autoscaler.yaml index 972c746..64f74fa 100644 --- a/stable/coredns/templates/serviceaccount-autoscaler.yaml +++ b/stable/coredns/templates/serviceaccount-autoscaler.yaml @@ -18,4 +18,10 @@ metadata: {{- if .Values.customLabels }} {{ toYaml .Values.customLabels | indent 4 }} {{- end }} +{{- if .Values.autoscaler.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.autoscaler.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end }} {{- end }} diff --git a/stable/coredns/templates/serviceaccount.yaml b/stable/coredns/templates/serviceaccount.yaml index a22f0cf..0b1a1b0 100644 --- a/stable/coredns/templates/serviceaccount.yaml +++ b/stable/coredns/templates/serviceaccount.yaml @@ -17,4 +17,10 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} +{{- if .Values.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end }} {{- end }} diff --git a/stable/coredns/values.yaml b/stable/coredns/values.yaml index d7397c7..c952736 100644 --- a/stable/coredns/values.yaml +++ b/stable/coredns/values.yaml @@ -6,6 +6,12 @@ image: repository: coredns/coredns tag: "1.8.4" pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName replicaCount: 1 @@ -246,6 +252,12 @@ autoscaler: repository: k8s.gcr.io/cluster-proportional-autoscaler-amd64 tag: "1.8.1" pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName # Optional priority class to be used for the autoscaler pods. priorityClassName used if not set. priorityClassName: ""