diff --git a/bitnami/kafka/Chart.yaml b/bitnami/kafka/Chart.yaml index e61ce7b1f..155283bdc 100644 --- a/bitnami/kafka/Chart.yaml +++ b/bitnami/kafka/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kafka -version: 1.5.0 +version: 1.6.0 appVersion: 2.1.1 description: Apache Kafka is a distributed streaming platform. keywords: diff --git a/bitnami/kafka/README.md b/bitnami/kafka/README.md index c2d5dd26d..63aea7c54 100644 --- a/bitnami/kafka/README.md +++ b/bitnami/kafka/README.md @@ -48,6 +48,7 @@ The following tables lists the configurable parameters of the Kafka chart and th | 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` | Kafka image registry | `docker.io` | | `image.repository` | Kafka Image name | `bitnami/kafka` | | `image.tag` | Kafka Image tag | `{VERSION}` | diff --git a/bitnami/kafka/templates/_helpers.tpl b/bitnami/kafka/templates/_helpers.tpl index c56344be4..db9d321c1 100644 --- a/bitnami/kafka/templates/_helpers.tpl +++ b/bitnami/kafka/templates/_helpers.tpl @@ -80,3 +80,39 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default "zookeeper" .Values.zookeeper.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "kafka.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/kafka/templates/kafka-exporter.yaml b/bitnami/kafka/templates/kafka-exporter.yaml index 2268bbb5f..2dcc78153 100644 --- a/bitnami/kafka/templates/kafka-exporter.yaml +++ b/bitnami/kafka/templates/kafka-exporter.yaml @@ -25,12 +25,7 @@ spec: app: {{ template "kafka.name" . }} release: "{{ .Release.Name }}" spec: - {{- if .Values.metrics.kafka.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.metrics.kafka.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- end }} +{{- include "kafka.imagePullSecrets" . | indent 6 }} containers: - image: {{ template "kafka.metrics.kafka.image" . }} name: kafka-exporter @@ -41,4 +36,4 @@ spec: - containerPort: {{ .Values.metrics.kafka.port }} resources: {{ toYaml .Values.metrics.kafka.resources | indent 10 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/bitnami/kafka/templates/statefulset.yaml b/bitnami/kafka/templates/statefulset.yaml index 03d36f857..a60626156 100644 --- a/bitnami/kafka/templates/statefulset.yaml +++ b/bitnami/kafka/templates/statefulset.yaml @@ -32,12 +32,7 @@ spec: release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} spec: - {{- if .Values.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- end }} +{{- include "kafka.imagePullSecrets" . | indent 6 }} {{- if .Values.securityContext.enabled }} securityContext: fsGroup: {{ .Values.securityContext.fsGroup }} @@ -289,5 +284,3 @@ spec: - name: data emptyDir: {} {{- end }} - - diff --git a/bitnami/kafka/values.yaml b/bitnami/kafka/values.yaml index b8a6e7efd..ff6295647 100644 --- a/bitnami/kafka/values.yaml +++ b/bitnami/kafka/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 Kafka image version ## ref: https://hub.docker.com/r/bitnami/kafka/tags/ @@ -22,7 +25,7 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## Set to true if you would like to see extra information on logs ## It turns BASH and NAMI debugging in minideb @@ -250,7 +253,7 @@ metrics: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## Interval at which Prometheus scrapes metrics, note: only used by Prometheus Operator interval: 10s @@ -281,7 +284,7 @@ metrics: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## Interval at which Prometheus scrapes metrics, note: only used by Prometheus Operator interval: 10s