nodebrady: private container repo as optional
Signed-off-by: Mathieu Benoit <mabenoit@microsoft.com>
This commit is contained in:
Родитель
fcc3501cfe
Коммит
37ffaffc4a
|
@ -14,3 +14,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
|||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Generate the imagePullSecret for a private Container Registry.
|
||||
*/}}
|
||||
{{- define "imagePullSecret" }}
|
||||
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.image.repository (printf "%s:%s" .Values.image.username .Values.image.password | b64enc) | b64enc }}
|
||||
{{- end }}
|
|
@ -17,6 +17,10 @@ spec:
|
|||
labels:
|
||||
app: {{ template "fullname" . }}
|
||||
spec:
|
||||
{{ if .Values.image.private }}
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
{{ end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{{ if .Values.image.private }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: acr-secret
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{ end }}
|
|
@ -1,5 +1,6 @@
|
|||
replicaCount: 1
|
||||
image:
|
||||
private: false
|
||||
pullPolicy: Always
|
||||
service:
|
||||
internalPort: 3000
|
||||
|
|
Загрузка…
Ссылка в новой задаче