[MARIADB] Update mariadb template to the 0.21.0 Operator

In the mariadb-operator version 0.21.0 changes to the CRDs
have been done, which require a change in the template.
see: https://github.com/mariadb-operator/mariadb-operator/pull/248
PeerAuthentication depends on galera setting (not know why)

Issue-ID: OOM-3236

Change-Id: Iaf3cd7128e4c9889c1d56b9b83a72a352e60a39d
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl
index 7e127e2..5e0aed5 100644
--- a/kubernetes/common/common/templates/_mariadb.tpl
+++ b/kubernetes/common/common/templates/_mariadb.tpl
@@ -126,6 +126,7 @@
     name: {{ $dbinst }}
   characterSet: utf8
   collate: utf8_general_ci
+  retryInterval: 5s
 {{- end -}}
 
 {{/*
@@ -151,6 +152,7 @@
     key: password
   # This field is immutable and defaults to 10
   maxUserConnections: 100
+  retryInterval: 5s
 {{- end -}}
 
 {{/*
@@ -174,6 +176,7 @@
   database: {{ $dbname }}
   table: "*"
   username: {{ $dbuser }}
+  retryInterval: 5s
   grantOption: true
 {{- end -}}
 
@@ -241,27 +244,20 @@
   rootPasswordSecretKeyRef:
     name: {{ $dbrootsecret }}
     key: password
-  image:
-    repository: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadbOperator.image }}
-    tag: {{ $dot.Values.mariadbOperator.appVersion }}
-    pullPolicy: IfNotPresent
+  image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadbOperator.image }}:{{ $dot.Values.mariadbOperator.appVersion }}
+  imagePullPolicy: IfNotPresent
   imagePullSecrets:
     - name: {{ include "common.namespace" . }}-docker-registry-key
   port: 3306
   replicas: {{ $dot.Values.replicaCount }}
+  {{- if $dot.Values.mariadbOperator.galera.enabled }}
   galera:
-    {{- if eq (int $dot.Values.replicaCount) 1 }}
-    enabled: false
-    {{- else }}
-    enabled: {{ $dot.Values.mariadbOperator.galera.enabled }}
-    {{- end }}
+    enabled: true
     sst: mariabackup
     replicaThreads: 1
     agent:
-      image:
-        repository: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ .Values.mariadbOperator.galera.agentImage }}
-        tag: {{ $dot.Values.mariadbOperator.galera.agentVersion }}
-        pullPolicy: IfNotPresent
+      image: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ .Values.mariadbOperator.galera.agentImage }}:{{ $dot.Values.mariadbOperator.galera.agentVersion }}
+      imagePullPolicy: IfNotPresent
       port: 5555
       kubernetesAuth:
         enabled: true
@@ -274,16 +270,15 @@
       podRecoveryTimeout: 5m
       podSyncTimeout: 10m
     initContainer:
-      image:
-        repository: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ $dot.Values.mariadbOperator.galera.initImage }}
-        tag: {{ $dot.Values.mariadbOperator.galera.initVersion }}
-        pullPolicy: IfNotPresent
+      image: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ $dot.Values.mariadbOperator.galera.initImage }}:{{ $dot.Values.mariadbOperator.galera.initVersion }}
+      imagePullPolicy: IfNotPresent
     volumeClaimTemplate:
       resources:
         requests:
           storage: 50Mi
       accessModes:
         - ReadWriteOnce
+  {{- end }}
   livenessProbe:
     exec:
       command:
@@ -334,11 +329,11 @@
   resources: {{ include "common.resources" . | nindent 4 }}
   volumeClaimTemplate:
     {{- if $dot.Values.mariadbOperator.storageClassName }}
-    storageClassName: {{ $dot.Values.k8ssandraOperator.persistence.storageClassName }}
+    storageClassName: {{ $dot.Values.mariadbOperator.storageClassName }}
     {{- end }}
     resources:
       requests:
-        storage: {{ $dot.Values.persistence.size | quote }}
+        storage: {{ $dot.Values.mariadbOperator.persistence.size | quote }}
     accessModes:
       - ReadWriteOnce
 {{-  if $dot.Values.db.user }}
diff --git a/kubernetes/common/mariadb-galera/templates/service.yaml b/kubernetes/common/mariadb-galera/templates/service.yaml
index 2dea4e9..e1a9105 100644
--- a/kubernetes/common/mariadb-galera/templates/service.yaml
+++ b/kubernetes/common/mariadb-galera/templates/service.yaml
@@ -34,6 +34,10 @@
       app: {{ include "common.servicename" . }}
   portLevelMtls:
     '{{ .Values.service.internalPort }}':
+{{-     if .Values.mariadbOperator.galera.enabled }}
       mode: STRICT
+{{-     else }}
+      mode: DISABLE
+{{-     end }}
 {{-   end }}
 {{- end }}
diff --git a/kubernetes/common/mariadb-galera/values.yaml b/kubernetes/common/mariadb-galera/values.yaml
index a749c09..1ad72e2 100644
--- a/kubernetes/common/mariadb-galera/values.yaml
+++ b/kubernetes/common/mariadb-galera/values.yaml
@@ -57,12 +57,15 @@
 mariadbOperator:
   image: mariadb
   appVersion: 11.1.2
+  persistence:
+    #storageClassName: default
+    size: 3Gi
   galera:
     enabled: true
     agentImage: mariadb-operator/agent
-    agentVersion: v0.0.2
+    agentVersion: v0.0.3
     initImage: mariadb-operator/init
-    initVersion: v0.0.5
+    initVersion: v0.0.6
 
 ## String to partially override common.names.fullname template (will maintain the release name)
 ##