X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fcommon%2Ftemplates%2F_mariadb.tpl;h=7492f71f0ab75f8cd7e9a671e8b194e09a15cf78;hb=72caf09f07b4530e1bb34be348c4b845c9d0bfde;hp=5e0aed587c7723e5387701d69d07f959e7128602;hpb=7a24e5fedfafeab43c80403759507960abb3c2b0;p=oom.git diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl index 5e0aed587c..7492f71f0a 100644 --- a/kubernetes/common/common/templates/_mariadb.tpl +++ b/kubernetes/common/common/templates/_mariadb.tpl @@ -74,9 +74,17 @@ */}} {{- define "common.mariadbService" -}} {{- if .Values.global.mariadbGalera.localCluster -}} + {{- if .Values.global.mariadbGalera.useOperator }} + {{- printf "%s-primary" (index .Values "mariadb-galera" "nameOverride") -}} + {{- else }} {{- index .Values "mariadb-galera" "nameOverride" -}} + {{- end }} {{- else -}} + {{- if .Values.global.mariadbGalera.useOperator }} + {{- printf "%s-primary" (.Values.global.mariadbGalera.service) -}} + {{- else }} {{- .Values.global.mariadbGalera.service -}} + {{- end }} {{- end -}} {{- end -}} @@ -120,8 +128,9 @@ apiVersion: mariadb.mmontes.io/v1alpha1 kind: Database metadata: - name: {{ $dbname }} + name: {{ $dbinst }}-{{ $dbname }} spec: + name: {{ $dbname }} mariaDbRef: name: {{ $dbinst }} characterSet: utf8 @@ -141,10 +150,9 @@ spec: apiVersion: mariadb.mmontes.io/v1alpha1 kind: User metadata: - name: {{ $dbuser }} + name: {{ $dbinst }}-{{ $dbuser }} spec: - # If you want the user to be created with a different name than the resource name - # name: user-custom + name: {{ $dbuser }} mariaDbRef: name: {{ $dbinst }} passwordSecretKeyRef: @@ -265,14 +273,17 @@ spec: gracefulShutdownTimeout: 5s recovery: enabled: true - clusterHealthyTimeout: 5m - clusterBootstrapTimeout: 10m - podRecoveryTimeout: 5m - podSyncTimeout: 10m + clusterHealthyTimeout: 5m0s + clusterBootstrapTimeout: 10m0s + podRecoveryTimeout: 5m0s + podSyncTimeout: 10m0s initContainer: image: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ $dot.Values.mariadbOperator.galera.initImage }}:{{ $dot.Values.mariadbOperator.galera.initVersion }} imagePullPolicy: IfNotPresent volumeClaimTemplate: + {{- if .Values.mariadbOperator.storageClassName }} + storageClassName: {{ .Values.mariadbOperator.storageClassName }} + {{- end }} resources: requests: storage: 50Mi