[COMMON][READINESS] Update readiness image and use service feature 73/137573/6
authorAndreas Geissler <andreas-geissler@telekom.de>
Mon, 25 Mar 2024 10:15:11 +0000 (11:15 +0100)
committerAndreas Geissler <andreas-geissler@telekom.de>
Wed, 27 Mar 2024 15:24:43 +0000 (16:24 +0100)
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 <andreas-geissler@telekom.de>
23 files changed:
docs/sections/resources/yaml/environments_onap_demo.yaml
kubernetes/aai/values.yaml
kubernetes/common/dgbuilder/templates/deployment.yaml
kubernetes/common/dgbuilder/values.yaml
kubernetes/common/etcd-init/templates/job.yaml
kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml
kubernetes/common/mariadb-galera/values.yaml
kubernetes/common/mariadb-init/templates/job.yaml
kubernetes/common/mariadb-init/tests/job_test.yaml
kubernetes/common/mariadb-init/values.yaml
kubernetes/common/network-name-gen/values.yaml
kubernetes/common/postgres-init/templates/job.yaml
kubernetes/common/postgres-init/values.yaml
kubernetes/common/readinessCheck/Chart.yaml
kubernetes/common/readinessCheck/templates/_readinessCheck.tpl
kubernetes/common/repositoryGenerator/values.yaml
kubernetes/onap/resources/environments/dev.yaml
kubernetes/onap/resources/overrides/onap-5g-network-slicing.yaml
kubernetes/onap/values.yaml
kubernetes/platform/components/cmpv2-cert-provider/values.yaml
kubernetes/sdc/components/sdc-cs/values.yaml
kubernetes/so/components/so-admin-cockpit/values.yaml
kubernetes/so/components/so-mariadb/values.yaml

index 492e5d2..acc395d 100644 (file)
@@ -13,7 +13,7 @@ global:
   repository: nexus3.onap.org:10001
   repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ==
   # readiness check
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   # logging agent
   loggingRepository: docker.elastic.co
 
index 395d8d6..a24805b 100644 (file)
@@ -25,7 +25,7 @@ global: # global defaults
   dockerhubRepository: docker.io
   busyboxImage: busybox
 
-  readinessImage: onap/oom/readiness:5.0.1
+  readinessImage: onap/oom/readiness:6.0.2
 
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
index 5d3038b..6ece89d 100644 (file)
@@ -61,8 +61,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --app-name
-        - {{ .Values.config.dbPodName }}
+        - --service-name
+        - {{ .Values.config.dbServiceName }}
         env:
         - name: NAMESPACE
           valueFrom:
index c4dcb2f..68cb86b 100644 (file)
@@ -166,6 +166,13 @@ resources:
       memory: "4Gi"
   unlimited: {}
 
+podAnnotations:
+  # 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"
+
 #Pods Service Account
 serviceAccount:
   nameOverride: dgbuilder
index f1f1b0e..55526a3 100644 (file)
@@ -27,6 +27,12 @@ spec:
   backoffLimit: {{ .Values.backoffLimit }}
   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" . }}
@@ -37,8 +43,8 @@ spec:
         command:
         - /app/ready.py
         args:
-        - --container-name
-        - {{ .Values.etcd.containerName }}
+        - --service-name
+        - {{ .Values.etcd.serviceName }}
         env:
         - name: NAMESPACE
           valueFrom:
index 4548626..1a174d1 100644 (file)
@@ -32,6 +32,13 @@ spec:
   jobTemplate:
     spec:
       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"
         spec:
           serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
           {{ include "common.podSecurityContext" . | indent 10 | trim}}
index 29d643e..9a27e60 100644 (file)
@@ -329,8 +329,8 @@ backup:
 
 readinessCheck:
   wait_for:
-    apps:
-      - '{{ include "common.name" . }}'
+    services:
+      - '{{ include "common.servicename" . }}'
 
 ## TLS configuration
 ##
index 0180fec..2495e60 100644 (file)
@@ -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" . }}
index 170eaf3..31e04f0 100644 (file)
@@ -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
index 5c181dd..57dfb40 100644 (file)
@@ -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" . }}'
index e028e39..0b62705 100644 (file)
@@ -142,6 +142,13 @@ ingress:
 
 resources: {}
 
+podAnnotations:
+  # 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"
+
 #Pods Service Account
 serviceAccount:
   nameOverride: network-name-gen
index 7fa2e9f..b62bef8 100644 (file)
@@ -28,6 +28,12 @@ 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" . }}
index d2eb090..160e672 100644 (file)
@@ -19,6 +19,7 @@ global:
   postgres:
     service:
       name: pgset
+      name2: tcp-pgset-primary
     container:
       name: postgres
 
@@ -98,7 +99,8 @@ serviceAccount:
 
 readinessCheck:
   wait_for:
-    - '{{ .Values.global.postgres.container.name }}'
+    services:
+    - '{{ .Values.global.postgres.service.name2 }}'
 
 wait_for_job_container:
   containers:
index a53c7ab..bb2986a 100644 (file)
@@ -17,7 +17,7 @@
 apiVersion: v2
 description: Template used to wait for other deployment/sts/jobs in onap
 name: readinessCheck
-version: 13.0.0
+version: 13.1.0
 
 dependencies:
   - name: common
index 879be12..51791fe 100644 (file)
     pods:
       - test-pod
 
+  the powerful one allows also to wait for a service to be
+  available, which means all pods are deployed, which are
+  selected by the service definition:
+  wait_for:
+    name: myservice
+    services:
+      - mariadb-galera-service
+
   the powerful one allows also to wait for pods with the
   given "app" label:
   wait_for:
@@ -62,8 +70,8 @@
      - .dot : environment (.)
      - .initRoot : the root dictionary of readinessCheck submodule
                    (default to .Values.readinessCheck)
-     - .wait_for : list of containers / pods /apps / jobs to wait for (default to
-                   .Values.wait_for)
+     - .wait_for : list of service / containers / pods /apps / jobs to wait for
+                   (default to .Values.wait_for)
 
   Example calls:
     {{ include "common.readinessCheck.waitFor" . }}
@@ -76,6 +84,7 @@
 {{-   $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }}
 {{-   $wait_for := default $initRoot.wait_for .wait_for -}}
 {{-   $containers := index (ternary (dict "containers" $wait_for) $wait_for (kindIs "slice" $wait_for)) "containers" -}}
+{{-   $services := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "services" -}}
 {{-   $pods := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "pods" -}}
 {{-   $apps := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "apps" -}}
 {{-   $namePart := index (ternary (dict) $wait_for (kindIs "slice" $wait_for)) "name" -}}
   - --pod-name
   - {{ tpl $pod $dot }}
   {{- end }}
+  {{- range $service := default (list) $services }}
+  - --service-name
+  - {{ tpl $service $dot }}
+  {{- end }}
   {{- range $app := default (list) $apps }}
   - --app-name
   - {{ tpl $app $dot }}
index 03ffdda..3b1acd9 100644 (file)
@@ -39,10 +39,10 @@ global:
   mariadbImage: bitnami/mariadb:10.5.8
   nginxImage: bitnami/nginx:1.21.4
   postgresImage: crunchydata/crunchy-postgres:centos8-13.2-4.6.1
-  readinessImage: onap/oom/readiness:5.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
   drProvClientImage: onap/dmaap/datarouter-prov-client:2.1.15
-  quitQuitImage: onap/oom/readiness:5.0.1
+  quitQuitImage: onap/oom/readiness:6.0.2
 
   # Default credentials
   # they're optional. If the target repository doesn't need them, comment them
index c2b4403..e0ceea6 100644 (file)
@@ -32,7 +32,7 @@ global:
   #repository: nexus3.onap.org:10001
 
   # readiness check
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
 
   # logging agent - temporary repo until images migrated to nexus3
   loggingRepository: docker.elastic.co
index a51106f..0a4a2f8 100644 (file)
@@ -35,7 +35,7 @@ global:
     password: docker
 
   # readiness check
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
 
   # logging agent - temporary repo until images migrated to nexus3
   loggingRepository: docker.elastic.co
index 7f55837..75c2dac 100755 (executable)
@@ -89,7 +89,7 @@ global:
   postgresImage: crunchydata/crunchy-postgres:centos8-13.2-4.6.1
 
   # readiness check image
-  readinessImage: onap/oom/readiness:5.0.1
+  readinessImage: onap/oom/readiness:6.0.2
 
   # image pull policy
   pullPolicy: Always
index b038b52..94416b4 100644 (file)
@@ -15,7 +15,7 @@
 # Global
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
   busyboxRepository: registry.hub.docker.com
index 2c896ea..f6317b7 100644 (file)
@@ -18,7 +18,7 @@
 #################################################################
 global:
   nodePortPrefix: 302
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
   sdc_cassandra:
index c10b509..2ec3d2e 100644 (file)
@@ -26,7 +26,7 @@ global:
   nodePortPrefix: 302
   nodePortPrefixExt: 304
   repository: nexus3.onap.org:10001
-  readinessImage: onap/oom/readiness:3.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   envsubstImage: dibi/envsubst
   persistence:
     mountPath: /dockerdata-nfs
index 6fdfd75..39d5e08 100755 (executable)
@@ -22,7 +22,7 @@ global:
   nodePortPrefix: 302
   nodePortPrefixExt: 304
   repository: nexus3.onap.org:10001
-  readinessImage: onap/oom/readiness:5.0.1
+  readinessImage: onap/oom/readiness:6.0.2
   ubuntuInitRepository: docker.io
   mariadbGalera:
     # flag to enable the DB creation via mariadb-operator