aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-03-14 12:07:38 +0000
committerGerrit Code Review <gerrit@onap.org>2024-03-14 12:07:38 +0000
commit9468364310a767b4d68f35a94f15e79ff38c5908 (patch)
treefd032da8e2a7ba40786f50634d3af47f857020ba /kubernetes/common
parentfa01ec554cfa10cb1f9ec8be0c5530dd3f3ea50a (diff)
parent060bc378e32c2ffba34f890c53cc359eb9ee64d0 (diff)
Merge "[COMMON] Update MariaDB readinessChecks to fix Operator issues"
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/mariadb-init/Chart.yaml5
-rw-r--r--kubernetes/common/mariadb-init/templates/job.yaml34
-rw-r--r--kubernetes/common/mariadb-init/values.yaml14
3 files changed, 31 insertions, 22 deletions
diff --git a/kubernetes/common/mariadb-init/Chart.yaml b/kubernetes/common/mariadb-init/Chart.yaml
index fe134578df..fa89a669d2 100644
--- a/kubernetes/common/mariadb-init/Chart.yaml
+++ b/kubernetes/common/mariadb-init/Chart.yaml
@@ -28,4 +28,7 @@ dependencies:
repository: 'file://../repositoryGenerator'
- name: serviceAccount
version: ~13.x-0
- repository: '@local' \ No newline at end of file
+ repository: '@local'
+ - name: readinessCheck
+ version: ~13.x-0
+ repository: '@local'
diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml
index 288ea8e02e..0180fecf0e 100644
--- a/kubernetes/common/mariadb-init/templates/job.yaml
+++ b/kubernetes/common/mariadb-init/templates/job.yaml
@@ -37,27 +37,19 @@ spec:
name: {{ include "common.name" . }}
spec:
initContainers:
- - name: {{ include "common.name" . }}-readiness
- command:
- - /app/ready.py
- args:
- - --app-name
- - {{ default .Values.global.mariadbGalera.nameOverride .Values.mariadbGalera.containerName }}
- 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" . }}
image: {{ include "repositoryGenerator.image.mariadb" . }}
diff --git a/kubernetes/common/mariadb-init/values.yaml b/kubernetes/common/mariadb-init/values.yaml
index 9a4b4b369b..e0ba28266a 100644
--- a/kubernetes/common/mariadb-init/values.yaml
+++ b/kubernetes/common/mariadb-init/values.yaml
@@ -148,3 +148,17 @@ serviceAccount:
wait_for_job_container:
containers:
- '{{ include "common.name" . }}'
+
+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" . }}'