aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/so/components
diff options
context:
space:
mode:
authorAndreas Geissler <andreas-geissler@telekom.de>2024-03-11 17:26:53 +0100
committerAndreas Geissler <andreas-geissler@telekom.de>2024-03-11 17:31:04 +0100
commit060bc378e32c2ffba34f890c53cc359eb9ee64d0 (patch)
tree8bb7de0ab8445dc7fbbc8831f2ad6a09e9c83381 /kubernetes/so/components
parent9964927d8766c5c396ef2caf6f7aeb7494db279e (diff)
[COMMON] Update MariaDB readinessChecks to fix Operator issues
Give different readinessCheck rules depending on the usage of mariaDB Operator and local/global DB setup Apply these changes to CDS, NBI, SO, SDNC, Policy Issue-ID: OOM-3280 Change-Id: I4e6f584558ffebb6ab602db88a73c2f02891902e Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Diffstat (limited to 'kubernetes/so/components')
-rwxr-xr-xkubernetes/so/components/so-mariadb/Chart.yaml3
-rw-r--r--kubernetes/so/components/so-mariadb/templates/job.yaml34
-rwxr-xr-xkubernetes/so/components/so-mariadb/values.yaml14
3 files changed, 30 insertions, 21 deletions
diff --git a/kubernetes/so/components/so-mariadb/Chart.yaml b/kubernetes/so/components/so-mariadb/Chart.yaml
index cb82906ad1..f66f740b34 100755
--- a/kubernetes/so/components/so-mariadb/Chart.yaml
+++ b/kubernetes/so/components/so-mariadb/Chart.yaml
@@ -28,6 +28,9 @@ dependencies:
- name: repositoryGenerator
version: ~13.x-0
repository: '@local'
+ - name: readinessCheck
+ version: ~13.x-0
+ repository: '@local'
- name: serviceAccount
version: ~13.x-0
repository: '@local'
diff --git a/kubernetes/so/components/so-mariadb/templates/job.yaml b/kubernetes/so/components/so-mariadb/templates/job.yaml
index abbe5997ee..a2edf33272 100644
--- a/kubernetes/so/components/so-mariadb/templates/job.yaml
+++ b/kubernetes/so/components/so-mariadb/templates/job.yaml
@@ -102,27 +102,19 @@ spec:
name: {{ include "common.name" . }}
spec:
initContainers:
- - name: {{ include "common.name" . }}-readiness
- command:
- - /app/ready.py
- args:
- - --app-name
- - {{ include "common.mariadbAppName" . }}
- env:
- - name: NAMESPACE
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: metadata.namespace
- image: {{ include "repositoryGenerator.image.readiness" . }}
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
- resources:
- limits:
- cpu: "100m"
- memory: "0.5Gi"
- requests:
- cpu: "3m"
- memory: "0.02Gi"
+ {{- if .Values.global.mariadbGalera.localCluster }}
+ {{- if .Values.global.mariadbGalera.useOperator }}
+ {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local_operator ) | indent 6 | trim }}
+ {{ else }}
+ {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
+ {{- end }}
+ {{ else }}
+ {{- if .Values.global.mariadbGalera.useOperator }}
+ {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global_operator ) | indent 6 | trim }}
+ {{ else }}
+ {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
+ {{- end }}
+ {{- end }}
containers:
- name: {{ include "common.name" . }}-config
image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
diff --git a/kubernetes/so/components/so-mariadb/values.yaml b/kubernetes/so/components/so-mariadb/values.yaml
index 38b4d3fe04..6fdfd75dde 100755
--- a/kubernetes/so/components/so-mariadb/values.yaml
+++ b/kubernetes/so/components/so-mariadb/values.yaml
@@ -207,3 +207,17 @@ serviceAccount:
wait_for_job_container:
containers:
- '{{ include "common.name" . }}-config'
+
+readinessCheck:
+ wait_for_global_operator:
+ pods:
+ - '{{ .Values.global.mariadbGalera.nameOverride }}-0'
+ wait_for_local_operator:
+ pods:
+ - '{{ index .Values "mariadb-galera" "nameOverride" }}-0'
+ wait_for_global:
+ apps:
+ - '{{ include "common.mariadbAppName" . }}'
+ wait_for_local:
+ apps:
+ - '{{ include "common.mariadbAppName" . }}'