aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/sdnc
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-11-27 11:07:42 +0100
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-12-14 17:28:07 +0100
commit93a5b49185695a7960ada82f5899265b5bc2e504 (patch)
treeaa6e43614e023008d8ca24f16468d69ca765319d /kubernetes/sdnc
parent92abd28e06b8221e8ff3f0785c9702376010ad94 (diff)
[COMMON][MARIADB] Upgrade Mariadb DB galera version
Mariadb DB Galera containers version is outdated and unmaintained. We need them to move to a new image provider. As new image provider is not compatible with our old templates, we also update the templates (by reworking bitnami mariadb-galera chart). An update of global mariadb image is also done in order to match mariadb galera version. Issue-ID: OOM-1720 Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Change-Id: Ib9976227759e90022183d4f37fc655143be4d6ac
Diffstat (limited to 'kubernetes/sdnc')
-rw-r--r--kubernetes/sdnc/requirements.yaml2
-rw-r--r--kubernetes/sdnc/values.yaml53
2 files changed, 37 insertions, 18 deletions
diff --git a/kubernetes/sdnc/requirements.yaml b/kubernetes/sdnc/requirements.yaml
index 2f2d7fb579..57c165c4c0 100644
--- a/kubernetes/sdnc/requirements.yaml
+++ b/kubernetes/sdnc/requirements.yaml
@@ -38,7 +38,7 @@ dependencies:
- name: mariadb-galera
version: ~7.x-0
repository: '@local'
- condition: .global.mariadbGalera.localCluster
+ condition: global.mariadbGalera.localCluster
- name: elasticsearch
version: ~7.x-0
repository: '@local'
diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml
index 7282f305c5..f4f09107bb 100644
--- a/kubernetes/sdnc/values.yaml
+++ b/kubernetes/sdnc/values.yaml
@@ -29,6 +29,7 @@ global:
service: mariadb-galera
internalPort: 3306
nameOverride: mariadb-galera
+ service: mariadb-galera
# Enabling CMPv2
cmpv2Enabled: true
platform:
@@ -60,25 +61,33 @@ global:
#################################################################
secrets:
- uid: db-root-password
- name: '{{ include "common.release" . }}-sdnc-db-root-password'
+ name: &rootDbSecret '{{ include "common.release" . }}-sdnc-db-root-password'
type: password
+ # If we're using shared mariadb, we need to use the secret name (second
+ # part).
+ # If not, we do the same trick than for user db secret hat allows you
+ # override this secret using external one with the same field that is used
+ # to pass this to subchart.
externalSecret: '{{ .Values.global.mariadbGalera.localCluster |
- ternary (default (include "common.mariadb.secret.rootPassSecretName"
- (dict "dot" . "chartName"
- (index .Values "mariadb-galera" "nameOverride")))
- (index .Values "mariadb-galera" "config"
- "mariadbRootPasswordExternalSecret"))
- (include "common.mariadb.secret.rootPassSecretName"
- (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride)) }}'
- password: '{{ (index .Values "mariadb-galera" "config" "mariadbRootPassword") }}'
+ 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)) }}'
+ password: '{{ (index .Values "mariadb-galera" "rootUser" "password") }}'
- uid: db-secret
name: &dbSecretName '{{ include "common.release" . }}-sdnc-db-secret'
type: basicAuth
# This is a nasty trick that allows you override this secret using external one
# with the same field that is used to pass this to subchart
- externalSecret: '{{ ternary "" (tpl (default "" (index .Values "mariadb-galera" "config" "userCredentialsExternalSecret")) .) (hasSuffix "sdnc-db-secret" (index .Values "mariadb-galera" "config" "userCredentialsExternalSecret"))}}'
- login: '{{ index .Values "mariadb-galera" "config" "userName" }}'
- password: '{{ index .Values "mariadb-galera" "config" "userPassword" }}'
+ externalSecret: '{{ (hasSuffix "sdnc-db-secret" (index .Values "mariadb-galera" "db" "externalSecret")) |
+ ternary
+ ""
+ (tpl (default "" (index .Values "mariadb-galera" "db" "externalSecret")) .) }}'
+ login: '{{ index .Values "mariadb-galera" "db" "user" }}'
+ password: '{{ index .Values "mariadb-galera" "db" "password" }}'
- uid: odl-creds
name: &odlCredsSecretName '{{ include "common.release" . }}-sdnc-odl-creds'
type: basicAuth
@@ -244,19 +253,25 @@ certInitializer:
network-name-gen:
enabled: true
mariadb-galera: &mariadbGalera
- nameOverride: sdnc-db
+ nameOverride: &sdnc-db sdnc-db
config: &mariadbGaleraConfig
- rootPasswordExternalSecret: '{{ ternary (include "common.release" .)-sdnc-db-root-password "" .Values.global.mariadbGalera.localCluster }}'
- userName: sdnctl
+ rootPasswordExternalSecret: *rootDbSecret
+ userName: &dbUser sdnctl
userCredentialsExternalSecret: *dbSecretName
+ rootUser:
+ externalSecret: *rootDbSecret
+ db:
+ user: *dbUser
+ externalSecret: *dbSecretName
service:
name: sdnc-dbhost
- internalPort: 3306
sdnctlPrefix: sdnc
persistence:
mountSubPath: sdnc/mariadb-galera
enabled: true
replicaCount: 1
+ serviceAccount:
+ nameOverride: *sdnc-db
cds:
enabled: false
@@ -311,7 +326,11 @@ dgbuilder:
config:
db:
dbName: *sdncDbName
- rootPasswordExternalSecret: '{{ ternary (printf "%s-sdnc-db-root-password" (include "common.release" .)) (include "common.mariadb.secret.rootPassSecretName" (dict "dot" . "chartName" "mariadb-galera")) .Values.global.mariadbGalera.localCluster }}'
+ rootPasswordExternalSecret: '{{ .Values.global.mariadbGalera.localCluster |
+ ternary
+ (printf "%s-sdnc-db-root-password" (include "common.release" .))
+ (include "common.mariadb.secret.rootPassSecretName"
+ (dict "dot" . "chartName" "mariadb-galera")) }}'
userCredentialsExternalSecret: *dbSecretName
dbPodName: mariadb-galera
dbServiceName: mariadb-galera