diff --git a/bitnami/cassandra/Chart.yaml b/bitnami/cassandra/Chart.yaml index 046e01f30..0a9194267 100644 --- a/bitnami/cassandra/Chart.yaml +++ b/bitnami/cassandra/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: cassandra -version: 2.1.5 +version: 2.2.0 appVersion: 3.11.4 description: Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients. icon: https://bitnami.com/assets/stacks/cassandra/img/cassandra-stack-220x234.png diff --git a/bitnami/cassandra/README.md b/bitnami/cassandra/README.md index 6d41d1579..7c9716f8f 100644 --- a/bitnami/cassandra/README.md +++ b/bitnami/cassandra/README.md @@ -49,6 +49,7 @@ The following tables lists the configurable parameters of the cassandra chart an | 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` | Cassandra Image registry | `docker.io` | | `image.repository` | Cassandra Image name | `bitnami/cassandra` | | `image.tag` | Cassandra Image tag | `{VERSION}` | diff --git a/bitnami/cassandra/templates/_helpers.tpl b/bitnami/cassandra/templates/_helpers.tpl index dcf4fbae5..d74dbe446 100644 --- a/bitnami/cassandra/templates/_helpers.tpl +++ b/bitnami/cassandra/templates/_helpers.tpl @@ -97,3 +97,39 @@ Get the configuration configmap. {{- printf "%s-configuration" (include "cassandra.fullname" .) -}} {{- end -}} {{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "cassandra.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 -}} diff --git a/bitnami/cassandra/templates/statefulset.yaml b/bitnami/cassandra/templates/statefulset.yaml index 2412d9893..9a863d1e2 100644 --- a/bitnami/cassandra/templates/statefulset.yaml +++ b/bitnami/cassandra/templates/statefulset.yaml @@ -57,7 +57,7 @@ spec: {{- end }} containers: - name: cassandra - command: + command: - bash - -ec # Node 0 is the password seeder @@ -65,7 +65,7 @@ spec: if [[ $HOSTNAME =~ (.*)-0$ ]]; then echo "Setting node as password seeder" export CASSANDRA_PASSWORD_SEEDER=yes - else + else # Only node 0 will execute the startup initdb scripts export CASSANDRA_IGNORE_INITDB_SCRIPTS=1 fi @@ -184,18 +184,12 @@ spec: - name: configurations mountPath: /bitnami/cassandra/conf {{- end }} - {{- if .Values.image.pullSecrets }} - imagePullSecrets: - - name: {{ .Values.image.pullSecrets }} - {{- end }} +{{- include "cassandra.imagePullSecrets" . | indent 6 }} {{- if .Values.metrics.enabled }} - name: metrics image: {{ template "cassandra.metrics.image" . }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} - {{- if .Values.metrics.image.pullSecrets }} - imagePullSecrets: - - name: {{ .Values.metrics.image.pullSecrets }} - {{- end }} +{{- include "cassandra.imagePullSecrets" . | indent 8 }} ports: - name: metrics containerPort: 8080 diff --git a/bitnami/cassandra/values.yaml b/bitnami/cassandra/values.yaml index 5ab22e9ea..b1c72499f 100644 --- a/bitnami/cassandra/values.yaml +++ b/bitnami/cassandra/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 Cassandra image version ## ref: https://hub.docker.com/r/bitnami/cassandra/tags/ @@ -24,7 +27,7 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## Specify a service type ## ref: http://kubernetes.io/docs/user-guide/services/