From 7a24e5fedfafeab43c80403759507960abb3c2b0 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Thu, 12 Oct 2023 10:16:29 +0200 Subject: [PATCH] [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 --- .../infra_guides/oom_infra_base_config_setup.rst | 10 +++---- .../oom_infra_deployment_requirements.rst | 10 +++---- .../infra_guides/oom_infra_optional_addons.rst | 7 +++-- kubernetes/common/common/templates/_mariadb.tpl | 33 +++++++++------------- .../common/mariadb-galera/templates/service.yaml | 4 +++ kubernetes/common/mariadb-galera/values.yaml | 7 +++-- 6 files changed, 38 insertions(+), 33 deletions(-) diff --git a/docs/sections/guides/infra_guides/oom_infra_base_config_setup.rst b/docs/sections/guides/infra_guides/oom_infra_base_config_setup.rst index e84f578c01..8f74ea987e 100644 --- a/docs/sections/guides/infra_guides/oom_infra_base_config_setup.rst +++ b/docs/sections/guides/infra_guides/oom_infra_base_config_setup.rst @@ -123,7 +123,7 @@ Set the default StorageClass In some ONAP components it is important to have a default storageClass defined (e.g. cassandra), if you don't want to explicitly set it during the deployment via helm overrides. -Therefor you should set the default storageClass (if not done during the K8S cluster setup) via the command: +Therefor you should set the default storageClass (if not done during the K8S cluster setup) via the command:: > kubectl patch storageclass -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' @@ -338,7 +338,7 @@ Gateway-API Keycloak Installation --------------------- -- Add helm repositories +- Add helm repositories:: > helm repo add bitnami https://charts.bitnami.com/bitnami @@ -346,7 +346,7 @@ Keycloak Installation > helm repo update -- create keycloak namespace +- create keycloak namespace:: > kubectl create namespace keycloak > kubectl label namespace keycloak istio-injection=enabled @@ -362,7 +362,7 @@ Install Keycloak-Database .. include:: ../../resources/yaml/keycloak-db-values.yaml :code: yaml -- Install the Postgres DB +- Install the Postgres DB:: > helm -n keycloak upgrade -i keycloak-db bitnami/postgresql --values ./keycloak-db-values.yaml @@ -377,7 +377,7 @@ Configure Keycloak .. include:: ../../resources/yaml/keycloak-server-values.yaml :code: yaml -- Install keycloak +- Install keycloak:: > helm -n keycloak upgrade -i keycloak codecentric/keycloak --values ./keycloak-server-values.yaml diff --git a/docs/sections/guides/infra_guides/oom_infra_deployment_requirements.rst b/docs/sections/guides/infra_guides/oom_infra_deployment_requirements.rst index e21c4b68c8..e46bee1c04 100644 --- a/docs/sections/guides/infra_guides/oom_infra_deployment_requirements.rst +++ b/docs/sections/guides/infra_guides/oom_infra_deployment_requirements.rst @@ -64,10 +64,10 @@ The versions of software that are supported by OOM are as follows: .. table:: OOM Software Requirements (optional) - ============== ================= ========== - Release Prometheus Stack K8ssandra - ============== ================= ========== + ============== ================= ========== ================= + Release Prometheus Stack K8ssandra MariaDB-Operator + ============== ================= ========== ================= Kohn 35.x London 45.x 1.6.1 - Montreal 45.x 1.8.0 - ============== ================= ========== + Montreal 45.x 1.9.1 0.21.0 + ============== ================= ========== ================= diff --git a/docs/sections/guides/infra_guides/oom_infra_optional_addons.rst b/docs/sections/guides/infra_guides/oom_infra_optional_addons.rst index 71ce344f09..de26d11944 100644 --- a/docs/sections/guides/infra_guides/oom_infra_optional_addons.rst +++ b/docs/sections/guides/infra_guides/oom_infra_optional_addons.rst @@ -112,7 +112,7 @@ For setup the K8ssandra operator is used, see `K8ssandra setup guide`_ > kubectl label namespace k8ssandra-operator istio-injection=enabled -- Install the k8ssandra-operator:: +- Install the k8ssandra-operator replacing the with the version defined in the :ref:`versions_table` table:: > helm repo add k8ssandra https://helm.k8ssandra.io/stable @@ -120,6 +120,7 @@ For setup the K8ssandra operator is used, see `K8ssandra setup guide`_ > helm install k8ssandra-operator --namespace k8ssandra-operator k8ssandra/k8ssandra-operator --set global.clusterScoped=true + --version= Mariadb-Operator Installation ----------------------------- @@ -135,7 +136,7 @@ For setup the Mariadb-Operator is used, see `Mariadb-Operator setup guide`_ > kubectl label namespace mariadb-operator istio-injection=enabled -- Install the mariadb-operator:: +- Install the mariadb-operator replacing the with the version defined in the :ref:`versions_table` table:::: > helm repo add mariadb-operator https://mariadb-operator.github.io/mariadb-operator @@ -143,6 +144,8 @@ For setup the Mariadb-Operator is used, see `Mariadb-Operator setup guide`_ > helm install mariadb-operator --namespace mariadb-operator mariadb-operator/mariadb-operator --set ha.enabled=true + --set metrics.enabled=true --set webhook.certificate.certManager=true + --version= Kserve Installation diff --git a/kubernetes/common/common/templates/_mariadb.tpl b/kubernetes/common/common/templates/_mariadb.tpl index 7e127e2437..5e0aed587c 100644 --- a/kubernetes/common/common/templates/_mariadb.tpl +++ b/kubernetes/common/common/templates/_mariadb.tpl @@ -126,6 +126,7 @@ spec: name: {{ $dbinst }} characterSet: utf8 collate: utf8_general_ci + retryInterval: 5s {{- end -}} {{/* @@ -151,6 +152,7 @@ spec: key: password # This field is immutable and defaults to 10 maxUserConnections: 100 + retryInterval: 5s {{- end -}} {{/* @@ -174,6 +176,7 @@ spec: database: {{ $dbname }} table: "*" username: {{ $dbuser }} + retryInterval: 5s grantOption: true {{- end -}} @@ -241,27 +244,20 @@ spec: 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 @@ spec: 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 @@ spec: 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 2dea4e9ac1..e1a910557f 100644 --- a/kubernetes/common/mariadb-galera/templates/service.yaml +++ b/kubernetes/common/mariadb-galera/templates/service.yaml @@ -34,6 +34,10 @@ spec: 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 a749c0959c..1ad72e2956 100644 --- a/kubernetes/common/mariadb-galera/values.yaml +++ b/kubernetes/common/mariadb-galera/values.yaml @@ -57,12 +57,15 @@ secrets: 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) ## -- 2.16.6