feat: mysql: add startupProb (#6507)

Signed-off-by: Youssef El Houti <youssef.elhouti@gmail.com>
This commit is contained in:
yelhouti
2021-06-02 10:17:11 +02:00
committed by GitHub
parent 302a62e39b
commit 75f4494c85
5 changed files with 59 additions and 3 deletions
+1 -1
View File
@@ -25,4 +25,4 @@ name: mysql
sources:
- https://github.com/bitnami/bitnami-docker-mysql
- https://mysql.com
version: 8.5.10
version: 8.6.0
+4
View File
@@ -117,8 +117,10 @@ The following table lists the configurable parameters of the MySQL chart and the
| `primary.containerSecurityContext.runAsUser` | User ID for the MySQL primary container | `1001` |
| `primary.livenessProbe` | Liveness probe configuration for MySQL primary containers | Check `values.yaml` file |
| `primary.readinessProbe` | Readiness probe configuration for MySQL primary containers | Check `values.yaml` file |
| `primary.startupProbe` | Startup probe configuration for MySQL primary containers | Check `values.yaml` file |
| `primary.customLivenessProbe` | Override default liveness probe for MySQL primary containers | `nil` |
| `primary.customReadinessProbe` | Override default readiness probe for MySQL primary containers | `nil` |
| `primary.customStartupProbe` | Override default startup probe for MySQL primary containers | `nil` |
| `primary.resources.limits` | The resources limits for MySQL primary containers | `{}` |
| `primary.resources.requests` | The requested resources for MySQL primary containers | `{}` |
| `primary.extraEnvVars` | Extra environment variables to be set on MySQL primary containers | `{}` |
@@ -174,8 +176,10 @@ The following table lists the configurable parameters of the MySQL chart and the
| `secondary.containerSecurityContext.runAsUser` | User ID for the MySQL secondary container | `1001` |
| `secondary.livenessProbe` | Liveness probe configuration for MySQL secondary containers | Check `values.yaml` file |
| `secondary.readinessProbe` | Readiness probe configuration for MySQL secondary containers | Check `values.yaml` file |
| `secondary.startupProbe` | Startup probe configuration for MySQL secondary containers | Check `values.yaml` file |
| `secondary.customLivenessProbe` | Override default liveness probe for MySQL secondary containers | `nil` |
| `secondary.customReadinessProbe` | Override default readiness probe for MySQL secondary containers | `nil` |
| `secondary.customStartupProbe` | Override default startup probe for MySQL secondary containers | `nil` |
| `secondary.resources.limits` | The resources limits for MySQL secondary containers | `{}` |
| `secondary.resources.requests` | The requested resources for MySQL secondary containers | `{}` |
| `secondary.extraEnvVars` | Extra environment variables to be set on MySQL secondary containers | `{}` |
@@ -207,6 +207,21 @@ spec:
{{- else if .Values.primary.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customReadinessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.primary.startupProbe.enabled }}
startupProbe: {{- omit .Values.primary.startupProbe "enabled" | toYaml | nindent 12 }}
exec:
command:
- /bin/bash
- -ec
- |
password_aux="${MYSQL_ROOT_PASSWORD:-}"
if [[ -f "${MYSQL_ROOT_PASSWORD_FILE:-}" ]]; then
password_aux=$(cat "$MYSQL_ROOT_PASSWORD_FILE")
fi
mysqladmin status -uroot -p"${password_aux}"
{{- else if .Values.primary.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.primary.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.primary.resources }}
resources: {{ toYaml .Values.primary.resources | nindent 12 }}
{{- end }}
@@ -193,6 +193,21 @@ spec:
{{- else if .Values.secondary.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customReadinessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.secondary.startupProbe.enabled }}
startupProbe: {{- omit .Values.secondary.startupProbe "enabled" | toYaml | nindent 12 }}
exec:
command:
- /bin/bash
- -ec
- |
password_aux="${MYSQL_MASTER_ROOT_PASSWORD:-}"
if [[ -f "${MYSQL_MASTER_ROOT_PASSWORD_FILE:-}" ]]; then
password_aux=$(cat "$MYSQL_MASTER_ROOT_PASSWORD_FILE")
fi
mysqladmin status -uroot -p"${password_aux}"
{{- else if .Values.secondary.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.secondary.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.secondary.resources }}
resources: {{ toYaml .Values.secondary.resources | nindent 12 }}
{{- end }}
+24 -2
View File
@@ -257,7 +257,7 @@ primary:
# memory: 256Mi
# cpu: 250m
## MySQL primary container's liveness and readiness probes
## MySQL primary container's liveness, readiness and startup probes
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
##
livenessProbe:
@@ -274,6 +274,13 @@ primary:
timeoutSeconds: 1
failureThreshold: 3
successThreshold: 1
startupProbe:
enabled: true
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 60
successThreshold: 1
## MySQL primary custom liveness probe
##
@@ -283,6 +290,10 @@ primary:
##
customReadinessProbe: {}
## MySQL primary custom startup probe
##
customStartupProbe: {}
## MySQL primary additional command line flags
## Can be used to specify command line flags, for example:
## E.g.
@@ -556,7 +567,7 @@ secondary:
# memory: 256Mi
# cpu: 250m
## MySQL secondary container's liveness and readiness probes
## MySQL secondary container's liveness, readiness and startup probes
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
##
livenessProbe:
@@ -573,6 +584,13 @@ secondary:
timeoutSeconds: 1
failureThreshold: 3
successThreshold: 1
startupProbe:
enabled: true
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 60
successThreshold: 1
## MySQL secondary custom liveness probe
##
@@ -582,6 +600,10 @@ secondary:
##
customReadinessProbe: {}
## MySQL secondary custom startup probe
##
customStartupProbe: {}
## MySQL secondary additional command line flags
## Can be used to specify command line flags, for example:
## E.g.