X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fpolicy%2Ftemplates%2Fjob.yaml;h=d781a634aedad942461dc2cf29f82ffee99123da;hb=d74fe9fbe7aab6f0b9bc37bf71237b297cd63e94;hp=72c94f30c52cf40085e37eb0cf070243ad0efa82;hpb=fd229e78d5d2f260904b381631465f9d849734e4;p=oom.git diff --git a/kubernetes/policy/templates/job.yaml b/kubernetes/policy/templates/job.yaml index 72c94f30c5..d781a634ae 100755 --- a/kubernetes/policy/templates/job.yaml +++ b/kubernetes/policy/templates/job.yaml @@ -1,6 +1,7 @@ {{/* # Copyright © 2018 Amdocs, Bell Canada # Modifications Copyright © 2020 AT&T Intellectual Property +# Modifications Copyright (C) 2021 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,7 +48,6 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - containers: - name: {{ include "common.release" . }}-policy-galera-config image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadb.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} @@ -70,6 +70,32 @@ spec: - name: MYSQL_PORT value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" resources: +{{ include "common.resources" . }} + containers: + - name: {{ include "common.release" . }}-policy-galera-db-migrator + image: {{ .Values.repository }}/{{ .Values.dbmigrator.image }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /dbcmd-config/db_migrator_policy_init.sh + name: {{ include "common.fullname" . }}-config + subPath: db_migrator_policy_init.sh + command: + - /bin/sh + args: + - -x + - /dbcmd-config/db_migrator_policy_init.sh + env: + - name: SQL_HOST + value: "{{ index .Values "mariadb-galera" "service" "name" }}" + - name: SQL_USER + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} + - name: SQL_PASSWORD + {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} + - name: SQL_DB + value: {{ .Values.dbmigrator.schema }} + - name: POLICY_HOME + value: {{ .Values.dbmigrator.policy_home }} + resources: {{ include "common.resources" . }} restartPolicy: Never serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} @@ -80,3 +106,5 @@ spec: items: - key: db.sh path: db.sh + - key: db_migrator_policy_init.sh + path: db_migrator_policy_init.sh