X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fmariadb-init%2Ftemplates%2Fjob.yaml;h=a899d93a28d3aa570377b42b2f4c4b52733e69d5;hb=d804418c890dde93bff26125b8cf1a9fd7fc82d1;hp=ad97cd4ed623faf1916154432124046005d457a6;hpb=44c4dd905a5b1a825e95ff4d4817616f78f8dd75;p=oom.git diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml index ad97cd4ed6..a899d93a28 100644 --- a/kubernetes/common/mariadb-init/templates/job.yaml +++ b/kubernetes/common/mariadb-init/templates/job.yaml @@ -59,13 +59,15 @@ spec: - /bin/sh - -c - | + {{- if include "common.onServiceMesh" . }} + echo "waiting 15s for istio side cars to be up"; sleep 15s;{{- end }} /db_init/db_init.sh {{ if or .Values.dbScriptConfigMap .Values.dbScript }} && /db_config/db_cmd.sh{{ end }} env: - name: DB_HOST - value: "{{ default .Values.global.mariadbGalera.nameOverride .Values.mariadbGalera.serviceName }}" + value: {{ include "common.mariadbService" . }} - name: DB_PORT - value: "{{ default .Values.global.mariadbGalera.servicePort .Values.mariadbGalera.servicePort }}" + value: {{ include "common.mariadbPort" . | quote }} - name: MYSQL_ROOT_PASSWORD {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "root-password" "key" (default "password" .Values.global.mariadbGalera.userRootSecretKey)) | indent 10 }} - name: {{ printf "MYSQL_USER_%s" .Values.config.mysqlDatabase | upper }} @@ -83,14 +85,14 @@ spec: - mountPath: /etc/localtime name: localtime readOnly: true - - name: mariadb-conf + - name: mariadb-init mountPath: /db_init/ {{- if or .Values.dbScriptConfigMap .Values.dbScript }} - - name: mariadb-init + - name: mariadb-conf mountPath: /db_config/ {{- end }} - resources: -{{ include "common.resources" . | indent 12 }} + resources: {{ include "common.resources" . | nindent 10 }} + {{ include "common.waitForJobContainer" . | indent 6 | trim }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 10 }} @@ -99,12 +101,13 @@ spec: affinity: {{ toYaml .Values.affinity | indent 10 }} {{- end }} + serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} volumes: - name: localtime hostPath: path: /etc/localtime {{- if or .Values.dbScriptConfigMap .Values.dbScript }} - - name: mariadb-init + - name: mariadb-conf configMap: {{- if .Values.dbScriptConfigMap }} name: {{ tpl .Values.dbScriptConfigMap . }} @@ -113,7 +116,7 @@ spec: {{- end }} defaultMode: 0755 {{- end }} - - name: mariadb-conf + - name: mariadb-init configMap: name: {{ include "mariadbInit.configMap" . }} defaultMode: 0755