1
0
Fork 0

refactor(deploy): use external (hand-made) image pull secret

This commit is contained in:
Vojtěch Mareš 2024-06-25 07:33:35 +02:00
parent b0437179d0
commit daedf8af04
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
5 changed files with 8 additions and 23 deletions

View file

@ -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 }}

View file

@ -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 }}"

View file

@ -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" . }}