From a4275991aff6b4dafb19e57325c04ac0fb811a66 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Wed, 25 Jan 2023 09:27:30 +0100 Subject: [POLICY] Use variable MariaDB image for DB jobs Use default MariaDB version (same as deployed) in the DB scripts Issue-ID: POLICY-4537 Signed-off-by: Andreas Geissler Change-Id: If418f6b35b9f1ecf8631fe002e59d6f9372a979e --- kubernetes/policy/resources/config/db.sh | 6 +++--- kubernetes/policy/templates/job.yaml | 2 +- kubernetes/policy/values.yaml | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'kubernetes') diff --git a/kubernetes/policy/resources/config/db.sh b/kubernetes/policy/resources/config/db.sh index 866d422c14..36574bc1ad 100755 --- a/kubernetes/policy/resources/config/db.sh +++ b/kubernetes/policy/resources/config/db.sh @@ -17,12 +17,12 @@ # limitations under the License. */}} -mysql() { /usr/bin/mysql -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; }; +mysqlcmd() { mysql -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; }; for db in migration pooling policyadmin policyclamp operationshistory clampacm do - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" + mysqlcmd -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" + mysqlcmd -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" done mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/kubernetes/policy/templates/job.yaml b/kubernetes/policy/templates/job.yaml index 0df26568e5..3c46dbdb64 100755 --- a/kubernetes/policy/templates/job.yaml +++ b/kubernetes/policy/templates/job.yaml @@ -50,7 +50,7 @@ spec: fieldPath: metadata.namespace containers: - name: {{ include "common.name" . }}-galera-config - image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadb.image }} + image: {{ include "repositoryGenerator.image.mariadb" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - mountPath: /dbcmd-config/db.sh diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml index c9e236a65c..1ee31c2c7c 100755 --- a/kubernetes/policy/values.yaml +++ b/kubernetes/policy/values.yaml @@ -168,12 +168,6 @@ policy-gui: # DB configuration defaults. ################################################################# -repository: nexus3.onap.org:10001 -pullPolicy: Always - -mariadb: - image: mariadb:10.5.8 - dbmigrator: image: onap/policy-db-migrator:2.5.1 schema: policyadmin -- cgit 1.2.3-korg