Merge pull request #15 from mathieu-benoit/private-registry
Private Container Registry as Optional
This commit is contained in:
Коммит
0ffa38d42c
|
@ -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: {{ .Chart.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: {{ .Chart.Name }}-acr-secret
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{ end }}
|
|
@ -1,3 +1,4 @@
|
|||
replicaCount: 1
|
||||
image:
|
||||
private: false
|
||||
pullPolicy: Always
|
|
@ -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: {{ .Chart.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: {{ .Chart.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
|
||||
|
|
|
@ -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: {{ .Chart.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: {{ .Chart.Name }}-acr-secret
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{ end }}
|
|
@ -14,4 +14,8 @@ spec:
|
|||
targetPort: {{ .Values.service.internalPort }}
|
||||
selector:
|
||||
app: {{ template "fullname" . }}
|
||||
{{ if .Values.ingress.enabled }}
|
||||
type: ClusterIP
|
||||
{{ else }}
|
||||
type: LoadBalancer
|
||||
{{ end }}
|
|
@ -1,5 +1,6 @@
|
|||
replicaCount: 1
|
||||
image:
|
||||
private: false
|
||||
pullPolicy: Always
|
||||
service:
|
||||
internalPort: 80
|
||||
|
|
|
@ -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 }}
|
|
@ -15,6 +15,10 @@ spec:
|
|||
draft: {{ default "draft-app" .Values.draft }}
|
||||
app: {{ template "fullname" . }}
|
||||
spec:
|
||||
{{ if .Values.image.private }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Chart.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: {{ .Chart.Name }}-acr-secret
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{ end }}
|
|
@ -3,6 +3,7 @@
|
|||
# Declare variables to be passed into your templates.
|
||||
replicaCount: 1
|
||||
image:
|
||||
private: false
|
||||
pullPolicy: IfNotPresent
|
||||
service:
|
||||
externalPort: 80
|
||||
|
|
Загрузка…
Ссылка в новой задаче