[bitnami/rabbitmq] Add init scripts support (#11013)

* [bitnami/rabbitmq] add values for init scripts

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/rabbitmq] add init scripts configMap

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/rabbitmq] add volumes

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/rabbitmq] bump chart version

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* [bitnami/rabbitmq] typo

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* [bitnami/sonarqube] solve lint issues

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>

Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
This commit is contained in:
Alberto Otero
2022-08-10 15:30:57 +02:00
committed by GitHub
co-authored by Bitnami Containers Carlos Rodríguez Hernández
parent 824eef1ce8
commit a5ae293a8e
6 changed files with 72 additions and 1 deletions
+1 -1
View File
@@ -23,4 +23,4 @@ name: rabbitmq
sources:
- https://github.com/bitnami/containers/tree/main/bitnami/rabbitmq
- https://www.rabbitmq.com
version: 10.1.19
version: 10.2.0
+3
View File
@@ -135,6 +135,9 @@ The command removes all the Kubernetes components associated with the chart and
| `containerPorts.manager` | | `15672` |
| `containerPorts.epmd` | | `4369` |
| `containerPorts.metrics` | | `9419` |
| `initScripts` | Dictionary of init scripts. Evaluated as a template. | `{}` |
| `initScriptsCM` | ConfigMap with the init scripts. Evaluated as a template. | `""` |
| `initScriptsSecret` | Secret containing `/docker-entrypoint-initdb.d` scripts to be executed at initialization time that contain sensitive data. Evaluated as a template. | `""` |
| `extraContainerPorts` | Extra ports to be included in container spec, primarily informational | `[]` |
| `configuration` | RabbitMQ Configuration file content: required cluster configuration | `""` |
| `extraConfiguration` | Configuration file content: extra configuration to be appended to RabbitMQ configuration | `""` |
+7
View File
@@ -218,3 +218,10 @@ rabbitmq: auth.tls
- Enable auto-generated certificates using `auth.tls.autoGenerated`.
{{- end -}}
{{- end -}}
{{/*
Get the initialization scripts volume name.
*/}}
{{- define "rabbitmq.initScripts" -}}
{{- printf "%s-init-scripts" (include "common.names.fullname" .) -}}
{{- end -}}
@@ -0,0 +1,16 @@
{{- if .Values.initScripts }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-init-scripts" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
{{- include "common.tplvalues.render" ( dict "value" .Values.initScripts "context" $ ) | nindent 4 }}
{{- end }}
@@ -326,6 +326,18 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.initScripts }}
- name: custom-init-scripts
mountPath: /docker-entrypoint-initdb.d/init-scripts
{{- end }}
{{- if .Values.initScriptsCM }}
- name: custom-init-scripts-cm
mountPath: /docker-entrypoint-initdb.d/init-scripts-cm
{{- end }}
{{- if .Values.initScriptsSecret }}
- name: custom-init-scripts-secret
mountPath: /docker-entrypoint-initdb.d/init-scripts-secret
{{- end }}
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
@@ -362,6 +374,22 @@ spec:
secret:
secretName: {{ tpl .Values.loadDefinition.existingSecret . | quote }}
{{- end }}
{{- if .Values.initScripts }}
- name: custom-init-scripts
configMap:
name: {{ template "rabbitmq.initScripts" . }}
{{- end }}
{{- if .Values.initScriptsCM }}
- name: custom-init-scripts-cm
configMap:
name: {{ template ".Values.initScriptsCM" . }}
{{- end }}
{{- if .Values.initScriptsSecret }}
- name: custom-init-scripts-secret
secret:
secretName: {{ template ".Values.initScriptsSecret" . }}
defaultMode: 0755
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
+17
View File
@@ -289,6 +289,23 @@ containerPorts:
epmd: 4369
metrics: 9419
## @param initScripts Dictionary of init scripts. Evaluated as a template.
## Specify dictionary of scripts to be run at first boot
## Alternatively, you can put your scripts under the files/docker-entrypoint-initdb.d directory
## For example:
## initScripts:
## my_init_script.sh: |
## #!/bin/sh
## echo "Do something."
##
initScripts: {}
## @param initScriptsCM ConfigMap with the init scripts. Evaluated as a template.
## Note: This will override initScripts
##
initScriptsCM: ""
## @param initScriptsSecret Secret containing `/docker-entrypoint-initdb.d` scripts to be executed at initialization time that contain sensitive data. Evaluated as a template.
##
initScriptsSecret: ""
## @param extraContainerPorts Extra ports to be included in container spec, primarily informational
## E.g:
## extraContainerPorts: