Merge "[COMMON][READINESS] Update readiness image and use service feature"
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Wed, 3 Apr 2024 14:12:59 +0000 (14:12 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 3 Apr 2024 14:12:59 +0000 (14:12 +0000)
1  2 
kubernetes/common/dgbuilder/templates/deployment.yaml
kubernetes/common/etcd-init/templates/job.yaml
kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml
kubernetes/common/mariadb-init/templates/job.yaml
kubernetes/common/postgres-init/templates/job.yaml
kubernetes/onap/values.yaml

@@@ -61,8 -61,8 +61,8 @@@ spec
        - command:
          - /app/ready.py
          args:
-         - --app-name
-         - {{ .Values.config.dbPodName }}
+         - --service-name
+         - {{ .Values.config.dbServiceName }}
          env:
          - name: NAMESPACE
            valueFrom:
          - name: config
            emptyDir:
              medium: Memory
 -      imagePullSecrets:
 -      - name: "{{ include "common.namespace" . }}-docker-registry-key"
 +      {{- include "common.imagePullSecrets" . | nindent 6 }}
@@@ -27,6 -27,12 +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 +43,8 @@@
          command:
          - /app/ready.py
          args:
-         - --container-name
-         - {{ .Values.etcd.containerName }}
+         - --service-name
+         - {{ .Values.etcd.serviceName }}
          env:
          - name: NAMESPACE
            valueFrom:
          hostPath:
            path: /etc/localtime
        restartPolicy: Never
 -      imagePullSecrets:
 -      - name: "{{ include "common.namespace" . }}-docker-registry-key"
 +      {{- include "common.imagePullSecrets" . | nindent 6 }}
@@@ -32,6 -32,13 +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}}
                    readOnly: true
                  - name: backup-dir
                    mountPath: /backup
 -          imagePullSecrets:
 -            - name: {{ include "common.namespace" . }}-docker-registry-key
 +          {{- include "common.imagePullSecrets" . | nindent 10 }}
            volumes:
              - name: localtime
                hostPath:
@@@ -31,25 -31,18 +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" . }}
            name: {{ include "mariadbInit.configMap" . }}
            defaultMode: 0755
        restartPolicy: Never
 -      imagePullSecrets:
 -      - name: "{{ include "common.namespace" . }}-docker-registry-key"
 +      {{- include "common.imagePullSecrets" . | nindent 6 }}
@@@ -28,6 -28,12 +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" . }}
          emptyDir:
            medium: Memory
        restartPolicy: Never
 -      imagePullSecrets:
 -      - name: "{{ include "common.namespace" . }}-docker-registry-key"
 +      {{- include "common.imagePullSecrets" . | nindent 6 }}
@@@ -58,20 -58,6 +58,20 @@@ global
    #   user: myuser
    #   password: mypassord
  
 +  # Default definition of the secret containing the docker image repository
 +  # credentials. In the default ONAP deployment the secret is created by the
 +  # repository-wrapper component, which uses the secrets defined above.
 +  # If this is not wanted or other secrets are created, alternative secret
 +  # names can be used
 +  # Overrides for specific images can be done, if the "image" entry is used as
 +  # a map and the "pullSecrets" is used, e.g.
 +  # image:
 +  #   ...
 +  #   pullSecrets:
 +  #     - myRegistryKeySecretName
 +  #
 +  imagePullSecrets:
 +    - '{{ include "common.namespace" . }}-docker-registry-key'
  
    # common global images
    # Busybox for simple shell manipulation
    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