diff --git a/bitnami/nginx-ingress-controller/Chart.yaml b/bitnami/nginx-ingress-controller/Chart.yaml index 989881f7e5..58e7bbefe8 100644 --- a/bitnami/nginx-ingress-controller/Chart.yaml +++ b/bitnami/nginx-ingress-controller/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: nginx-ingress-controller -version: 3.2.3 +version: 3.3.0 appVersion: 0.23.0 description: Chart for the nginx Ingress controller keywords: diff --git a/bitnami/nginx-ingress-controller/README.md b/bitnami/nginx-ingress-controller/README.md index a9a4c3c243..0ef0eb82aa 100644 --- a/bitnami/nginx-ingress-controller/README.md +++ b/bitnami/nginx-ingress-controller/README.md @@ -49,6 +49,7 @@ The following tables lists the configurable parameters of the nginx-ingress-cont 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) `name` | name of the controller component | `controller` `image.registry` | name of the container image registry | `docker.io` `image.repository` | controller container image repository | `bitnami/nginx-ingress-controller` diff --git a/bitnami/nginx-ingress-controller/templates/_helpers.tpl b/bitnami/nginx-ingress-controller/templates/_helpers.tpl index 6074a372ed..d0225ef943 100644 --- a/bitnami/nginx-ingress-controller/templates/_helpers.tpl +++ b/bitnami/nginx-ingress-controller/templates/_helpers.tpl @@ -87,3 +87,39 @@ Create chart name and version as used by the chart label. {{- define "nginx-ingress-controller.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "nginx-ingress-controller.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.image.pullSecrets .Values.metrics.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.metrics.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.metrics.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/bitnami/nginx-ingress-controller/templates/controller-daemonset.yaml b/bitnami/nginx-ingress-controller/templates/controller-daemonset.yaml index 62d44d0361..8b60e6c984 100644 --- a/bitnami/nginx-ingress-controller/templates/controller-daemonset.yaml +++ b/bitnami/nginx-ingress-controller/templates/controller-daemonset.yaml @@ -36,10 +36,7 @@ spec: {{- end }} spec: dnsPolicy: {{ .Values.dnsPolicy }} - {{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} - {{- end }} +{{- include "nginx-ingress-controller.imagePullSecrets" . | indent 6 }} {{- if .Values.priorityClassName }} priorityClassName: "{{ .Values.priorityClassName }}" {{- end }} diff --git a/bitnami/nginx-ingress-controller/templates/controller-deployment.yaml b/bitnami/nginx-ingress-controller/templates/controller-deployment.yaml index 41e8cf7de4..fa84d91bc2 100644 --- a/bitnami/nginx-ingress-controller/templates/controller-deployment.yaml +++ b/bitnami/nginx-ingress-controller/templates/controller-deployment.yaml @@ -36,10 +36,7 @@ spec: {{- end }} spec: dnsPolicy: {{ .Values.dnsPolicy }} - {{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} - {{- end }} +{{- include "nginx-ingress-controller.imagePullSecrets" . | indent 6 }} {{- if .Values.priorityClassName }} priorityClassName: "{{ .Values.priorityClassName }}" {{- end }} @@ -79,7 +76,7 @@ spec: - --{{ $key }} {{- end }} {{- end }} -{{- if .Values.hostNetwork }} +{{- if .Values.hostNetwork }} securityContext: capabilities: drop: ["ALL"] diff --git a/bitnami/nginx-ingress-controller/templates/default-backend-deployment.yaml b/bitnami/nginx-ingress-controller/templates/default-backend-deployment.yaml index 58d6c15194..4f961d755d 100644 --- a/bitnami/nginx-ingress-controller/templates/default-backend-deployment.yaml +++ b/bitnami/nginx-ingress-controller/templates/default-backend-deployment.yaml @@ -30,10 +30,7 @@ spec: {{ toYaml .Values.defaultBackend.podLabels | indent 8 }} {{- end }} spec: - {{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} - {{- end }} +{{- include "nginx-ingress-controller.imagePullSecrets" . | indent 6 }} {{- if .Values.defaultBackend.priorityClassName }} priorityClassName: "{{ .Values.defaultBackend.priorityClassName }}" {{- end }} diff --git a/bitnami/nginx-ingress-controller/values.yaml b/bitnami/nginx-ingress-controller/values.yaml index 16c27d9610..2d4b0bde33 100644 --- a/bitnami/nginx-ingress-controller/values.yaml +++ b/bitnami/nginx-ingress-controller/values.yaml @@ -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 NGINX Ingress controller image version ## ref: https://hub.docker.com/r/bitnami/nginx-ingress-controller/tags/ @@ -17,6 +20,13 @@ image: ## pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + config: use-geoip: "false" use-geoip2: "true" @@ -380,11 +390,6 @@ serviceAccount: create: true name: -## Optional array of imagePullSecrets containing private registry credentials -## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ -imagePullSecrets: [] -# - name: secretName - # TCP service key:value pairs # Ref: https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tcp ##