refactor(deploy): use external (hand-made) image pull secret
This commit is contained in:
parent
b0437179d0
commit
daedf8af04
5 changed files with 8 additions and 23 deletions
|
|
@ -1,5 +0,0 @@
|
|||
{{- define "imagePullSecret" }}
|
||||
{{- with .Values.imageCredentials }}
|
||||
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -29,8 +29,10 @@ spec:
|
|||
app.kubernetes.io/component: "backend-api"
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
{{- with .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Release.Name }}-pull-secret
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-pull-secret
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install
|
||||
"helm.sh/hook-weight": "-99"
|
||||
"helm.sh/hook-delete-policy": before-hook-creation
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
Reference in a new issue