feat(helm): add image pull secret for private registries
This commit is contained in:
parent
38c28dc73f
commit
4187512f88
6 changed files with 26 additions and 4 deletions
|
|
@ -30,6 +30,7 @@ deploy:staging:dry-run:
|
||||||
--namespace backoffice-staging \
|
--namespace backoffice-staging \
|
||||||
--values ./charts/backoffice/values.staging.yaml \
|
--values ./charts/backoffice/values.staging.yaml \
|
||||||
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
|
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
|
||||||
|
--set dockerconfigjsonBase64=dummy \
|
||||||
--set backoffice.secrets.databaseURL=dummy \
|
--set backoffice.secrets.databaseURL=dummy \
|
||||||
--set backoffice.secrets.nextauthSecret=dummy \
|
--set backoffice.secrets.nextauthSecret=dummy \
|
||||||
--set backoffice.secrets.googleClientID=dummy \
|
--set backoffice.secrets.googleClientID=dummy \
|
||||||
|
|
@ -54,6 +55,7 @@ deploy:staging:
|
||||||
--namespace backoffice-staging \
|
--namespace backoffice-staging \
|
||||||
--values ./charts/backoffice/values.staging.yaml \
|
--values ./charts/backoffice/values.staging.yaml \
|
||||||
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
|
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
|
||||||
|
--set dockerconfigjsonBase64=$DOCKERCONFIG_BASE64 \
|
||||||
--set backoffice.secrets.databaseURL=$DATABASE_URL \
|
--set backoffice.secrets.databaseURL=$DATABASE_URL \
|
||||||
--set backoffice.secrets.nextauthSecret=$NEXTAUTH_SECRET \
|
--set backoffice.secrets.nextauthSecret=$NEXTAUTH_SECRET \
|
||||||
--set backoffice.secrets.googleClientID=$GOOGLE_CLIENT_ID \
|
--set backoffice.secrets.googleClientID=$GOOGLE_CLIENT_ID \
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ spec:
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- if .Values.dockerconfigjsonBase64 }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
- name: {{ .Release.Name }}-container-registry
|
||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ spec:
|
||||||
activeDeadlineSeconds: 120 # 2 minutes
|
activeDeadlineSeconds: 120 # 2 minutes
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
|
{{- if .Values.dockerconfigjsonBase64 }}
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: {{ .Release.Name }}-container-registry
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}-migration
|
- name: {{ .Chart.Name }}-migration
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ spec:
|
||||||
activeDeadlineSeconds: 120 # 2 minutes
|
activeDeadlineSeconds: 120 # 2 minutes
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
|
{{- if .Values.dockerconfigjsonBase64 }}
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: {{ .Release.Name }}-container-registry
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}-seed
|
- name: {{ .Chart.Name }}-seed
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
|
|
|
||||||
12
charts/backoffice/templates/secret-container-registry.yaml
Normal file
12
charts/backoffice/templates/secret-container-registry.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{{ if .Values.dockerconfigjsonBase64 }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-container-registry
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": pre-install,pre-upgrade
|
||||||
|
"helm.sh/hook-weight": "-15"
|
||||||
|
type: kubernetes.io/dockerconfigjson
|
||||||
|
data:
|
||||||
|
.dockerconfigjson: {{ .Values.dockerconfigjsonBase64 }}
|
||||||
|
{{ end }}
|
||||||
|
|
@ -4,8 +4,6 @@ image:
|
||||||
repository: ghcr.io/vojtechmares/backoffice
|
repository: ghcr.io/vojtechmares/backoffice
|
||||||
tag:
|
tag:
|
||||||
|
|
||||||
imagePullSecrets: {}
|
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
host: example.com
|
host: example.com
|
||||||
|
|
@ -37,3 +35,5 @@ backoffice:
|
||||||
nextauthSecret: null
|
nextauthSecret: null
|
||||||
googleClientID: null
|
googleClientID: null
|
||||||
googleClientSecret: null
|
googleClientSecret: null
|
||||||
|
|
||||||
|
dockerconfigjsonBase64: null
|
||||||
|
|
|
||||||
Reference in a new issue