[bitnami/mysql] Update to mysql chart to have startdb script (#18344)

* [bitnami/mysql] Update to mysql chart to have startdb script

Signed-off-by: Syed Hashim <hashim.muhammad9@gmail.com>

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

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

* [bitnami/mysql] bump chart version

Signed-off-by: Syed Hashim <hashim.muhammad9@gmail.com>

* [bitnami/mysql] remove label app.kubernetes.io/component

Signed-off-by: Syed Hashim <hashim.muhammad9@gmail.com>

---------

Signed-off-by: Syed Hashim <hashim.muhammad9@gmail.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Syed Muhammad Hashim
2023-08-15 14:43:31 +05:00
committed by GitHub
parent 4073e5d3de
commit 22b07e00fa
7 changed files with 65 additions and 1 deletions

View File

@@ -27,4 +27,4 @@ maintainers:
name: mysql
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/mysql
version: 9.10.10
version: 9.11.0

View File

@@ -101,6 +101,8 @@ The command removes all the Kubernetes components associated with the chart and
| `auth.customPasswordFiles` | Use custom password files when `auth.usePasswordFiles` is set to `true`. Define path for keys `root` and `user`, also define `replicator` if `architecture` is set to `replication` | `{}` |
| `initdbScripts` | Dictionary of initdb scripts | `{}` |
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `""` |
| `startdbScripts` | Dictionary of startdb scripts | `{}` |
| `startdbScriptsConfigMap` | ConfigMap with the startdb scripts (Note: Overrides `startdbScripts`) | `""` |
### MySQL Primary parameters

View File

@@ -56,6 +56,17 @@ Get the initialization scripts ConfigMap name.
{{- end -}}
{{- end -}}
{{/*
Get the startdb scripts ConfigMap name.
*/}}
{{- define "mysql.startdbScriptsCM" -}}
{{- if .Values.startdbScriptsConfigMap -}}
{{- printf "%s" (tpl .Values.startdbScriptsConfigMap $) -}}
{{- else -}}
{{- printf "%s-start-scripts" (include "mysql.primary.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Returns the proper service account name depending if an explicit service account name is set
in the values file. If the name is not set it will default to either mysql.fullname if serviceAccount.create

View File

@@ -0,0 +1,21 @@
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.startdbScripts (not .Values.startdbScriptsConfigMap) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-start-scripts" (include "mysql.primary.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.startdbScripts "context" .) | nindent 2 }}
{{- end }}

View File

@@ -254,6 +254,10 @@ spec:
- name: custom-init-scripts
mountPath: /docker-entrypoint-initdb.d
{{- end }}
{{- if or .Values.startdbScriptsConfigMap .Values.startdbScripts }}
- name: custom-start-scripts
mountPath: /docker-entrypoint-startdb.d
{{- end }}
{{- if or .Values.primary.configuration .Values.primary.existingConfigmap }}
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
@@ -338,6 +342,11 @@ spec:
configMap:
name: {{ include "mysql.initdbScriptsCM" . }}
{{- end }}
{{- if or .Values.startdbScriptsConfigMap .Values.startdbScripts }}
- name: custom-start-scripts
configMap:
name: {{ include "mysql.startdbScriptsCM" . }}
{{- end }}
{{- if and .Values.auth.usePasswordFiles (not .Values.auth.customPasswordFiles) }}
- name: mysql-credentials
secret:

View File

@@ -238,6 +238,10 @@ spec:
- name: custom-init-scripts
mountPath: /docker-entrypoint-initdb.d
{{- end }}
{{- if or .Values.startdbScriptsConfigMap .Values.startdbScripts }}
- name: custom-start-scripts
mountPath: /docker-entrypoint-startdb.d
{{- end }}
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
- name: config
mountPath: /opt/bitnami/mysql/conf/my.cnf
@@ -317,6 +321,11 @@ spec:
configMap:
name: {{ include "mysql.initdbScriptsCM" . }}
{{- end }}
{{- if or .Values.startdbScriptsConfigMap .Values.startdbScripts }}
- name: custom-start-scripts
configMap:
name: {{ include "mysql.startdbScriptsCM" . }}
{{- end }}
{{- if or .Values.secondary.configuration .Values.secondary.existingConfigmap }}
- name: config
configMap:

View File

@@ -162,6 +162,18 @@ initdbScripts: {}
## @param initdbScriptsConfigMap ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`)
##
initdbScriptsConfigMap: ""
## @param startdbScripts Dictionary of startdb scripts
## Specify dictionary of scripts to be run every time the container is started
## Example:
## startdbScripts:
## my_start_script.sh: |
## #!/bin/bash
## echo "Do something."
##
startdbScripts: {}
## @param startdbScriptsConfigMap ConfigMap with the startdb scripts (Note: Overrides `startdbScripts`)
##
startdbScriptsConfigMap: ""
## @section MySQL Primary parameters
##