[bitnami/cassandra] Add global imagePullSecrets to overwrite any other existing one

This commit is contained in:
Carlos Rodriguez Hernandez
2019-03-11 12:33:22 +00:00
parent f58ea6fcc3
commit 8f75780eec
5 changed files with 49 additions and 15 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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}` |
+36
View File
@@ -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 -}}
+4 -10
View File
@@ -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
+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 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/