From e2d974596d218b675cbc8dfa6a66918d17b79ccc Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Thu, 19 May 2022 14:47:26 +0200 Subject: [PATCH] feat(chart): add registry secret for pulling from private registries --- deploy/chart/wsj-standup/templates/job.yaml | 4 ++-- deploy/chart/wsj-standup/templates/registry-secret.yaml | 7 +++++++ deploy/chart/wsj-standup/values.yaml | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 deploy/chart/wsj-standup/templates/registry-secret.yaml diff --git a/deploy/chart/wsj-standup/templates/job.yaml b/deploy/chart/wsj-standup/templates/job.yaml index 3c6700c..17ba4e4 100644 --- a/deploy/chart/wsj-standup/templates/job.yaml +++ b/deploy/chart/wsj-standup/templates/job.yaml @@ -11,9 +11,9 @@ spec: ttlSecondsAfterFinished: 300 template: spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.image.pullSecretBase64 }} imagePullSecrets: - {{- toYaml . | nindent 12 }} + - name: {{ include "wsj-standup.fullname" . }}-registry-credentials {{- end }} serviceAccountName: {{ include "wsj-standup.serviceAccountName" . }} containers: diff --git a/deploy/chart/wsj-standup/templates/registry-secret.yaml b/deploy/chart/wsj-standup/templates/registry-secret.yaml new file mode 100644 index 0000000..722f864 --- /dev/null +++ b/deploy/chart/wsj-standup/templates/registry-secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "wsj-standup.fullname" . }}-registry-credentials +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: {{ .Values.image.pullSecretBase64 }} diff --git a/deploy/chart/wsj-standup/values.yaml b/deploy/chart/wsj-standup/values.yaml index 76e0f94..26d491e 100644 --- a/deploy/chart/wsj-standup/values.yaml +++ b/deploy/chart/wsj-standup/values.yaml @@ -3,8 +3,9 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" + pullSecretBase64: null + -imagePullSecrets: [] nameOverride: "" fullnameOverride: ""