diff --git a/captainkube/charts/captainkube/templates/_helpers.tpl b/captainkube/charts/captainkube/templates/_helpers.tpl index f0d83d2..eba3ee9 100755 --- a/captainkube/charts/captainkube/templates/_helpers.tpl +++ b/captainkube/charts/captainkube/templates/_helpers.tpl @@ -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 }} \ No newline at end of file diff --git a/captainkube/charts/captainkube/templates/deployment.yaml b/captainkube/charts/captainkube/templates/deployment.yaml index ba0fbdc..1199462 100755 --- a/captainkube/charts/captainkube/templates/deployment.yaml +++ b/captainkube/charts/captainkube/templates/deployment.yaml @@ -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 }}" diff --git a/captainkube/charts/captainkube/templates/secret.yaml b/captainkube/charts/captainkube/templates/secret.yaml new file mode 100644 index 0000000..3d2dd6e --- /dev/null +++ b/captainkube/charts/captainkube/templates/secret.yaml @@ -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 }} \ No newline at end of file diff --git a/captainkube/charts/captainkube/values.yaml b/captainkube/charts/captainkube/values.yaml index 38fcb10..14b3e58 100755 --- a/captainkube/charts/captainkube/values.yaml +++ b/captainkube/charts/captainkube/values.yaml @@ -1,3 +1,4 @@ replicaCount: 1 image: + private: false pullPolicy: Always \ No newline at end of file diff --git a/nodebrady/charts/nodebrady/templates/_helpers.tpl b/nodebrady/charts/nodebrady/templates/_helpers.tpl index f0d83d2..eba3ee9 100755 --- a/nodebrady/charts/nodebrady/templates/_helpers.tpl +++ b/nodebrady/charts/nodebrady/templates/_helpers.tpl @@ -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 }} \ No newline at end of file diff --git a/nodebrady/charts/nodebrady/templates/deployment.yaml b/nodebrady/charts/nodebrady/templates/deployment.yaml index 49a9b28..c820cfa 100755 --- a/nodebrady/charts/nodebrady/templates/deployment.yaml +++ b/nodebrady/charts/nodebrady/templates/deployment.yaml @@ -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 }}" diff --git a/nodebrady/charts/nodebrady/templates/secret.yaml b/nodebrady/charts/nodebrady/templates/secret.yaml new file mode 100644 index 0000000..3d2dd6e --- /dev/null +++ b/nodebrady/charts/nodebrady/templates/secret.yaml @@ -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 }} \ No newline at end of file diff --git a/nodebrady/charts/nodebrady/values.yaml b/nodebrady/charts/nodebrady/values.yaml index 162aa7b..edad168 100755 --- a/nodebrady/charts/nodebrady/values.yaml +++ b/nodebrady/charts/nodebrady/values.yaml @@ -1,5 +1,6 @@ replicaCount: 1 image: + private: false pullPolicy: Always service: internalPort: 3000 diff --git a/parrot/charts/parrot/templates/_helpers.tpl b/parrot/charts/parrot/templates/_helpers.tpl index f0d83d2..eba3ee9 100755 --- a/parrot/charts/parrot/templates/_helpers.tpl +++ b/parrot/charts/parrot/templates/_helpers.tpl @@ -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 }} \ No newline at end of file diff --git a/parrot/charts/parrot/templates/deployment.yaml b/parrot/charts/parrot/templates/deployment.yaml index 19b49f5..0811aea 100755 --- a/parrot/charts/parrot/templates/deployment.yaml +++ b/parrot/charts/parrot/templates/deployment.yaml @@ -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 }}" diff --git a/parrot/charts/parrot/templates/secret.yaml b/parrot/charts/parrot/templates/secret.yaml new file mode 100644 index 0000000..3d2dd6e --- /dev/null +++ b/parrot/charts/parrot/templates/secret.yaml @@ -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 }} \ No newline at end of file diff --git a/parrot/charts/parrot/templates/service.yaml b/parrot/charts/parrot/templates/service.yaml index bce6eec..7635872 100644 --- a/parrot/charts/parrot/templates/service.yaml +++ b/parrot/charts/parrot/templates/service.yaml @@ -14,4 +14,8 @@ spec: targetPort: {{ .Values.service.internalPort }} selector: app: {{ template "fullname" . }} - type: ClusterIP \ No newline at end of file +{{ if .Values.ingress.enabled }} + type: ClusterIP +{{ else }} + type: LoadBalancer +{{ end }} \ No newline at end of file diff --git a/parrot/charts/parrot/values.yaml b/parrot/charts/parrot/values.yaml index a579cba..12a3025 100755 --- a/parrot/charts/parrot/values.yaml +++ b/parrot/charts/parrot/values.yaml @@ -1,5 +1,6 @@ replicaCount: 1 image: + private: false pullPolicy: Always service: internalPort: 80 diff --git a/phippy/charts/phippy/templates/_helpers.tpl b/phippy/charts/phippy/templates/_helpers.tpl index f0d83d2..eba3ee9 100755 --- a/phippy/charts/phippy/templates/_helpers.tpl +++ b/phippy/charts/phippy/templates/_helpers.tpl @@ -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 }} \ No newline at end of file diff --git a/phippy/charts/phippy/templates/deployment.yaml b/phippy/charts/phippy/templates/deployment.yaml index 9139f99..65e25a9 100755 --- a/phippy/charts/phippy/templates/deployment.yaml +++ b/phippy/charts/phippy/templates/deployment.yaml @@ -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 }}" diff --git a/phippy/charts/phippy/templates/secret.yaml b/phippy/charts/phippy/templates/secret.yaml new file mode 100644 index 0000000..3d2dd6e --- /dev/null +++ b/phippy/charts/phippy/templates/secret.yaml @@ -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 }} \ No newline at end of file diff --git a/phippy/charts/phippy/values.yaml b/phippy/charts/phippy/values.yaml index ffbbf21..d22d9bc 100755 --- a/phippy/charts/phippy/values.yaml +++ b/phippy/charts/phippy/values.yaml @@ -3,6 +3,7 @@ # Declare variables to be passed into your templates. replicaCount: 1 image: + private: false pullPolicy: IfNotPresent service: externalPort: 80