3030        prometheus.io/scrape : " true" 
3131        prometheus.io/targets : {{ required ".Values.alerts.prometheus missing" .Values.alerts.prometheus | quote }} 
3232{{- end }} 
33- {{- if and (and $.Values.global.linkerd_enabled $.Values.global.linkerd_requested)  $.Values.linkerd.mariadb.enabled }} 
34-         linkerd.io/inject :  enabled 
33+ {{- if $.Values.linkerd.mariadb.enabled }} 
34+         {{- include "mariadb.linkerdPodAnnotations" . | indent 8 }} 
3535{{- end }} 
3636    spec :
3737      affinity :
@@ -72,70 +72,14 @@ spec:
7272            readOnly : true 
7373          - name : init-file-root-sql 
7474            mountPath : /etc/mysql/init-file 
75+ {{- if .Values.global.mariadb.native_sidecar.enabled }} 
76+ {{- else }} 
7577      containers :
76-       - name : mariadb 
77-         image : {{ required ".Values.global.dockerHubMirrorAlternateRegion is missing" .Values.global.dockerHubMirrorAlternateRegion }}/{{ .Values.image }} 
78-         imagePullPolicy : {{ default "IfNotPresent" .Values.imagePullPolicy | quote }} 
79-         lifecycle :
80-           postStart :
81-             exec :
82-               command : ["sh", "-c", "while ! mariadb-admin ping --silent; do sleep 1; done; mariadb-upgrade"] 
83-         env :
84-         - name : MYSQL_ROOT_PASSWORD 
85-           valueFrom :
86-             secretKeyRef :
87-               name : mariadb-{{.Values.name}} 
88-               key : root-password 
89-         ports :
90-           - name : mariadb 
91-             containerPort : 3306 
92-         {{- if .Values.livenessProbe.enabled }} 
93-         livenessProbe :
94-           exec :
95-             command : ["sh", "-c", "exec mariadb-admin status"] 
96-           initialDelaySeconds : {{ .Values.livenessProbe.initialDelaySeconds }} 
97-           periodSeconds : {{ .Values.livenessProbe.periodSeconds }} 
98-           timeoutSeconds : {{ .Values.livenessProbe.timeoutSeconds }} 
99-           successThreshold : {{ .Values.livenessProbe.successThreshold }} 
100-           failureThreshold : {{ .Values.livenessProbe.failureThreshold }} 
101-         {{- end }} 
102-         {{- if .Values.readinessProbe.enabled }} 
103-         readinessProbe :
104-           exec :
105-             command : ["sh", "-c", "exec mariadb-admin status"] 
106-           initialDelaySeconds : {{ .Values.readinessProbe.initialDelaySeconds }} 
107-           periodSeconds : {{ .Values.readinessProbe.periodSeconds }} 
108-           timeoutSeconds : {{ .Values.readinessProbe.timeoutSeconds }} 
109-           successThreshold : {{ .Values.readinessProbe.successThreshold }} 
110-           failureThreshold : {{ .Values.readinessProbe.failureThreshold }} 
111-         {{- end }} 
112-         resources :
113- {{ toYaml (required "missing .resources" .Values.resources) | indent 10 }} 
114-         volumeMounts :
115-           - name : mariadb-socket 
116-             mountPath : /run/mysqld 
117- {{- if .Values.persistence_claim.enabled }} 
118-           - name : mariadb-persistent-storage 
119-             mountPath : /var/lib/mysql 
120-             readOnly : false 
12178{{- end }} 
122-           - mountPath : /usr/local/bin/docker-entrypoint.sh 
123-             subPath : docker-entrypoint.sh 
124-             name : mariadb-entrypoint 
125-             readOnly : true 
126-           - mountPath : /etc/mysql/mariadb.conf.d/ 
127-             name : mariadb-etc 
128-           - mountPath : /root/.my.cnf 
129-             subPath : " .my.cnf" 
130-             name : mariadb-client 
131-           - name : initdb 
132-             mountPath : /docker-entrypoint-initdb.d 
133-           - name : mysql-users-secret-file 
134-             mountPath : /etc/mysql/mysql-users-secret 
135-             readOnly : true 
136-           - name : init-file-root-sql 
137-             mountPath : /etc/mysql/init-file 
13879      - name : user-credential-updater 
80+ {{- if .Values.global.mariadb.native_sidecar.enabled }} 
81+         restartPolicy : Always 
82+ {{- end }} 
13983        image : " {{ required " .Values.global.registryAlternateRegion is missing" .Values.global.registryAlternateRegion }}/{{ .Values.credentialUpdater.image }}:{{ .Values.credentialUpdater.imageTag }}" 
14084        imagePullPolicy : {{ default "IfNotPresent" .Values.imagePullPolicy | quote }} 
14185        securityContext :
@@ -168,6 +112,9 @@ spec:
168112            name : initdb 
169113{{- if or .Values.backup_v2.enabled .Values.readiness.useSidecar }} 
170114      - name : readiness 
115+ {{- if .Values.global.mariadb.native_sidecar.enabled }} 
116+         restartPolicy : Always 
117+ {{- end }} 
171118        image : " {{ required " .Values.global.registryAlternateRegion is missing" .Values.global.registryAlternateRegion }}/{{ .Values.readiness.image }}:{{ .Values.readiness.image_version }}" 
172119        command :
173120          - pod_readiness 
@@ -187,6 +134,9 @@ spec:
187134{{- end }} 
188135{{- if .Values.metrics.enabled }} 
189136      - name : metrics 
137+ {{- if .Values.global.mariadb.native_sidecar.enabled }} 
138+         restartPolicy : Always 
139+ {{- end }} 
190140        image : " {{ required " .Values.global.dockerHubMirrorAlternateRegion is missing" .Values.global.dockerHubMirrorAlternateRegion }}/{{ .Values.metrics.image }}:{{ .Values.metrics.image_version }}" 
191141        imagePullPolicy : {{ default "IfNotPresent" .Values.imagePullPolicy | quote }} 
192142        args :
@@ -225,6 +175,71 @@ spec:
225175            memory : {{ .Values.metrics.resources.requests.memory | quote }} 
226176        {{- end }} 
227177{{- end }} 
178+ {{- if .Values.global.mariadb.native_sidecar.enabled }} 
179+       containers :
180+ {{- end }} 
181+       - name : mariadb 
182+         image : {{ required ".Values.global.dockerHubMirrorAlternateRegion is missing" .Values.global.dockerHubMirrorAlternateRegion }}/{{ .Values.image }} 
183+         imagePullPolicy : {{ default "IfNotPresent" .Values.imagePullPolicy | quote }} 
184+         lifecycle :
185+           postStart :
186+             exec :
187+               command : ["sh", "-c", "while ! mariadb-admin ping --silent; do sleep 1; done; mariadb-upgrade"] 
188+         env :
189+         - name : MYSQL_ROOT_PASSWORD 
190+           valueFrom :
191+             secretKeyRef :
192+               name : mariadb-{{.Values.name}} 
193+               key : root-password 
194+         ports :
195+           - name : mariadb 
196+             containerPort : 3306 
197+         {{- if .Values.livenessProbe.enabled }} 
198+         livenessProbe :
199+           exec :
200+             command : ["sh", "-c", "exec mariadb-admin status"] 
201+           initialDelaySeconds : {{ .Values.livenessProbe.initialDelaySeconds }} 
202+           periodSeconds : {{ .Values.livenessProbe.periodSeconds }} 
203+           timeoutSeconds : {{ .Values.livenessProbe.timeoutSeconds }} 
204+           successThreshold : {{ .Values.livenessProbe.successThreshold }} 
205+           failureThreshold : {{ .Values.livenessProbe.failureThreshold }} 
206+         {{- end }} 
207+         {{- if .Values.readinessProbe.enabled }} 
208+         readinessProbe :
209+           exec :
210+             command : ["sh", "-c", "exec mariadb-admin status"] 
211+           initialDelaySeconds : {{ .Values.readinessProbe.initialDelaySeconds }} 
212+           periodSeconds : {{ .Values.readinessProbe.periodSeconds }} 
213+           timeoutSeconds : {{ .Values.readinessProbe.timeoutSeconds }} 
214+           successThreshold : {{ .Values.readinessProbe.successThreshold }} 
215+           failureThreshold : {{ .Values.readinessProbe.failureThreshold }} 
216+         {{- end }} 
217+         resources :
218+ {{ toYaml (required "missing .resources" .Values.resources) | indent 10 }} 
219+         volumeMounts :
220+           - name : mariadb-socket 
221+             mountPath : /run/mysqld 
222+ {{- if .Values.persistence_claim.enabled }} 
223+           - name : mariadb-persistent-storage 
224+             mountPath : /var/lib/mysql 
225+             readOnly : false 
226+ {{- end }} 
227+           - mountPath : /usr/local/bin/docker-entrypoint.sh 
228+             subPath : docker-entrypoint.sh 
229+             name : mariadb-entrypoint 
230+             readOnly : true 
231+           - mountPath : /etc/mysql/mariadb.conf.d/ 
232+             name : mariadb-etc 
233+           - mountPath : /root/.my.cnf 
234+             subPath : " .my.cnf" 
235+             name : mariadb-client 
236+           - name : initdb 
237+             mountPath : /docker-entrypoint-initdb.d 
238+           - name : mysql-users-secret-file 
239+             mountPath : /etc/mysql/mysql-users-secret 
240+             readOnly : true 
241+           - name : init-file-root-sql 
242+             mountPath : /etc/mysql/init-file 
228243      priorityClassName : {{ .Values.priority_class | default "critical-infrastructure" | quote }} 
229244      volumes :
230245        - name : mariadb-socket 
0 commit comments