From 8b94826c2c9ad0e1423b752cf896b10e41625933 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Fri, 19 Jan 2024 15:52:06 +0100 Subject: [SDNC] Support root secret for external DB In case of an external DB the secret containing the root password can be given in the global.mariadbGalera section and has to be used in the DB jobs Issue-ID: OOM-3266 Change-Id: I05d36169e7f8c6aa18712e0a75621d1cd001f1b3 Signed-off-by: Andreas Geissler --- kubernetes/sdnc/Chart.yaml | 2 +- kubernetes/sdnc/values.yaml | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'kubernetes') diff --git a/kubernetes/sdnc/Chart.yaml b/kubernetes/sdnc/Chart.yaml index 24f58b159b..622991562b 100644 --- a/kubernetes/sdnc/Chart.yaml +++ b/kubernetes/sdnc/Chart.yaml @@ -17,7 +17,7 @@ apiVersion: v2 description: SDN Controller name: sdnc -version: 13.0.0 +version: 13.0.1 dependencies: - name: common diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml index 328b5adffb..72eb138548 100644 --- a/kubernetes/sdnc/values.yaml +++ b/kubernetes/sdnc/values.yaml @@ -32,6 +32,8 @@ global: service: &mariadbService mariadb-galera internalPort: 3306 nameOverride: &mariadbName mariadb-galera + # (optional) if localCluster=false and an external secret is used set this variable + #userRootSecret: ################################################################# @@ -47,13 +49,18 @@ secrets: # override this secret using external one with the same field that is used # to pass this to subchart. externalSecret: '{{ .Values.global.mariadbGalera.localCluster | - ternary ((hasSuffix "sdnc-db-root-password" (index .Values "mariadb-galera" "rootUser" "externalSecret")) | - ternary - "" - (tpl (default "" (index .Values "mariadb-galera" "rootUser" "externalSecret")) .)) - (include "common.mariadb.secret.rootPassSecretName" - (dict "dot" . - "chartName" .Values.global.mariadbGalera.nameOverride)) }}' + ternary (( hasSuffix "sdnc-db-root-password" (index .Values "mariadb-galera" "rootUser" "externalSecret")) | + ternary + "" + (tpl (default "" (index .Values "mariadb-galera" "rootUser" "externalSecret")) .) + ) + ( (not (empty (default "" .Values.global.mariadbGalera.userRootSecret))) | + ternary + .Values.global.mariadbGalera.userRootSecret + (include "common.mariadb.secret.rootPassSecretName" + (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride) + ) + ) }}' password: '{{ (index .Values "mariadb-galera" "rootUser" "password") }}' - uid: db-secret name: &dbSecretName '{{ include "common.release" . }}-sdnc-db-secret' -- cgit 1.2.3-korg