[stable/parse] Add global 'imagePullSecrets' to overwrite any other existing one (#12077)

* [stable/parse] Add global 'imagePullSecrets' to overwrite any other existing one

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Fix typo and add var to the README

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Fix typo in helpers

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Rename pullSecrets values

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>
This commit is contained in:
Carlos Rodríguez Hernández
2019-03-12 02:39:04 -07:00
committed by Kubernetes Prow Robot
parent cb925c5ee5
commit 8eeaccb03c
6 changed files with 47 additions and 18 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: parse
version: 6.0.3
version: 6.1.0
appVersion: 3.1.3
description: Parse is a platform that enables users to add a scalable and powerful backend to launch a full-featured app for iOS, Android, JavaScript, Windows, Unity, and more.
keywords:
+1
View File
@@ -48,6 +48,7 @@ The following table lists the configurable parameters of the Parse chart and the
| Parameter | Description | Default |
|---------------------------------------|------------------------------------------|-------------------------------------------------------- |
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `service.type` | Kubernetes Service type | `LoadBalancer` |
| `service.port` | Service HTTP port (Dashboard) | `80` |
| `service.loadBalancerIP` | `loadBalancerIP` for the Parse Service | `nil` |
+35
View File
@@ -112,3 +112,38 @@ Also, we can't use a single if because lazy evaluation is not an option
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "parse.imagePullSecrets" -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
Also, we can not use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.global.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- else if or .Values.server.image.pullSecrets .Values.dashboard.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.server.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- range .Values.dashboard.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if or .Values.server.image.pullSecrets .Values.dashboard.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.server.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- range .Values.dashboard.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
@@ -29,12 +29,7 @@ spec:
fsGroup: {{ .Values.dashboard.securityContext.fsGroup }}
runAsUser: {{ .Values.dashboard.securityContext.runAsUser }}
{{- end }}
{{- if .Values.dashboard.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.dashboard.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
{{- include "parse.imagePullSecrets" . | indent 6 }}
containers:
- name: {{ template "parse.fullname" . }}
image: {{ template "parse.dashboard.image" . }}
@@ -28,12 +28,7 @@ spec:
fsGroup: {{ .Values.server.securityContext.fsGroup }}
runAsUser: {{ .Values.server.securityContext.runAsUser }}
{{- end }}
{{- if .Values.server.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.server.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
{{- include "parse.imagePullSecrets" . | indent 6 }}
containers:
- name: {{ template "parse.fullname" . }}
image: {{ template "parse.server.image" . }}
+8 -5
View File
@@ -1,8 +1,11 @@
## Global Docker image registry
## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
# imageRegistry:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
## Kubernetes serviceType for Parse Deployment
## ref: http://kubernetes.io/docs/user-guide/services/#publishing-services---service-types
@@ -45,7 +48,7 @@ server:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
# - myRegistryKeySecretName
## Parse Server Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
@@ -105,7 +108,7 @@ dashboard:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
# - myRegistryKeySecretName
## Parse Dashboard Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/