[MARIADB][COMMON] Add support for mariadb-operator 59/135759/38
authorAndreas Geissler <andreas-geissler@telekom.de>
Wed, 16 Aug 2023 15:18:49 +0000 (17:18 +0200)
committerAndreas Geissler <andreas-geissler@telekom.de>
Fri, 29 Sep 2023 11:42:29 +0000 (13:42 +0200)
Add template functions for the mariadb-operator resources
and update the mariadb-galera chart to support them
Change the flag to "useOperator" in cassandra to the global setup
and additional labels for cassandra resources
Changed Policy DB users to support the new mariadb User
and fixed db.sh script to wait for the DB user creation
Use the new readiness image 5.0.1 with the "app-name" option
Change the MariaDB-Galera Service to the "primary" to avoid Deadlocks
Fix previous SDNC patch (https://gerrit.onap.org/r/c/oom/+/135308) and
temporary disable MariaDB for SDNR, as it is not compatible to
MariaDB 11

Issue-ID: OOM-3236

Change-Id: Ie63fcc9c6d5fa802d38c592b449e7ff8553c2ab9
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
92 files changed:
docs/sections/guides/infra_guides/oom_infra_optional_addons.rst
kubernetes/aai/components/aai-graphadmin/templates/deployment.yaml
kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml
kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml
kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml
kubernetes/aai/components/aai-resources/templates/deployment.yaml
kubernetes/aai/components/aai-traversal/templates/deployment.yaml
kubernetes/aai/values.yaml
kubernetes/cds/components/cds-blueprints-processor/values.yaml
kubernetes/cds/values.yaml
kubernetes/common/cassandra/Chart.yaml
kubernetes/common/cassandra/templates/backup/configmap.yaml
kubernetes/common/cassandra/templates/backup/cronjob.yaml
kubernetes/common/cassandra/templates/backup/pv.yaml
kubernetes/common/cassandra/templates/backup/pvc.yaml
kubernetes/common/cassandra/templates/cassOp.yaml
kubernetes/common/cassandra/templates/configmap.yaml
kubernetes/common/cassandra/templates/pv.yaml
kubernetes/common/cassandra/templates/secrets.yaml
kubernetes/common/cassandra/templates/service.yaml
kubernetes/common/cassandra/templates/servicemonitor.yaml
kubernetes/common/cassandra/templates/statefulset.yaml
kubernetes/common/cassandra/values.yaml
kubernetes/common/common/Chart.yaml
kubernetes/common/common/templates/_cassOp.tpl
kubernetes/common/common/templates/_mariadb.tpl
kubernetes/common/dgbuilder/templates/deployment.yaml
kubernetes/common/mariadb-galera/Chart.yaml
kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml
kubernetes/common/mariadb-galera/templates/backup/pv.yaml
kubernetes/common/mariadb-galera/templates/backup/pvc.yaml
kubernetes/common/mariadb-galera/templates/configmap.yaml
kubernetes/common/mariadb-galera/templates/mariadb.yaml [new file with mode: 0644]
kubernetes/common/mariadb-galera/templates/metrics-svc.yaml
kubernetes/common/mariadb-galera/templates/pdb.yaml
kubernetes/common/mariadb-galera/templates/pv.yaml
kubernetes/common/mariadb-galera/templates/service.yaml
kubernetes/common/mariadb-galera/templates/servicemonitor.yaml
kubernetes/common/mariadb-galera/templates/statefulset.yaml
kubernetes/common/mariadb-galera/values.yaml
kubernetes/common/mariadb-init/templates/job.yaml
kubernetes/common/network-name-gen/templates/deployment.yaml
kubernetes/common/network-name-gen/values.yaml
kubernetes/common/readinessCheck/templates/_readinessCheck.tpl
kubernetes/common/repositoryGenerator/values.yaml
kubernetes/dmaap/components/dmaap-dr-prov/values.yaml
kubernetes/modeling/components/modeling-etsicatalog/templates/deployment.yaml
kubernetes/modeling/components/modeling-etsicatalog/values.yaml
kubernetes/nbi/values.yaml
kubernetes/onap/values.yaml
kubernetes/policy/components/policy-api/values.yaml
kubernetes/policy/components/policy-clamp-runtime-acm/values.yaml
kubernetes/policy/components/policy-drools-pdp/values.yaml
kubernetes/policy/components/policy-pap/values.yaml
kubernetes/policy/components/policy-xacml-pdp/values.yaml
kubernetes/policy/resources/config/db.sh
kubernetes/policy/templates/job.yaml
kubernetes/policy/values.yaml
kubernetes/sdc/components/sdc-cs/templates/job.yaml
kubernetes/sdc/components/sdc-cs/values.yaml
kubernetes/sdnc/components/dmaap-listener/templates/deployment.yaml
kubernetes/sdnc/components/dmaap-listener/values.yaml
kubernetes/sdnc/components/sdnc-ansible-server/values.yaml
kubernetes/sdnc/components/ueb-listener/templates/deployment.yaml
kubernetes/sdnc/components/ueb-listener/values.yaml
kubernetes/sdnc/templates/job.yaml
kubernetes/sdnc/templates/sdnrdb-init-job.yaml
kubernetes/sdnc/templates/statefulset.yaml
kubernetes/sdnc/values.yaml
kubernetes/so/components/so-admin-cockpit/values.yaml
kubernetes/so/components/so-bpmn-infra/values.yaml
kubernetes/so/components/so-catalog-db-adapter/values.yaml
kubernetes/so/components/so-cnfm-lcm/values.yaml
kubernetes/so/components/so-etsi-nfvo-ns-lcm/values.yaml
kubernetes/so/components/so-etsi-sol005-adapter/values.yaml
kubernetes/so/components/so-mariadb/values.yaml
kubernetes/so/components/so-nssmf-adapter/values.yaml
kubernetes/so/components/so-oof-adapter/values.yaml
kubernetes/so/components/so-openstack-adapter/values.yaml
kubernetes/so/components/so-request-db-adapter/values.yaml
kubernetes/so/components/so-sdc-controller/values.yaml
kubernetes/so/components/so-sdnc-adapter/values.yaml
kubernetes/so/values.yaml
kubernetes/vfc/components/vfc-nslcm/templates/deployment.yaml
kubernetes/vfc/components/vfc-nslcm/values.yaml
kubernetes/vfc/components/vfc-vnflcm/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnflcm/values.yaml
kubernetes/vfc/components/vfc-vnfmgr/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnfmgr/values.yaml
kubernetes/vfc/components/vfc-vnfres/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnfres/values.yaml
kubernetes/vfc/values.yaml

index ad1104e..71ce344 100644 (file)
@@ -9,6 +9,8 @@
 .. _Istio setup guide: https://istio.io/latest/docs/setup/install/helm/
 .. _Kiali setup guide: https://kiali.io/docs/installation/installation-guide/example-install/
 .. _Kserve setup guide: https://kserve.github.io/website/0.10/admin/kubernetes_deployment/
+.. _K8ssandra setup guide: https://docs.k8ssandra.io/install/
+.. _Mariadb-Operator setup guide: https://github.com/mariadb-operator/mariadb-operator
 
 .. _oom_base_optional_addons:
 
@@ -99,7 +101,49 @@ To be done...
 K8ssandra-Operator Installation
 -------------------------------
 
-To be done...
+K8ssandra-Operator is used to ease the installation and lifecycle management
+Cassandra clusters, including monitoring and backup
+
+For setup the K8ssandra operator is used, see `K8ssandra setup guide`_
+
+- Install k8ssandra-operator namespace::
+
+    > kubectl create namespace k8ssandra-operator
+
+    > kubectl label namespace k8ssandra-operator istio-injection=enabled
+
+- Install the k8ssandra-operator::
+
+    > helm repo add k8ssandra https://helm.k8ssandra.io/stable
+
+    > helm repo update k8ssandra
+
+    > helm install k8ssandra-operator --namespace k8ssandra-operator
+      k8ssandra/k8ssandra-operator --set global.clusterScoped=true
+
+Mariadb-Operator Installation
+-----------------------------
+
+Mariadb-Operator is used to ease the installation and lifecycle management
+MariaDB Galera and Replication clusters, including monitoring and backup
+
+For setup the Mariadb-Operator is used, see `Mariadb-Operator setup guide`_
+
+- Install mariadb-operator namespace::
+
+    > kubectl create namespace mariadb-operator
+
+    > kubectl label namespace mariadb-operator istio-injection=enabled
+
+- Install the mariadb-operator::
+
+    > helm repo add mariadb-operator https://mariadb-operator.github.io/mariadb-operator
+
+    > helm repo update mariadb-operator
+
+    > helm install mariadb-operator --namespace mariadb-operator
+      mariadb-operator/mariadb-operator --set ha.enabled=true
+
 
 Kserve Installation
 -------------------
index 536fc9d..c3e36c2 100644 (file)
@@ -81,7 +81,7 @@ spec:
       {{  else }}
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
         {{- else }}
index 407c9fb..865dfe3 100644 (file)
@@ -64,7 +64,7 @@ spec:
       - command:
         - /bin/bash
         - -c
-        - /app/ready.py --container-name aai-cassandra --timeout 1 || /app/ready.py --container-name cassandra
+        - /app/ready.py --app-name aai-cassandra --timeout 1 || /app/ready.py --app-name cassandra
         env:
         - name: NAMESPACE
           valueFrom:
index 31669dd..1a81249 100644 (file)
@@ -58,7 +58,7 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
         {{- else }}
index d585491..bf3279f 100644 (file)
@@ -63,7 +63,7 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
         {{- else }}
@@ -218,7 +218,7 @@ spec:
       - command:
         - /bin/bash
         - -c
-        - /app/ready.py --container-name aai-cassandra --timeout 1 || /app/ready.py --container-name cassandra
+        - /app/ready.py --app-name aai-cassandra --timeout 1 || /app/ready.py --app-name cassandra
         env:
         - name: NAMESPACE
           valueFrom:
index 2f60811..5b9e9d2 100644 (file)
@@ -105,7 +105,7 @@ spec:
         - --job-name
         - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
           {{- else }}
-        - --container-name
+        - --app-name
             {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
             {{- else }}
index a2c81cf..6d12f08 100644 (file)
@@ -123,7 +123,7 @@ spec:
         - --job-name
         - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
         {{- else }}
-        - --container-name
+        - --app-name
           {{- if .Values.global.cassandra.localCluster }}
         - aai-cassandra
           {{- else }}
index fbd3438..b9223b1 100644 (file)
@@ -25,7 +25,7 @@ global: # global defaults
   dockerhubRepository: docker.io
   busyboxImage: busybox
 
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:5.0.1
 
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
@@ -39,6 +39,13 @@ global: # global defaults
     #This will instantiate AAI cassandra cluster, default:shared cassandra.
     localCluster: false
 
+    # in case of a local cassandra cluster
+    # flag to enable the DB creation via k8ssandra-operator
+    useOperator: true
+    # if useOperator set to "true", set "enableServiceAccount to "false"
+    # as the SA is created by the Operator
+    enableServiceAccount: false
+
     #Service Name of the cassandra cluster to connect to.
     #Override it to aai-cassandra if localCluster is enabled.
     #in case of using k8ssandra-operator in the common cassandra installation
@@ -53,7 +60,7 @@ global: # global defaults
     #then it should be same as aai-cassandra replicaCount
     replicas: 3
 
-    #Cassanara login details
+    #Cassandra login details
     username: cassandra
     password: cassandra
 
@@ -357,7 +364,6 @@ cassandra:
     mountSubPath: aai/cassandra
     enabled: true
   k8ssandraOperator:
-    enabled: false
     config:
       clusterName: aai-cassandra
 
index 42abd16..e6c0856 100755 (executable)
@@ -219,7 +219,8 @@ resources:
 
 readinessCheck:
   wait_for:
-    - cds-db
+    apps:
+      - cds-db
 
 #Pods Service Account
 serviceAccount:
index 27d5e84..199c438 100644 (file)
@@ -78,6 +78,9 @@ mariadb-galera:
     name: &mysqlDbName sdnctl
   nameOverride: &dbServer cds-db
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   persistence:
     enabled: true
     mountSubPath: cds/data
index c861b1a..75e07a1 100644 (file)
@@ -30,3 +30,4 @@ dependencies:
   - name: serviceAccount
     version: ~13.x-0
     repository: 'file://../serviceAccount'
+    condition: global.cassandra.enableServiceAccount
\ No newline at end of file
index b566b61..2c85a1a 100644 (file)
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 {{- if .Values.backup.enabled }}
 apiVersion: v1
 kind: ConfigMap
index e2f675a..06bb743 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 */}}
 {{- if .Values.backup.enabled }}
-{{- if .Values.k8ssandraOperator.enabled }}
+{{- if .Values.global.cassandra.useOperator }}
 {{ else }}
 apiVersion: batch/v1beta1
 kind: CronJob
@@ -39,7 +39,7 @@ spec:
             - command:
               - /app/ready.py
               args:
-              - --container-name
+              - --app-name
               - {{ include "common.name" . }}
               env:
               - name: NAMESPACE
index 23e4551..e7218fa 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 */}}
 {{- if .Values.backup.enabled }}
-{{- if .Values.k8ssandraOperator.enabled }}
+{{- if .Values.global.cassandra.useOperator }}
 {{ else }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
 {{- if eq "True" (include "common.needPV" .) -}}
index e60a1db..56b3ba8 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 */}}
 {{- if .Values.backup.enabled }}
-{{- if .Values.k8ssandraOperator.enabled }}
+{{- if .Values.global.cassandra.useOperator }}
 {{ else }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
 ---
index cb6ce4a..9f463ad 100644 (file)
@@ -1,5 +1,5 @@
 {{/*
-# Copyright Â© 2018 Amdocs, AT&T, Bell Canada
+# Copyright Â© 2023 Deutsche Telekom AG
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
 # limitations under the License.
 */}}
 
-{{- if .Values.k8ssandraOperator.enabled }}
+{{- if .Values.global.cassandra.useOperator }}
 {{ include "common.k8ssandraCluster" . }}
 {{- end }}
\ No newline at end of file
index 8f2b39e..5510986 100644 (file)
@@ -1,4 +1,4 @@
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 {{- if .Values.configOverrides }}
 apiVersion: v1
 kind: ConfigMap
index 8e2ad66..d18e51d 100644 (file)
@@ -13,6 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 {{ include "common.replicaPV" . }}
 {{- end }}
\ No newline at end of file
index b776caf..5a611a9 100644 (file)
@@ -16,6 +16,6 @@
 # limitations under the License.
 */}}
 
-{{- if .Values.k8ssandraOperator.enabled }}
+{{- if .Values.global.cassandra.useOperator }}
 {{ include "common.secretFast" . }}
 {{- end }}
\ No newline at end of file
index 092c677..8b2e534 100644 (file)
@@ -14,6 +14,6 @@
 # limitations under the License.
 */}}
 
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 {{ include "common.headlessService" . }}
 {{- end }}
\ No newline at end of file
index 759586f..0781073 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 */}}
 
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 {{- if .Values.metrics.serviceMonitor.enabled }}
 {{  include "common.serviceMonitor" . }}
 {{- end }}
index dff7082..4815d14 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 */}}
 
-{{- if not .Values.k8ssandraOperator.enabled }}
+{{- if not .Values.global.cassandra.useOperator }}
 apiVersion: apps/v1
 kind: StatefulSet
 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
index 2f24750..930fe9b 100644 (file)
@@ -21,9 +21,14 @@ global: # global defaults
     mountPath: /dockerdata-nfs
     backup:
       mountPath: /dockerdata-nfs/backup
+  cassandra:
+    # flag to enable the DB creation via k8ssandra-operator
+    useOperator: true
+    # if useOperator set to "true", set "enableServiceAccount to "false"
+    # as the SA is created by the Operator
+    enableServiceAccount: false
 
 k8ssandraOperator:
-  enabled: true
   cassandraVersion: 4.0.1
   persistence:
     #storageClassName: default
index e134fe8..4025924 100644 (file)
@@ -16,4 +16,4 @@
 apiVersion: v2
 description: Common templates for inclusion in other charts
 name: common
-version: 13.0.1
+version: 13.0.2
index c360a0f..d0f2387 100644 (file)
@@ -1,3 +1,19 @@
+{{/*
+# Copyright Â© 2022 Deutsche Telekom AG
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
 {{/* Cassandra Data Center. */}}
 {{- define "common.k8ssandraCluster" -}}
 {{- $global := .Values.global }}
@@ -10,7 +26,6 @@ spec:
   reaper:
     containerImage:
       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
-    heapSize: 512Mi
     autoScheduling:
       enabled: true
   stargate:
@@ -67,5 +82,8 @@ spec:
       pods:
         annotations:
           {{ toYaml .Values.podAnnotations | nindent 10 }}
+      commonLabels:
+        app: {{ .Values.k8ssandraOperator.config.clusterName }}
+        version: {{ .Values.k8ssandraOperator.cassandraVersion }}
     {{- end }}
 {{ end }}
index 5021c50..7e127e2 100644 (file)
   {{- include "common.mariadb.secret._secretName" (set . "uidTemplate" "common.mariadb.secret.userCredentialsUID") }}
 {{- end -}}
 
+{{/*
+  Choose the name of the mariadb app label to use.
+*/}}
+{{- define "common.mariadbAppName" -}}
+  {{- if .Values.global.mariadbGalera.localCluster -}}
+    {{- index .Values "mariadb-galera" "nameOverride" -}}
+  {{- else -}}
+    {{- .Values.global.mariadbGalera.nameOverride -}}
+  {{- end -}}
+{{- end -}}
+
 {{/*
   Choose the name of the mariadb service to use.
 */}}
 {{- define "common.mariadbSecretParam" -}}
   {{ printf "password" -}}
 {{- end -}}
+
+{{/*
+  Create MariDB Database via mariadb-operator
+*/}}
+{{- define "common.mariadbOpDatabase" -}}
+{{- $dot := default . .dot -}}
+{{- $dbname := (required "'dbame' param, is required." .dbname) -}}
+{{- $dbinst := (required "'dbinst' param, is required." .dbinst) -}}
+---
+apiVersion: mariadb.mmontes.io/v1alpha1
+kind: Database
+metadata:
+  name: {{ $dbname }}
+spec:
+  mariaDbRef:
+    name: {{ $dbinst }}
+  characterSet: utf8
+  collate: utf8_general_ci
+{{- end -}}
+
+{{/*
+  Create MariaDB User via mariadb-operator
+*/}}
+{{- define "common.mariadbOpUser" -}}
+{{- $dot := default . .dot -}}
+{{- $dbuser := (required "'dbuser' param, is required." .dbuser) -}}
+{{- $dbinst := (required "'dbinst' param, is required." .dbinst) -}}
+{{- $dbsecret := (required "'dbsecret' param, is required." .dbsecret) -}}
+---
+apiVersion: mariadb.mmontes.io/v1alpha1
+kind: User
+metadata:
+  name: {{ $dbuser }}
+spec:
+  # If you want the user to be created with a different name than the resource name
+  # name: user-custom
+  mariaDbRef:
+    name: {{ $dbinst }}
+  passwordSecretKeyRef:
+    name: {{ $dbsecret }}
+    key: password
+  # This field is immutable and defaults to 10
+  maxUserConnections: 100
+{{- end -}}
+
+{{/*
+  Grant rights to a MariaDB User via mariadb-operator
+*/}}
+{{- define "common.mariadbOpGrants" -}}
+{{- $dot := default . .dot -}}
+{{- $dbuser := (required "'dbuser' param, is required." .dbuser) -}}
+{{- $dbname := (required "'dbame' param, is required." .dbname) -}}
+{{- $dbinst := (required "'dbinst' param, is required." .dbinst) -}}
+---
+apiVersion: mariadb.mmontes.io/v1alpha1
+kind: Grant
+metadata:
+  name: {{ $dbuser }}-{{ $dbname }}-{{ $dbinst }}
+spec:
+  mariaDbRef:
+    name: {{ $dbinst }}
+  privileges:
+    - "ALL"
+  database: {{ $dbname }}
+  table: "*"
+  username: {{ $dbuser }}
+  grantOption: true
+{{- end -}}
+
+{{/*
+  MariaDB Backup via mariadb-operator
+*/}}
+{{- define "common.mariadbOpBackup" -}}
+{{- $dot := default . .dot -}}
+{{- $dbinst := include "common.name" $dot -}}
+kind: Backup
+metadata:
+  name: backup-scheduled
+spec:
+  mariaDbRef:
+    name: {{ $dbinst }}
+  schedule:
+    cron: "*/1 * * * *"
+    suspend: false
+  maxRetentionDays: 30
+  storage:
+    persistentVolumeClaim:
+      resources:
+        requests:
+          storage: 100Mi
+      {{- if .Values.mariadbOperator.storageClassName }}
+      storageClassName: {{ .Values.mariadbOperator.storageClassName }}
+      {{- end }}
+      accessModes:
+        - ReadWriteOnce
+  resources:
+    requests:
+      cpu: 100m
+      memory: 128Mi
+    limits:
+      cpu: 300m
+      memory: 512Mi
+{{- end -}}
+
+{{/*
+  Create a MariaDB instance via mariadb-operator
+*/}}
+{{- define "common.mariadbOpInstance" -}}
+{{- $dot := default . .dot -}}
+{{- $global := $dot.Values.global -}}
+{{- $dbinst := include "common.name" $dot -}}
+{{- $dbrootsecret := tpl (default (include "common.mariadb.secret.rootPassSecretName" (dict "dot" $dot "chartName" "")) $dot.Values.rootUser.externalSecret) $dot -}}
+{{- $dbusersecret := tpl (default (include "common.mariadb.secret.userCredentialsSecretName" (dict "dot" $dot "chartName" "")) $dot.Values.db.externalSecret) $dot -}}
+---
+apiVersion: mariadb.mmontes.io/v1alpha1
+kind: MariaDB
+metadata:
+  name: {{ $dbinst }}
+spec:
+  podSecurityContext:
+    runAsUser: 10001
+    runAsGroup: 10001
+    fsGroup: 10001
+  inheritMetadata:
+    {{ if .Values.podAnnotations -}}
+    annotations: {{ toYaml .Values.podAnnotations | nindent 6 }}
+    {{- end }}
+    labels:
+      app: {{ $dbinst }}
+      version: {{ .Values.mariadbOperator.appVersion }}
+  rootPasswordSecretKeyRef:
+    name: {{ $dbrootsecret }}
+    key: password
+  image:
+    repository: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadbOperator.image }}
+    tag: {{ $dot.Values.mariadbOperator.appVersion }}
+    pullPolicy: IfNotPresent
+  imagePullSecrets:
+    - name: {{ include "common.namespace" . }}-docker-registry-key
+  port: 3306
+  replicas: {{ $dot.Values.replicaCount }}
+  galera:
+    {{- if eq (int $dot.Values.replicaCount) 1 }}
+    enabled: false
+    {{- else }}
+    enabled: {{ $dot.Values.mariadbOperator.galera.enabled }}
+    {{- end }}
+    sst: mariabackup
+    replicaThreads: 1
+    agent:
+      image:
+        repository: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ .Values.mariadbOperator.galera.agentImage }}
+        tag: {{ $dot.Values.mariadbOperator.galera.agentVersion }}
+        pullPolicy: IfNotPresent
+      port: 5555
+      kubernetesAuth:
+        enabled: true
+        authDelegatorRoleName: {{ $dbinst }}-auth
+      gracefulShutdownTimeout: 5s
+    recovery:
+      enabled: true
+      clusterHealthyTimeout: 5m
+      clusterBootstrapTimeout: 10m
+      podRecoveryTimeout: 5m
+      podSyncTimeout: 10m
+    initContainer:
+      image:
+        repository: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ $dot.Values.mariadbOperator.galera.initImage }}
+        tag: {{ $dot.Values.mariadbOperator.galera.initVersion }}
+        pullPolicy: IfNotPresent
+    volumeClaimTemplate:
+      resources:
+        requests:
+          storage: 50Mi
+      accessModes:
+        - ReadWriteOnce
+  livenessProbe:
+    exec:
+      command:
+        - bash
+        - '-c'
+        - mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
+    initialDelaySeconds: 20
+    periodSeconds: 10
+    timeoutSeconds: 5
+  readinessProbe:
+    exec:
+      command:
+        - bash
+        - '-c'
+        - mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
+    initialDelaySeconds: 20
+    periodSeconds: 10
+    timeoutSeconds: 5
+  affinity:
+    podAntiAffinity:
+      requiredDuringSchedulingIgnoredDuringExecution:
+        - topologyKey: kubernetes.io/hostname
+  tolerations:
+    - key: mariadb.mmontes.io/ha
+      operator: Exists
+      effect: NoSchedule
+  podDisruptionBudget:
+    maxUnavailable: 50%
+  updateStrategy:
+    type: RollingUpdate
+  #myCnf: |
+  #  [mysqld]
+  #  bind-address=0.0.0.0
+  #  default_storage_engine=InnoDB
+  #  binlog_format=row
+  #  innodb_autoinc_lock_mode=2
+  #  max_allowed_packet=256M
+  #  lower_case_table_names = 1
+
+  #  ## Character set
+  #  collation_server=utf8_unicode_ci
+  #  init_connect='SET NAMES utf8'
+  #  character_set_server=utf8
+
+  myCnfConfigMapKeyRef:
+    key: my.cnf
+    name: {{ printf "%s-configuration" (include "common.fullname" $dot) }}
+  resources: {{ include "common.resources" . | nindent 4 }}
+  volumeClaimTemplate:
+    {{- if $dot.Values.mariadbOperator.storageClassName }}
+    storageClassName: {{ $dot.Values.k8ssandraOperator.persistence.storageClassName }}
+    {{- end }}
+    resources:
+      requests:
+        storage: {{ $dot.Values.persistence.size | quote }}
+    accessModes:
+      - ReadWriteOnce
+{{-  if $dot.Values.db.user }}
+{{ include "common.mariadbOpUser" (dict "dot" . "dbuser" $dot.Values.db.user "dbinst" $dbinst "dbsecret" $dbusersecret) }}
+{{-  end }}
+{{-  if $dot.Values.db.name }}
+{{ include "common.mariadbOpDatabase" (dict "dot" . "dbname" $dot.Values.db.name "dbinst" $dbinst) }}
+{{-  end }}
+{{-  if and $dot.Values.db.user $dot.Values.db.name }}
+{{ include "common.mariadbOpGrants" (dict "dot" . "dbuser" $dot.Values.db.user "dbname" $dot.Values.db.name "dbinst" $dbinst) }}
+{{-  end }}
+{{- end -}}
index 92fc13d..84d6bc1 100644 (file)
@@ -61,7 +61,7 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         - {{ .Values.config.dbPodName }}
         env:
         - name: NAMESPACE
index 92eac6f..71ff421 100644 (file)
@@ -18,7 +18,7 @@
 apiVersion: v2
 description: Chart for MariaDB Galera cluster
 name: mariadb-galera
-version: 13.0.0
+version: 13.0.1
 keywords:
   - mariadb
   - mysql
@@ -39,4 +39,5 @@ dependencies:
     repository: 'file://../repositoryGenerator'
   - name: serviceAccount
     version: ~13.x-0
-    repository: 'file://../serviceAccount'
\ No newline at end of file
+    repository: 'file://../serviceAccount'
+    condition: global.mariadbGalera.enableServiceAccount
\ No newline at end of file
index e2a9ca6..4548626 100644 (file)
@@ -15,6 +15,9 @@
 # limitations under the License.
 */}}
 
+{{- if and .Values.backup.enabled .Values.global.mariadbGalera.useOperator }}
+{{ include "common.mariadbOpBackup" . }}
+{{ else }}
 {{- if and .Values.backup.enabled .Values.persistence.enabled }}
 apiVersion: batch/v1beta1
 kind: CronJob
@@ -180,3 +183,4 @@ spec:
             - name: tmp
               emptyDir: {}
 {{- end }}
+{{- end }}
index 30eb74b..d5e2610 100644 (file)
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
+
+{{- if not .Values.global.mariadbGalera.useOperator }}
 {{- if .Values.backup.enabled }}
 {{- if and .Values.backup.persistence.enabled (not .Values.backup.persistence.existingClaim) -}}
 {{- if eq "True" (include "common.needPV" .) -}}
@@ -41,3 +43,4 @@ spec:
 {{- end -}}
 {{- end -}}
 {{- end -}}
+{{- end -}}
index 5dd8a3f..4c2bfcd 100644 (file)
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
+
+{{- if not .Values.global.mariadbGalera.useOperator }}
 {{- if .Values.backup.enabled }}
 {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
 ---
@@ -45,3 +47,4 @@ spec:
 {{- end -}}
 {{- end -}}
 {{- end -}}
+{{- end -}}
\ No newline at end of file
index c95a234..0aa0a63 100644 (file)
 # limitations under the License.
 */}}
 
-{{ if .Values.mariadbConfiguration }}
+{{- if .Values.global.mariadbGalera.useOperator }}
+{{    if .Values.mariadbOpConfiguration }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ printf "%s-configuration" (include "common.fullname" .) }}
+  namespace: {{ include "common.namespace" . }}
+  labels: {{- include "common.labels" . | nindent 4 }}
+data:
+  my.cnf: |
+{{ .Values.mariadbOpConfiguration | indent 4 }}
+{{-   end }}
+{{- else }}
+{{    if .Values.mariadbConfiguration }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
@@ -25,4 +38,5 @@ metadata:
 data:
   my.cnf: |
 {{ .Values.mariadbConfiguration | indent 4 }}
+{{-   end }}
 {{- end }}
\ No newline at end of file
diff --git a/kubernetes/common/mariadb-galera/templates/mariadb.yaml b/kubernetes/common/mariadb-galera/templates/mariadb.yaml
new file mode 100644 (file)
index 0000000..ce09c9f
--- /dev/null
@@ -0,0 +1,19 @@
+{{/*
+# Copyright Â© 2023 Deutsche Telekom AG
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+{{- if .Values.global.mariadbGalera.useOperator }}
+{{ include "common.mariadbOpInstance" . }}
+{{- end }}
\ No newline at end of file
index 841aab3..d37aeb1 100644 (file)
@@ -14,7 +14,9 @@
 # limitations under the License.
 */}}
 
-{{- if default false .Values.global.metrics.enabled }}
+{{- if not .Values.global.mariadbGalera.useOperator }}
+{{-   if default false .Values.global.metrics.enabled }}
+---
 apiVersion: v1
 kind: Service
 metadata:
@@ -31,4 +33,5 @@ spec:
       port: {{ .Values.metrics.service.port }}
       targetPort: tcp-metrics
   selector: {{- include "common.matchLabels" . | nindent 4 }}
-{{- end }}
+{{-   end }}
+{{- end }}
\ No newline at end of file
index 1d9d414..734f03f 100644 (file)
 # limitations under the License.
 */}}
 
-{{- if .Values.podDisruptionBudget.create }}
+{{- if not .Values.global.mariadbGalera.useOperator }}
+{{-   if .Values.podDisruptionBudget.create }}
 apiVersion: policy/v1
 kind: PodDisruptionBudget
 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
 spec:
-{{- if .Values.podDisruptionBudget.minAvailable }}
+{{-     if .Values.podDisruptionBudget.minAvailable }}
   minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
-{{- end }}
-{{- if .Values.podDisruptionBudget.maxUnavailable }}
+{{-     end }}
+{{-     if .Values.podDisruptionBudget.maxUnavailable }}
   maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
-{{- end }}
+{{-     end }}
   selector:
     matchLabels: {{- include "common.matchLabels" . | nindent 6 }}
-{{- end }}
+{{-   end }}
+{{- end }}
\ No newline at end of file
index 54a02cf..129b5b2 100644 (file)
@@ -15,4 +15,6 @@
 # limitations under the License.
 */}}
 
+{{- if not .Values.global.mariadbGalera.useOperator }}
 {{ include "common.replicaPV" . }}
+{{- end }}
\ No newline at end of file
index 6af9135..4cabde1 100644 (file)
 # limitations under the License.
 */}}
 
+{{- if not .Values.global.mariadbGalera.useOperator }}
 {{ include "common.service" . }}
 ---
 {{ include "common.headlessService" . }}
+{{- end }}
 {{- if (include "common.onServiceMesh" .) }}
-{{- if eq (default "istio" .Values.global.serviceMesh.engine) "istio" }}
+{{-   if eq (default "istio" .Values.global.serviceMesh.engine) "istio" }}
 ---
 apiVersion: security.istio.io/v1beta1
 kind: PeerAuthentication
@@ -29,9 +31,9 @@ metadata:
 spec:
   selector:
     matchLabels:
-      app.kubernetes.io/name: {{ include "common.servicename" . }}
+      app: {{ include "common.servicename" . }}
   portLevelMtls:
     '{{ .Values.service.internalPort }}':
       mode: DISABLE
-{{- end}}
-{{- end}}
+{{-   end }}
+{{- end }}
index 6d1ed40..4cbf7b3 100644 (file)
@@ -14,6 +14,8 @@
 # limitations under the License.
 */}}
 
-{{- if .Values.metrics.serviceMonitor.enabled }}
+{{- if not .Values.global.mariadbGalera.useOperator }}
+{{-   if .Values.metrics.serviceMonitor.enabled }}
 {{  include "common.serviceMonitor" . }}
-{{- end }}
+{{-   end }}
+{{- end }}
\ No newline at end of file
index c95b572..2f5b33f 100644 (file)
@@ -18,6 +18,7 @@
 # limitations under the License.
 */}}
 
+{{- if not .Values.global.mariadbGalera.useOperator }}
 apiVersion: apps/v1
 kind: StatefulSet
 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
@@ -266,3 +267,4 @@ spec:
   volumeClaimTemplates:
     - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "data" "persistenceInfos" .Values.persistence) | indent 6 | trim }}
 {{- end }}
+{{- end }}
\ No newline at end of file
index e9fe577..a749c09 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+#################################################################
+# Global configuration defaults.
+#################################################################
+global:
+  nodePortPrefix: 302
+  persistence:
+    mountPath: /dockerdata-nfs
+    backup:
+      mountPath: /dockerdata-nfs/backup
+  clusterDomain: cluster.local
+  metrics: {}
+  mariadbGalera:
+    # flag to enable the DB creation via mariadb-operator
+    useOperator: true
+    # if useOperator set to "true", set "enableServiceAccount to "false"
+    # as the SA is created by the Operator
+    enableServiceAccount: false
+    nameOverride: mariadb-galera
+    service: mariadb-galera
 
 #################################################################
 # Secrets metaconfig
@@ -35,21 +54,108 @@ secrets:
     login: '{{ .Values.galera.mariabackup.user }}'
     password: '{{ .Values.galera.mariabackup.password }}'
 
+mariadbOperator:
+  image: mariadb
+  appVersion: 11.1.2
+  galera:
+    enabled: true
+    agentImage: mariadb-operator/agent
+    agentVersion: v0.0.2
+    initImage: mariadb-operator/init
+    initVersion: v0.0.5
+
+## String to partially override common.names.fullname template (will maintain the release name)
+##
+nameOverride: mariadb-galera
+
+## Custom db configuration
+##
+db:
+  ## MariaDB username and password
+  ## Password is ignored if externalSecret is specified.
+  ## If not set, password will be "randomly" generated
+  ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run
+  ##
+  user: my-user
+  # password:
+  # externalSecret:
+  ## Database to create
+  ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run
+  ##
+  # name: my_database
+
+## Desired number of cluster nodes
+##
+replicaCount: 3
+
+## Additional pod annotations for MariaDB Galera pods
+## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
+## -> here required to enable mariadb-galera in istio
+##
+podAnnotations:
+  #  sidecar.istio.io/inject: "false"
+  traffic.sidecar.istio.io/excludeInboundPorts: "4444,4567,4568"
+  traffic.sidecar.istio.io/includeInboundPorts: '*'
+  traffic.sidecar.istio.io/excludeOutboundPorts: "4444,4567,4568"
+
+mariadbOpConfiguration: |-
+  [mysqld]
+  max_allowed_packet=256M
+  lower_case_table_names = 1
+
+  ## Character set
+  collation_server=utf8_unicode_ci
+  init_connect='SET NAMES utf8'
+  character_set_server=utf8
+
+  ## MyISAM
+  key_buffer_size=32M
+  myisam_recover_options=FORCE,BACKUP
+
+  ## Safety
+  skip_host_cache
+  skip_name_resolve
+  max_allowed_packet=16M
+  max_connect_errors=1000000
+  sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
+  sysdate_is_now=1
+
+  ## Caches and Limits
+  tmp_table_size=32M
+  max_heap_table_size=32M
+  # Re-enabling as now works with Maria 10.1.2
+  query_cache_type=1
+  query_cache_limit=4M
+  query_cache_size=256M
+  max_connections=500
+  thread_cache_size=50
+  open_files_limit=65535
+  table_definition_cache=4096
+  table_open_cache=4096
+
+  ## InnoDB
+  innodb=FORCE
+  innodb_strict_mode=1
+  # Mandatory per https://github.com/codership/documentation/issues/25
+  innodb_autoinc_lock_mode=2
+  # Per https://www.percona.com/blog/2006/08/04/innodb-double-write/
+  innodb_doublewrite=1
+  innodb_flush_method=O_DIRECT
+  innodb_log_files_in_group=2
+  innodb_log_file_size=128M
+  innodb_flush_log_at_trx_commit=1
+  innodb_file_per_table=1
+  # 80% Memory is default reco.
+  # Need to re-evaluate when DB size grows
+  innodb_buffer_pool_size=2G
+  innodb_file_format=Barracuda
+
+##########################################################################################
+# !!! the following configuration entries are ignored, when mariadbOperator is enabled !!!
+##########################################################################################
 # bitnami image doesn't support well single quote in password
 passwordStrengthOverride: basic
 
-#################################################################
-# Global configuration defaults.
-#################################################################
-global:
-  nodePortPrefix: 302
-  persistence:
-    mountPath: /dockerdata-nfs
-    backup:
-      mountPath: /dockerdata-nfs/backup
-  clusterDomain: cluster.local
-  metrics: {}
-
 image: bitnami/mariadb-galera:10.5.8
 ## Specify a imagePullPolicy
 ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
@@ -66,10 +172,6 @@ debug: true
 ## actions performed on the databases are tried to be done before actual start.
 init_sleep_time: 5
 
-## String to partially override common.names.fullname template (will maintain the release name)
-##
-nameOverride: mariadb-galera
-
 ## Use an alternate scheduler, e.g. "stork".
 ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
 ##
@@ -129,22 +231,6 @@ rootUser:
   # password:
   # externalSecret:
 
-## Custom db configuration
-##
-db:
-  ## MariaDB username and password
-  ## Password is ignored if externalSecret is specified.
-  ## If not set, password will be "randomly" generated
-  ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-user-on-first-run
-  ##
-  user: my-user
-  # password:
-  # externalSecret:
-  ## Database to create
-  ## ref: https://github.com/bitnami/bitnami-docker-mariadb-galera#creating-a-database-on-first-run
-  ##
-  # name: my_database
-
 ## Galera configuration
 ##
 galera:
@@ -212,7 +298,8 @@ backup:
 
 readinessCheck:
   wait_for:
-    - '{{ include "common.name" . }}'
+    apps:
+      - '{{ include "common.name" . }}'
 
 ## TLS configuration
 ##
@@ -368,26 +455,12 @@ mariadbConfiguration: |-
 ##
 ## extraFlags: "--max-connect-errors=1000 --max_connections=155"
 
-## Desired number of cluster nodes
-##
-replicaCount: 3
-
 ## updateStrategy for MariaDB Master StatefulSet
 ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
 ##
 updateStrategy:
   type: RollingUpdate
 
-## Additional pod annotations for MariaDB Galera pods
-## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
-## -> here required to enable mariadb-galera in istio
-##
-podAnnotations:
-  #  sidecar.istio.io/inject: "false"
-  traffic.sidecar.istio.io/excludeInboundPorts: "4444,4567,4568"
-  traffic.sidecar.istio.io/includeInboundPorts: '*'
-  traffic.sidecar.istio.io/excludeOutboundPorts: "4444,4567,4568"
-
 ## Pod affinity preset
 ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
 ## Allowed values: soft, hard
index a899d93..f41f523 100644 (file)
@@ -41,7 +41,7 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         - {{ default .Values.global.mariadbGalera.nameOverride .Values.mariadbGalera.containerName }}
         env:
         - name: NAMESPACE
index b170c8f..1eed35c 100644 (file)
@@ -29,7 +29,7 @@ spec:
         - /app/ready.py
         args:
 {{- if .Values.global.mariadbGalera.localCluster }}
-        - --container-name
+        - --app-name
         - {{ index .Values "mariadb-galera" "nameOverride" }}
 {{- else }}
         - --job-name
index 5858e84..adfa468 100644 (file)
@@ -30,7 +30,7 @@ global:
     #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
     globalCluster: true
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
@@ -63,6 +63,10 @@ mariadb-galera:
     name: nengdb
     portName: nengdbport
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
+
   persistence:
     enabled: true
     mountSubPath: network-name-gen/data
index 90c278e..879be12 100644 (file)
       - aaf-cm
       - aaf-service
 
+  the powerful one allows also to wait for pod names with this
+  (has to start with the given pod name):
+  wait_for:
+    name: myname
+    pods:
+      - test-pod
+
+  the powerful one allows also to wait for pods with the
+  given "app" label:
+  wait_for:
+    name: myname
+    apps:
+      - mariadb-galera
+
   the powerful one allows also to wait for jobs with this:
   wait_for:
     name: myname
@@ -48,7 +62,7 @@
      - .dot : environment (.)
      - .initRoot : the root dictionary of readinessCheck submodule
                    (default to .Values.readinessCheck)
-     - .wait_for : list of containers / jobs to wait for (default to
+     - .wait_for : list of containers / pods /apps / jobs to wait for (default to
                    .Values.wait_for)
 
   Example calls:
@@ -62,6 +76,8 @@
 {{-   $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }}
 {{-   $wait_for := default $initRoot.wait_for .wait_for -}}
 {{-   $containers := index (ternary (dict "containers" $wait_for) $wait_for (kindIs "slice" $wait_for)) "containers" -}}
+{{-   $pods := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "pods" -}}
+{{-   $apps := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "apps" -}}
 {{-   $namePart := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "name" -}}
 {{-   $jobs := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "jobs" -}}
 - name: {{ include "common.name" $dot }}{{ ternary "" (printf "-%s" $namePart) (empty $namePart) }}-readiness
   - --container-name
   - {{ tpl $container $dot }}
   {{- end }}
+  {{- range $pod := default (list) $pods }}
+  - --pod-name
+  - {{ tpl $pod $dot }}
+  {{- end }}
+  {{- range $app := default (list) $apps }}
+  - --app-name
+  - {{ tpl $app $dot }}
+  {{- end }}
   {{- range $job := $jobs }}
   - --job-name
   - {{ tpl $job $dot }}
index 66ab4e2..03ffdda 100644 (file)
@@ -39,10 +39,10 @@ global:
   mariadbImage: bitnami/mariadb:10.5.8
   nginxImage: bitnami/nginx:1.21.4
   postgresImage: crunchydata/crunchy-postgres:centos8-13.2-4.6.1
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:5.0.1
   dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
   drProvClientImage: onap/dmaap/datarouter-prov-client:2.1.15
-  quitQuitImage: onap/oom/readiness:4.1.0
+  quitQuitImage: onap/oom/readiness:5.0.1
 
   # Default credentials
   # they're optional. If the target repository doesn't need them, comment them
index 9797696..da37a81 100644 (file)
@@ -19,7 +19,7 @@ global:
   mariadbGalera: &mariadbGalera
     #This flag allows DMAAP-DR to instantiate its own mariadb-galera cluster
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
@@ -93,6 +93,9 @@ readiness:
 mariadb-galera:
   nameOverride: &dbServer dmaap-dr-db
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   db:
     name: &mysqlDbName datarouter
     user: datarouter
index 64cd894..9e1dcdd 100644 (file)
@@ -42,7 +42,7 @@ spec:
         - /app/ready.py
         args:
 {{- if .Values.global.mariadbGalera.localCluster }}
-        - --container-name
+        - --app-name
         - {{ index .Values "mariadb-galera" "nameOverride" }}
 {{- else }}
         - --job-name
index d5814bc..0aef0f5 100644 (file)
@@ -27,7 +27,7 @@ global:
     #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
     globalCluster: true
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
@@ -70,6 +70,10 @@ mariadb-galera:
   disableNfsProvisioner: true
   serviceAccount:
     nameOverride: *modeling-db
+  replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
 
 mariadb-init:
   config:
index 3591d94..a1f6527 100644 (file)
 global:
   nodePortPrefix: 302
   mariadbGalera: &mariadbGalera
-    #This flag allows SO to instantiate its own mariadb-galera cluster
+    #This flag allows NBI to instantiate its own mariadb-galera cluster
     #When changing it to "true", also set "globalCluster: false"
     #as the dependency check will not work otherwise (Chart.yaml)
     localCluster: false
     globalCluster: true
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
   msbEnabled: false
@@ -77,6 +77,9 @@ mariadb-galera:
     internalPort: 3306
   nameOverride: &nbi-galera nbi-galera
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   persistence:
     enabled: true
     mountSubPath: nbi/maria/data
index 1f40bd3..a157414 100755 (executable)
@@ -89,7 +89,7 @@ global:
   postgresImage: crunchydata/crunchy-postgres:centos8-13.2-4.6.1
 
   # readiness check image
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:5.0.1
 
   # image pull policy
   pullPolicy: Always
index c9ee8eb..27d30e0 100755 (executable)
@@ -56,7 +56,7 @@ debugEnabled: false
 
 # application configuration
 db:
-  user: policy_user
+  user: policy-user
   password: policy_user
   service:
     name: policy-mariadb
index 83e4350..34c128e 100644 (file)
@@ -82,7 +82,7 @@ kafkaTopic:
   - name: *acRuntimeTopic
 
 db:
-  user: policy_user
+  user: policy-user
   password: policy_user
   service:
     name: policy-mariadb
index 9ef74e8..d2f1630 100755 (executable)
@@ -101,7 +101,7 @@ nexus:
 
 db:
   name: policy-mariadb
-  user: policy_user
+  user: policy-user
   password: policy_user
 
 pap:
index 22428e7..d52ff88 100755 (executable)
@@ -78,7 +78,7 @@ debugEnabled: false
 # application configuration
 
 db:
-  user: policy_user
+  user: policy-user
   password: policy_user
   service:
     name: policy-mariadb
index d399cd5..4cebf4f 100755 (executable)
@@ -58,7 +58,7 @@ debugEnabled: false
 # application configuration
 
 db:
-  user: policy_user
+  user: policy-user
   password: policy_user
   service:
     name: policy-mariadb
index 36574bc..d793a02 100755 (executable)
 # limitations under the License.
 */}}
 
-mysqlcmd() { mysql  -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; };
+mysqlcmd() { mysql  -h ${MYSQL_HOST} -P ${MYSQL_PORT} "$@"; };
 
+i=5
+RESULT_VARIABLE=0
+echo "Check if user ${MYSQL_USER} is created in DB ${MYSQL_HOST}"
+while [ $i -gt 0 ] && [ "$RESULT_VARIABLE" != 1 ]
+do
+  i=$(( i-1 ))
+  RESULT_VARIABLE="$(mysqlcmd -uroot -p"${MYSQL_ROOT_PASSWORD}" -se "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = '${MYSQL_USER}')")"
+  if [ "$RESULT_VARIABLE" = 1 ]; then
+    echo "User ${MYSQL_USER} exists"
+  else
+    echo "User ${MYSQL_USER} does not exist"
+    sleep 10
+  fi
+done
+if [ "$RESULT_VARIABLE" != 1 ]; then
+  exit 1
+fi
 for db in migration pooling policyadmin policyclamp operationshistory clampacm
 do
+    echo "Create DB ${db}"
     mysqlcmd -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
+    echo "Grand access for user ${MYSQL_USER}"
     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;"
+echo "Flush privileges"
+mysqlcmd -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
index 2503c6f..8161bc1 100755 (executable)
@@ -41,7 +41,7 @@ spec:
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         command:
         - /app/ready.py
-        - --container-name
+        - --app-name
         - {{ index .Values "mariadb-galera" "service" "name" }}
         env:
         - name: NAMESPACE
index 9027e49..b3b4743 100755 (executable)
@@ -212,7 +212,7 @@ config:
 mariadb-galera:
   # mariadb-galera.config and global.mariadb.config must be equals
   db:
-    user: policy_user
+    user: policy-user
     # password:
     externalSecret: *dbSecretName
     name: &mysqlDbName policyadmin
@@ -222,6 +222,9 @@ mariadb-galera:
   # mariadb-galera.service and global.mariadb.service must be equals
   service: *mariadbService
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   persistence:
     enabled: true
     mountSubPath: policy/maria/data
@@ -244,7 +247,7 @@ postgres:
     mountSubPath: policy/postgres/data
     mountInitPath: policy
   config:
-    pgUserName: policy_user
+    pgUserName: policy-user
     pgDatabase: policyadmin
     pgUserExternalSecret: *dbSecretName
     pgRootPasswordExternalSecret: *dbRootPassSecretName
index 61104ed..3738ff4 100644 (file)
@@ -34,7 +34,7 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
+        - --app-name
         {{- if .Values.global.sdc_cassandra.localCluster }}
         - sdc-cs
         {{- else }}
index e5d1c84..ac8103e 100644 (file)
@@ -25,6 +25,14 @@ global:
     #This flag allows SDC to instantiate its own cluster, serviceName
     #should be sdc-cs if this flag is enabled
     localCluster: false
+
+    # in case of a local cassandra cluster
+    # flag to enable the DB creation via k8ssandra-operator
+    useOperator: true
+    # if useOperator set to "true", set "enableServiceAccount to "false"
+    # as the SA is created by the Operator
+    enableServiceAccount: false
+
     #The cassandra service name to connect to (default: shared cassandra service)
     #in case of using k8ssandra-operator in the common cassandra installation
     #the service name is:
@@ -59,7 +67,6 @@ cassandra:
     mountSubPath: sdc/sdc-cs/CS
     enabled: true
   k8ssandraOperator:
-    enabled: false
     config:
       clusterName: sdc-cs
 
index 411dc01..03c5463 100644 (file)
@@ -50,8 +50,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - {{ include "common.mariadbService" . }}
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         - --container-name
         - {{ .Values.config.sdncChartName }}
         - --container-name
index 5741972..db15a7a 100644 (file)
@@ -21,7 +21,7 @@ global:
     #This flag allows SO to instantiate its own mariadb-galera cluster
     #If shared instance is used, this chart assumes that DB already exists
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index 4a48b64..cb778ae 100644 (file)
@@ -21,7 +21,7 @@ global:
     #This flag allows SO to instantiate its own mariadb-galera cluster
     #If shared instance is used, this chart assumes that DB already exists
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index 9956e06..0ca1601 100644 (file)
@@ -53,8 +53,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - {{ include "common.mariadbService" . }}
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         - --container-name
         - {{ .Values.config.sdncChartName }}
         - --container-name
index df559e9..83d0e78 100644 (file)
@@ -21,7 +21,7 @@ global:
     #This flag allows SO to instantiate its own mariadb-galera cluster
     #If shared instance is used, this chart assumes that DB already exists
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index e1d24b1..afe0e72 100755 (executable)
@@ -80,8 +80,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - {{ include "common.mariadbService" . }}
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         env:
         - name: NAMESPACE
           valueFrom:
index 4b2f773..e42757e 100755 (executable)
@@ -28,9 +28,9 @@ spec:
         - /app/ready.py
         args:
         {{- if .Values.config.sdnr.mariadb.enabled }}
-        - --container-name
-        - {{ include "common.mariadbService" . }}
-        {{- else -}}
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
+        {{- else }}
         - --container-name
         - {{.Values.elasticsearch.nameOverride}}-elasticsearch
         - --container-name
@@ -56,7 +56,7 @@ spec:
           - |
             {{- if .Values.config.sdnr.mariadb.enabled }}
             "{{ .Values.config.binDir }}/createSdnrDb.sh";
-            {{- end -}}
+            {{- end }}
             sleep 90; "{{ .Values.config.binDir }}/startODL.sh"
         env:
           - name: SDNC_AAF_ENABLED
@@ -85,12 +85,12 @@ spec:
             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
           - name: SDNRDBPASSWORD
             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
-        {{- else -}}
+          {{- else }}
           - name: SDNRDBURL
             value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
           - name: SDNRDBPARAMETER
             value: "-k"
-        {{- end }}
+          {{- end }}
         {{- if .Values.config.sdnr.mariadb.enabled }}
         volumeMounts:
           - mountPath: {{ .Values.config.binDir }}/createSdnrDb.sh
@@ -140,5 +140,4 @@ spec:
       restartPolicy: Never
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
-
 {{ end -}}
index 20f82e0..4607b62 100644 (file)
@@ -138,8 +138,8 @@ spec:
         - /app/ready.py
         args:
         {{ if .Values.dgbuilder.enabled -}}
-        - --container-name
-        - {{ include "common.mariadbService" . }}
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         - --job-name
         - {{ include "common.fullname" . }}-dbinit-job
         {{ end -}}
@@ -313,7 +313,7 @@ spec:
             value: {{ .Values.config.sdnr.mariadb.asyncHandling | default "false" | quote }}
           - name: SDNR_ASYNC_POOLSIZE
             value: {{ .Values.config.sdnr.mariadb.asyncPoolSize | default 200 | quote }}
-          {{- else -}}
+          {{- else }}
           - name: SDNRDBURL
             value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
           {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
index e35dfde..2c6abdd 100644 (file)
@@ -27,9 +27,9 @@ global:
     #This flag allows SO to instantiate its own mariadb-galera cluster
     #If shared instance is used, this chart assumes that DB already exists
     localCluster: false
-    service: mariadb-galera
+    service: &mariadbService mariadb-galera-primary
     internalPort: 3306
-    nameOverride: mariadb-galera
+    nameOverride: &mariadbName mariadb-galera
 
 
 #################################################################
@@ -323,12 +323,12 @@ config:
     sdnrdbTrustAllCerts: true
     elasticsearch:
     ## for legacy eleasticsearch database
-    # enabled: &esdbenabled true
-      enabled: &esdbenabled false
+      enabled: &esdbenabled true
+      enabled: &esdbenabled false
     mariadb:
       ## for legacy eleasticsearch database
-      enabled: false
-      enabled: true
+      enabled: false
+      enabled: true
       databaseName: sdnrdb
       user: sdnrdb
       externalSecret: *sdnrdbSecretName
@@ -425,6 +425,9 @@ mariadb-galera: &mariadbGalera
     mountSubPath: sdnc/mariadb-galera
     enabled: true
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   serviceAccount:
     nameOverride: *sdnc-db
 
@@ -485,8 +488,8 @@ dgbuilder:
           (include "common.mariadb.secret.rootPassSecretName"
             (dict "dot" . "chartName" "mariadb-galera")) }}'
       userCredentialsExternalSecret: *dbSecretName
-    dbPodName: mariadb-galera
-    dbServiceName: mariadb-galera
+    dbPodName: *mariadbName
+    dbServiceName: *mariadbService
     # This should be revisited and changed to plain text
     dgUserPassword: cc03e747a6afbbcbf8be7668acfebee5
   serviceAccount:
index 5e81fa6..32074d9 100644 (file)
@@ -31,7 +31,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 #################################################################
index 31573af..0d5a0c4 100755 (executable)
@@ -23,7 +23,7 @@ global:
   sdncOamService: sdnc-oam
   sdncOamPort: 8282
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index c9410ca..23a3b69 100755 (executable)
@@ -22,7 +22,7 @@ global:
   app:
     msoKey: 07a7159d3bf51a0e53be7a8f89699be7
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index 4e6adc4..c3388d6 100644 (file)
@@ -19,7 +19,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 #################################################################
index 5d3807e..32171ba 100644 (file)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 #################################################################
index ccdb58c..e2816b0 100755 (executable)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index bf546a2..8533681 100755 (executable)
@@ -22,11 +22,11 @@ global:
   nodePortPrefix: 302
   nodePortPrefixExt: 304
   repository: nexus3.onap.org:10001
-  readinessImage: onap/oom/readiness:4.1.0
+  readinessImage: onap/oom/readiness:5.0.1
   ubuntuInitRepository: docker.io
   mariadbGalera:
     nameOverride: &mariadbName mariadb-galera
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: "3306"
   migration:
     enabled: false
@@ -37,7 +37,8 @@ global:
 
 readinessCheck:
   wait_for:
-    - *mariadbName
+    apps:
+      - *mariadbName
 
 #################################################################
 # Secrets metaconfig
index 636e32c..c6a6f35 100755 (executable)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index 7c5ab23..24a171c 100755 (executable)
@@ -21,7 +21,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 # Secrets metaconfig
index f4a33cb..3258f8f 100755 (executable)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index db6f59a..0ec56c0 100755 (executable)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 readinessCheck:
index 681ff72..eea19df 100755 (executable)
@@ -20,7 +20,7 @@ global:
   persistence:
     mountPath: /dockerdata-nfs
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
   soSdcListenerKafkaUser: so-sdc-list-user
 
index d05213c..1f0a18d 100755 (executable)
@@ -23,7 +23,7 @@ global:
   sdncOamService: sdnc-oam
   sdncOamPort: 8282
   mariadbGalera:
-    serviceName: mariadb-galera
+    service: mariadb-galera-primary
     servicePort: '3306'
 
 #################################################################
index f2db958..bf412e8 100755 (executable)
@@ -22,9 +22,8 @@ global:
   centralizedLoggingEnabled: true
   mariadbGalera:
     nameOverride: mariadb-galera
-    serviceName: mariadb-galera
     servicePort: '3306'
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: '3306'
     # mariadbRootPassword: secretpassword
     # rootPasswordExternalSecret: some secret
@@ -584,6 +583,9 @@ mariadb-galera:
     externalSecret: *dbRootPassSecretName
   nameOverride: &so-mariadb so-mariadb-galera
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
   persistence:
     mountSubPath: so/mariadb-galera/data
     enabled: true
index ebfacf5..b042388 100644 (file)
@@ -41,8 +41,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - '{{ ternary (index .Values "mariadb-galera" "nameOverride") .Values.global.mariadbGalera.service .Values.global.mariadbGalera.localCluster }}'
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         env:
         - name: NAMESPACE
           valueFrom:
index 0cd3ce1..1b0fd7c 100644 (file)
@@ -21,7 +21,7 @@ global:
     ssl_enabled: false
   mariadbGalera:
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index 870541d..ffa834e 100644 (file)
@@ -41,8 +41,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - '{{ ternary (index .Values "mariadb-galera" "nameOverride") .Values.global.mariadbGalera.service .Values.global.mariadbGalera.localCluster }}'
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         env:
         - name: NAMESPACE
           valueFrom:
index fcad261..191a6ee 100644 (file)
@@ -21,7 +21,7 @@ global:
     ssl_enabled: false
   mariadbGalera:
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index a690a9d..23ea79f 100644 (file)
@@ -41,8 +41,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - '{{ ternary (index .Values "mariadb-galera" "nameOverride") .Values.global.mariadbGalera.service .Values.global.mariadbGalera.localCluster }}'
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         env:
         - name: NAMESPACE
           valueFrom:
index 528bbe0..e6f5654 100644 (file)
@@ -21,7 +21,7 @@ global:
     ssl_enabled: false
   mariadbGalera:
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index 7994294..9433e13 100644 (file)
@@ -41,8 +41,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - '{{ ternary (index .Values "mariadb-galera" "nameOverride") .Values.global.mariadbGalera.service .Values.global.mariadbGalera.localCluster }}'
+        - --app-name
+        - {{ include "common.mariadbAppName" . }}
         env:
         - name: NAMESPACE
           valueFrom:
index c2954d5..4850c96 100644 (file)
@@ -21,7 +21,7 @@ global:
     ssl_enabled: false
   mariadbGalera:
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
 
index a0b69e0..6fa6691 100644 (file)
@@ -32,7 +32,7 @@ global:
   mariadbGalera: &mariadbGalera
     #This flag allows VFC to instantiate its own mariadb-galera cluster
     localCluster: false
-    service: mariadb-galera
+    service: mariadb-galera-primary
     internalPort: 3306
     nameOverride: mariadb-galera
   centralizedLoggingEnabled: true
@@ -67,6 +67,9 @@ mariadb-galera: &localMariadb
   serviceAccount:
     nameOverride: *dbServer
   replicaCount: 1
+  mariadbOperator:
+    galera:
+      enabled: false
 
 vfc-generic-vnfm-driver:
   enabled: true