Merge pull request #1083 from bitnami/wildflyGlobalImagePullSecrets

[bitnami/wildfly] Add global 'imagePullSecrets' to overwrite any other existing one
This commit is contained in:
Carlos Rodríguez Hernández
2019-03-12 10:41:03 +01:00
committed by GitHub
5 changed files with 39 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: wildfly
version: 2.1.6
version: 2.2.0
appVersion: 15.0.1
description: Chart for Wildfly
keywords:
+1
View File
@@ -48,6 +48,7 @@ The following tables lists the configurable parameters of the WildFly chart and
| 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) |
| `image.registry` | WildFly image registry | `docker.io` |
| `image.repository` | WildFly Image name | `bitnami/wildfly` |
| `image.tag` | WildFly Image tag | `{VERSION}` |
+29
View File
@@ -37,3 +37,32 @@ 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 "wildfly.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 .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
+1 -6
View File
@@ -24,12 +24,7 @@ spec:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- include "wildfly.imagePullSecrets" . | indent 6 }}
containers:
- name: {{ template "fullname" . }}
image: "{{ template "wildfly.image" . }}"
+7 -4
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
## Bitnami WildFly image version
## ref: https://hub.docker.com/r/bitnami/wildfly/tags/
@@ -21,7 +24,7 @@ image:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
# - myRegistryKeySecretName
## Specify a imagePullPolicy
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images