4 name: {{ template "mysql.fullname" . }}
5 namespace: {{ .Release.Namespace }}
7 app: {{ template "mysql.fullname" . }}
8 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9 release: "{{ .Release.Name }}"
10 heritage: "{{ .Release.Service }}"
11 {{- with .Values.deploymentAnnotations }}
13 {{ toYaml . | indent 4 }}
18 {{ toYaml .Values.strategy | indent 4 }}
21 app: {{ template "mysql.fullname" . }}
22 release: {{ .Release.Name }}
26 app: {{ template "mysql.fullname" . }}
27 release: {{ .Release.Name }}
28 {{- with .Values.podLabels }}
29 {{ toYaml . | indent 8 }}
31 {{- with .Values.podAnnotations }}
33 {{ toYaml . | indent 8 }}
36 {{- if .Values.schedulerName }}
37 schedulerName: "{{ .Values.schedulerName }}"
39 {{- if .Values.imagePullSecrets }}
41 {{ toYaml .Values.imagePullSecrets | indent 8 }}
43 {{- if .Values.priorityClassName }}
44 priorityClassName: "{{ .Values.priorityClassName }}"
46 {{- if .Values.securityContext.enabled }}
48 fsGroup: {{ .Values.securityContext.fsGroup }}
49 runAsUser: {{ .Values.securityContext.runAsUser }}
51 serviceAccountName: {{ template "mysql.serviceAccountName" . }}
53 - name: "remove-lost-found"
54 image: "{{ .Values.busybox.image}}:{{ .Values.busybox.tag }}"
55 imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
57 {{ toYaml .Values.initContainer.resources | indent 10 }}
58 command: ["rm", "-fr", "/var/lib/mysql/lost+found"]
61 mountPath: /var/lib/mysql
62 {{- if .Values.persistence.subPath }}
63 subPath: {{ .Values.persistence.subPath }}
65 {{- if .Values.extraInitContainers }}
66 {{ tpl .Values.extraInitContainers . | indent 6 }}
68 {{- if .Values.nodeSelector }}
70 {{ toYaml .Values.nodeSelector | indent 8 }}
72 {{- if .Values.affinity }}
74 {{ toYaml .Values.affinity | indent 8 }}
76 {{- if .Values.tolerations }}
78 {{ toYaml .Values.tolerations | indent 8 }}
81 - name: {{ template "mysql.fullname" . }}
82 image: "{{ .Values.image }}:{{ .Values.imageTag }}"
83 imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
85 {{- with .Values.args }}
92 {{ toYaml .Values.resources | indent 10 }}
94 {{- if .Values.mysqlAllowEmptyPassword }}
95 - name: MYSQL_ALLOW_EMPTY_PASSWORD
98 {{- if not (and .Values.allowEmptyRootPassword (not .Values.mysqlRootPassword)) }}
99 - name: MYSQL_ROOT_PASSWORD
102 # name: {{ template "mysql.secretName" . }}
104 key: mysql-root-password
105 {{- if .Values.mysqlAllowEmptyPassword }}
109 {{- if not (and .Values.allowEmptyRootPassword (not .Values.mysqlPassword)) }}
110 - name: MYSQL_PASSWORD
113 # name: {{ template "mysql.secretName" . }}
116 {{- if or .Values.mysqlAllowEmptyPassword (empty .Values.mysqlUser) }}
121 value: {{ default "" .Values.mysqlUser | quote }}
122 - name: MYSQL_DATABASE
123 value: {{ default "" .Values.mysqlDatabase | quote }}
124 {{- if .Values.timezone }}
126 value: {{ .Values.timezone }}
128 {{- if .Values.extraEnvVars }}
129 {{ tpl .Values.extraEnvVars . | indent 8 }}
137 {{- if .Values.mysqlAllowEmptyPassword }}
143 - "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
145 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
146 periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
147 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
148 successThreshold: {{ .Values.livenessProbe.successThreshold }}
149 failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
153 {{- if .Values.mysqlAllowEmptyPassword }}
159 - "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
161 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
162 periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
163 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
164 successThreshold: {{ .Values.readinessProbe.successThreshold }}
165 failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
168 mountPath: /var/lib/mysql
169 {{- if .Values.persistence.subPath }}
170 subPath: {{ .Values.persistence.subPath }}
172 {{- if .Values.configurationFiles }}
173 {{- range $key, $val := .Values.configurationFiles }}
174 - name: configurations
175 mountPath: {{ $.Values.configurationFilesPath }}{{ $key }}
179 {{- if .Values.initializationFiles }}
181 mountPath: /docker-entrypoint-initdb.d
183 {{- if .Values.ssl.enabled }}
187 {{- if .Values.extraVolumeMounts }}
188 {{ tpl .Values.extraVolumeMounts . | indent 8 }}
190 {{- if .Values.metrics.enabled }}
192 image: "{{ .Values.metrics.image }}:{{ .Values.metrics.imageTag }}"
193 imagePullPolicy: {{ .Values.metrics.imagePullPolicy | quote }}
194 {{- if .Values.mysqlAllowEmptyPassword }}
198 - 'DATA_SOURCE_NAME="root@(localhost:3306)/" /bin/mysqld_exporter'
201 - name: MYSQL_ROOT_PASSWORD
204 # name: {{ template "mysql.secretName" . }}
206 key: mysql-root-password
210 - 'DATA_SOURCE_NAME="root:$MYSQL_ROOT_PASSWORD@(localhost:3306)/" /bin/mysqld_exporter'
212 {{- range $f := .Values.metrics.flags }}
222 initialDelaySeconds: {{ .Values.metrics.livenessProbe.initialDelaySeconds }}
223 timeoutSeconds: {{ .Values.metrics.livenessProbe.timeoutSeconds }}
228 initialDelaySeconds: {{ .Values.metrics.readinessProbe.initialDelaySeconds }}
229 timeoutSeconds: {{ .Values.metrics.readinessProbe.timeoutSeconds }}
231 {{ toYaml .Values.metrics.resources | indent 10 }}
234 {{- if .Values.configurationFiles }}
235 - name: configurations
237 name: {{ template "mysql.fullname" . }}-configuration
239 {{- if .Values.initializationFiles }}
242 name: {{ template "mysql.fullname" . }}-initialization
244 {{- if .Values.ssl.enabled }}
247 secretName: {{ .Values.ssl.secret }}
250 {{- if .Values.persistence.enabled }}
251 persistentVolumeClaim:
252 claimName: {{ .Values.persistence.existingClaim | default (include "mysql.fullname" .) }}
256 {{- if .Values.extraVolumes }}
257 {{ tpl .Values.extraVolumes . | indent 6 }}