[AAI] Deploy latest AAI images
[oom.git] / kubernetes / common / mariadb-galera / templates / backup / cronjob.yaml
index 4248cfe..877e6fa 100644 (file)
@@ -15,6 +15,9 @@
 # limitations under the License.
 */}}
 
+{{- if and .Values.backup.enabled .Values.global.mariadbGalera.useOperator }}
+{{ include "common.mariadbOpBackup" . }}
+{{ else }}
 {{- if and .Values.backup.enabled .Values.persistence.enabled }}
 apiVersion: batch/v1beta1
 kind: CronJob
@@ -29,6 +32,13 @@ spec:
   jobTemplate:
     spec:
       template:
+        metadata:
+          annotations:
+            # Workarround to exclude K8S API from istio communication
+            # as init-container (readinessCheck) does not work with the
+            # Istio CNI plugin, see:
+            # (https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers)
+            traffic.sidecar.istio.io/excludeOutboundPorts: "443"
         spec:
           serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
           {{ include "common.podSecurityContext" . | indent 10 | trim}}
@@ -77,7 +87,7 @@ spec:
               env:
                 - name: DB_PASS
                   {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 18 }}
-              resources: {{ include "common.resources" . | nindent 12 }}
+              resources: {{ include "common.resources" . | nindent 16 }}
               volumeMounts:
                 - name: backup-dir
                   mountPath: /backup
@@ -148,23 +158,16 @@ spec:
                       ls -tr | grep backup | head -$filestoDelete | xargs rm -rf
                     fi
                   fi
-              resources: {{ include "common.resources" . | nindent 12 }}
+              resources: {{ include "common.resources" . | nindent 16 }}
               volumeMounts:
                 - mountPath: /bitnami/mariadb/data
                   name: tmp-data
                 - mountPath: /opt/bitnami/mariadb/tmp
                   name: tmp
-                - mountPath: /etc/localtime
-                  name: localtime
-                  readOnly: true
                 - name: backup-dir
                   mountPath: /backup
-          imagePullSecrets:
-            - name: {{ include "common.namespace" . }}-docker-registry-key
+          {{- include "common.imagePullSecrets" . | nindent 10 }}
           volumes:
-            - name: localtime
-              hostPath:
-                path: /etc/localtime
             - name: data
               persistentVolumeClaim:
             {{- if .Values.persistence.existingClaim }}
@@ -180,3 +183,4 @@ spec:
             - name: tmp
               emptyDir: {}
 {{- end }}
+{{- end }}