-
-
Save DaidoujiChen/56b1d0ab22b2fd0cbd271ce010d1bad2 to your computer and use it in GitHub Desktop.
Common Chart example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $params := dict "top" . "deployment" .Values.deployment -}} | |
{{ define "mariadb.env" }} | |
env: | |
- name: MARIADB_ROOT_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: {{ template "common.fullname" . }} | |
key: mariadb-root-password | |
- name: MARIADB_USER | |
value: {{ default "" .Values.mariadbUser | quote }} | |
- name: MARIADB_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: {{ template "common.fullname" . }} | |
key: mariadb-password | |
- name: MARIADB_DATABASE | |
value: {{ default "" .Values.mariadbDatabase | quote }} | |
{{ end }} | |
{{ $_ := set $params.deployment.pod "env" (include "mariadb.env" . | fromYaml).env }} | |
{{ define "mariadb.annotations" }} | |
annotations: | |
pod.alpha.kubernetes.io/init-containers: '[ | |
{ | |
"name": "copy-custom-config", | |
"image": "{{ .Values.deployment.pod.image }}", | |
"imagePullPolicy": {{ .Values.deployment.pod.imagePullPolicy | quote }}, | |
"command": ["sh", "-c", "mkdir -p /bitnami/mariadb/conf && cp -n /bitnami/mariadb_config/my.cnf /bitnami/mariadb/conf/my_custom.cnf"], | |
"volumeMounts": [ | |
{ | |
"name": "config", | |
"mountPath": "/bitnami/mariadb_config" | |
}, | |
{ | |
"name": "data", | |
"mountPath": "/bitnami/mariadb" | |
} | |
] | |
} | |
]' | |
{{ end }} | |
{{ $_ := set $params.deployment.pod "annotations" (include "mariadb.annotations" . | fromYaml).annotations }} | |
{{ template "common.deployment" $params }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $params := dict "top" . "service" .Values.service -}} | |
{{ template "common.service" $params }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: | |
ports: | |
- name: mysql | |
port: 3306 | |
targetPort: 3306 | |
deployment: | |
pod: | |
name: mariadb | |
image: bitnami/mariadb | |
tag: 10.2.21-r0 | |
imagePullPolicy: IfNotPresent | |
ports: | |
- name: mysql | |
containerPort: 3306 | |
livenessProbe: | |
exec: | |
command: | |
- mysqladmin | |
- ping | |
initialDelaySeconds: 30 | |
timeoutSeconds: 5 | |
readinessProbe: | |
exec: | |
command: | |
- mysqladmin | |
- ping | |
initialDelaySeconds: 5 | |
timeoutSeconds: 1 | |
persistence: | |
enabled: true | |
mounts: | |
- path: /bitnami/mariadb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment