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
|
|
@ -11,9 +11,9 @@ spec:
|
|||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
{{- if .Values.dockerconfigjsonBase64 }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
- name: {{ .Release.Name }}-container-registry
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ spec:
|
|||
activeDeadlineSeconds: 120 # 2 minutes
|
||||
template:
|
||||
spec:
|
||||
{{- if .Values.dockerconfigjsonBase64 }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Release.Name }}-container-registry
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-migration
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ spec:
|
|||
activeDeadlineSeconds: 120 # 2 minutes
|
||||
template:
|
||||
spec:
|
||||
{{- if .Values.dockerconfigjsonBase64 }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Release.Name }}-container-registry
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-seed
|
||||
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
|
||||
tag:
|
||||
|
||||
imagePullSecrets: {}
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
host: example.com
|
||||
|
|
@ -37,3 +35,5 @@ backoffice:
|
|||
nextauthSecret: null
|
||||
googleClientID: null
|
||||
googleClientSecret: null
|
||||
|
||||
dockerconfigjsonBase64: null
|
||||
|
|
|
|||
Reference in a new issue