X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fmariadb-galera%2Ftemplates%2Fbackup%2Fcronjob.yaml;h=bce0eb9c43aa6c901f9262c71a1001e3e9ad19aa;hb=1a8c01a011e0aedfe6ef1f57811429a9133be0ef;hp=7d3ec75c0045c616c670bbfa01be06f20e3d114f;hpb=488ef7702fde0b9e149a2e37323321cb6545f7c6;p=oom.git diff --git a/kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml b/kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml index 7d3ec75c00..bce0eb9c43 100644 --- a/kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml +++ b/kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml @@ -1,5 +1,5 @@ {{/* -# Copyright © 2019 Amdocs, Bell Canada +# Copyright © 2019 Amdocs, Bell Canada, Samsung Electronics # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ metadata: labels: app: {{ include "common.fullname" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} heritage: {{ .Release.Service }} spec: schedule: {{ .Values.backup.cron | quote }} @@ -35,7 +35,7 @@ spec: restartPolicy: Never initContainers: - command: - - /root/ready.py + - /app/ready.py args: - --container-name - {{ include "common.name" . }} @@ -45,7 +45,7 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} name: {{ include "common.name" . }}-readiness - name: mariadb-galera-backup-init @@ -86,12 +86,9 @@ spec: echo "Backup Successful!!!" env: - name: DB_PASS - valueFrom: - secretKeyRef: - name: {{ include "common.fullname" . }} - key: db-root-password + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 14}} volumeMounts: - - name: backup-data + - name: backup-dir mountPath: /backup - name: db-data mountPath: /var/lib/mysql @@ -101,10 +98,7 @@ spec: imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} env: - name: MYSQL_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "common.fullname" . }} - key: db-root-password + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .) "key" "password") | indent 14}} command: - /bin/bash - -c @@ -130,7 +124,7 @@ spec: remove_dir $target_dir exit 0 fi - + /docker-entrypoint.sh mysqld & count=0 @@ -163,16 +157,16 @@ spec: - mountPath: /etc/localtime name: localtime readOnly: true - - name: backup-data + - name: backup-dir mountPath: /backup volumes: - name: localtime hostPath: path: /etc/localtime - - name: db-data + - name: backup-dir persistentVolumeClaim: - claimName: {{ include "common.fullname" . }}-db-data - - name: backup-data + claimName: {{ include "common.fullname" . }}-backup-data + - name: db-data persistentVolumeClaim: - claimName: {{ include "common.fullname" . }}-backup + claimName: {{ include "common.fullname" . }}-data-{{ include "common.fullname" . }}-{{ sub .Values.replicaCount 1 }} {{- end }}