From d518f733756ef9d9b1b7015d509906152d6a1288 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Mon, 25 Mar 2024 11:15:11 +0100 Subject: [COMMON][READINESS] Update readiness image and use service feature Update the ReadinessCheck (13.1.0) to support the "services" feature of readiness image version 6.0.2 and use the feature in the charts under common (dgbuilder, etcd-init, mariadb-galera, mariadb-init, postgres-init) Additional exclude K8S API port (443) from Istio Sidecar communication to allow CNI Plugin Issue-ID: OOM-3280 Change-Id: Ibe030aa9debfc82e88f2ce5e309dd6fa2250f211 Signed-off-by: Andreas Geissler --- kubernetes/common/mariadb-init/templates/job.yaml | 21 +++++++-------------- kubernetes/common/mariadb-init/tests/job_test.yaml | 2 +- kubernetes/common/mariadb-init/values.yaml | 15 +++------------ 3 files changed, 11 insertions(+), 27 deletions(-) (limited to 'kubernetes/common/mariadb-init') diff --git a/kubernetes/common/mariadb-init/templates/job.yaml b/kubernetes/common/mariadb-init/templates/job.yaml index 0180fecf0e..2495e602f3 100644 --- a/kubernetes/common/mariadb-init/templates/job.yaml +++ b/kubernetes/common/mariadb-init/templates/job.yaml @@ -31,25 +31,18 @@ spec: backoffLimit: 20 template: metadata: + annotations: + # Workarround to exclude K8S API from istio communication + # as init-container (readinessCheck) does not work with the + # Istio CNI plugin, see: + # (https://istio.io/latest/docs/setup/additional-setup/cni/#compatibility-with-application-init-containers) + traffic.sidecar.istio.io/excludeOutboundPorts: "443" labels: app: {{ include "common.name" . }} release: {{ include "common.release" . }} name: {{ include "common.name" . }} spec: - initContainers: - {{- 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 }} + initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }} containers: - name: {{ include "common.name" . }} image: {{ include "repositoryGenerator.image.mariadb" . }} diff --git a/kubernetes/common/mariadb-init/tests/job_test.yaml b/kubernetes/common/mariadb-init/tests/job_test.yaml index 170eaf3c96..31e04f0e2c 100644 --- a/kubernetes/common/mariadb-init/tests/job_test.yaml +++ b/kubernetes/common/mariadb-init/tests/job_test.yaml @@ -36,7 +36,7 @@ tests: content: mariadb-galera - equal: path: spec.template.spec.initContainers[0].image - value: nexus3.onap.org:10001/onap/oom/readiness:3.0.1 + value: nexus3.onap.org:10001/onap/oom/readiness:6.0.2 - equal: path: spec.template.spec.initContainers[0].imagePullPolicy value: IfNotPresent diff --git a/kubernetes/common/mariadb-init/values.yaml b/kubernetes/common/mariadb-init/values.yaml index 5c181dded2..57dfb400c4 100644 --- a/kubernetes/common/mariadb-init/values.yaml +++ b/kubernetes/common/mariadb-init/values.yaml @@ -150,15 +150,6 @@ wait_for_job_container: - '{{ 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" . }}' + wait_for: + services: + - '{{ include "common.mariadbService" . }}' -- cgit 1.2.3-korg