Fix DMI stub 2 and DmiWatchdog connection issues 40/142940/10
authorshikha0203 <shivani.khare@est.tech>
Fri, 16 Jan 2026 10:59:14 +0000 (10:59 +0000)
committerShivani Khare <shivani.khare@est.tech>
Tue, 27 Jan 2026 13:59:40 +0000 (13:59 +0000)
- Separate DMI stub deployments with proper service selectors
- Configure distinct ports 8092/8093 and NodePorts 30092/30094
- Resolve DmiWatchdog connection refused errors
- Enable CM handle registration with both DMI stubs in READY state
- Update the name of service when we register nodes in our (k6 and endurance) testware

Issue-ID: CPS-3056
Change-Id: Idcf4a21c5a4f6d8f64281f454cb3e4db8f079a00
Signed-off-by: shikha0203 <shivani.khare@est.tech>
20 files changed:
cps-charts/README.md
cps-charts/templates/_helpers.tpl
cps-charts/templates/cps-deployment.yaml
cps-charts/templates/cps-hazelcast-rbac.yaml
cps-charts/templates/cps-hazelcast-service.yaml
cps-charts/templates/cps-service.yaml
cps-charts/templates/dmi-stub-deployment-1.yaml
cps-charts/templates/dmi-stub-deployment-2.yaml
cps-charts/templates/dmi-stub-service-1.yaml
cps-charts/templates/dmi-stub-service-2.yaml
cps-charts/templates/kafka-deployment.yaml
cps-charts/templates/kafka-external-service.yaml
cps-charts/templates/kafka-service.yaml
cps-charts/templates/postgresql-deployment.yaml
cps-charts/templates/postgresql-service.yaml
cps-charts/templates/zookeeper-deployment.yaml
cps-charts/templates/zookeeper-service.yaml
cps-charts/values.yaml
k6-tests/ncmp/config/endurance.json
k6-tests/ncmp/config/kpi.json

index 3bee52b..4231780 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+   Copyright (C) 2025-2026 OpenInfra Foundation Europe. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 
 # CPS and NCMP Helm Chart
-This Helm chart deploys the **CPS** and **NCMP** ecosystem along with PostgreSQL, Kafka, Zookeeper, and the DMI Stub service.
+This Helm chart deploys the **CPS** and **NCMP** ecosystem along with PostgreSQL, Kafka, Zookeeper, and dual DMI Stub services.
 ---
 ## Prerequisites
 - Kubernetes cluster (tested on K8s 1.24+)
@@ -33,43 +33,30 @@ To install the chart into the **default namespace**:
 helm install cps ./<chart-directory>
 ```
 Replace <chart-directory> with the path to this Helm chart.
-You can verify the deployment using:
-```bash
-kubectl get all -l app=ncmp
-```
+
 ---
-## Uninstallation
-To uninstall the chart and delete all related resources:
+
+## check deployment status
+You can verify the deployment using:
 ```bash
-helm uninstall cps
+kubectl get pods
 ```
 ---
-## Port Forwarding
-You can access the services locally using kubectl port-forward.
----
-## CPS and NCMP (API) Service
+
+# Port forwarding
+Required for local access to cluster services
 ```bash
-kubectl port-forward service/cps-ncmp 8080:8080
+kubectl port-forward service/cps-ncmp-service 8080:8080
 ```
-Once port forwarding is active, you can access the CPS/NCMP API at:
-http://localhost:8080
 ---
-## DMI Stub Service
+
+## Uninstallation
+To uninstall the chart and delete all related resources:
 ```bash
-kubectl port-forward service/cps-ncmp-dmi-stub 8092:8092
+helm uninstall cps
 ```
-Access the DMI stub API at:
-http://localhost:8092
----
-## Default Credentials
-### PostgreSQL
-Database: cpsdb
-Username: cps
-Password: cps
-### DMI Stub
-Username: cpsuser
-Password: cpsr0cks!
 ---
+
 ## Configuration
 This chart includes default settings suitable for local development and testing. You can customize values using a custom values.yaml file or by passing --set parameters at install time.
 Example:
@@ -84,4 +71,4 @@ This Helm chart deploys the following components:
 - kafka: Kafka message broker
 - zookeeper: Zookeeper coordination service for Kafka
 - dmi-stub: Stub service for NCMP device interactions
----
+---
\ No newline at end of file
index 377d136..b789548 100644 (file)
@@ -2,6 +2,6 @@
 {{ .Chart.Name }}
 {{- end }}
 
-{{- define "cps-and-ncmp.fullname" -}}
+{{- define "cps-and-ncmp.release-name" -}}
 {{ .Release.Name }}-{{ .Chart.Name }}
 {{- end }}
index 6c13362..40ca5ab 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}
+  name: {{ include "cps-and-ncmp.release-name" . }}
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: cps-and-ncmp
@@ -18,6 +18,27 @@ spec:
         component: cps
     spec:
       serviceAccountName: cps-hazelcast-service-account
+      initContainers:
+        # Wait for PostgreSQL and Kafka to be ready
+        - name: wait-for-dependencies
+          image: busybox:1.36
+          command:
+            - sh
+            - -c
+            - |
+              echo "Waiting for PostgreSQL..."
+              until nc -z {{ include "cps-and-ncmp.release-name" . }}-postgresql-service 5432; do
+                echo "PostgreSQL not ready, waiting..."
+                sleep 2
+              done
+              echo "PostgreSQL is ready"
+              echo "Waiting for Kafka..."
+              until nc -z {{ include "cps-and-ncmp.release-name" . }}-kafka-service 9092; do
+                echo "Kafka not ready, waiting..."
+                sleep 2
+              done
+              echo "Kafka is ready"
+              echo "All dependencies are ready"
       containers:
         - name: cps
           image: "{{ .Values.cps.image.repository }}:{{ .Values.cps.image.tag }}"
@@ -31,27 +52,10 @@ spec:
               value: "{{ $envValue }}"
             {{- end }}
             - name: CPS_NCMP_SERVICE_NAME
-              value: cps-{{ include "cps-and-ncmp.name" . }}-hazelcast
+              value: cps-{{ include "cps-and-ncmp.name" . }}-hazelcast-service
           resources:
-            requests:
-              cpu: {{ .Values.cps.resources.requests.cpu }}
-              memory: {{ .Values.cps.resources.requests.memory }}
-            limits:
-              cpu: {{ .Values.cps.resources.limits.cpu }}
-              memory: {{ .Values.cps.resources.limits.memory }}
-          readinessProbe:
-            httpGet:
-              path: /actuator/health/readiness
-              port: 8080
-            initialDelaySeconds: 60
-            periodSeconds: 10
-            timeoutSeconds: 5
-            failureThreshold: 5
+            {{- toYaml .Values.cps.resources | nindent 12 }}
           livenessProbe:
-            httpGet:
-              path: /actuator/health/liveness
-              port: 8080
-            initialDelaySeconds: 60
-            periodSeconds: 10
-            timeoutSeconds: 5
-            failureThreshold: 5
+            {{- toYaml .Values.cps.livenessProbe | nindent 12 }}
+          readinessProbe:
+            {{- toYaml .Values.cps.readinessProbe | nindent 12 }}
index 9a48529..af42f27 100644 (file)
@@ -5,7 +5,7 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: cps-hazelcast-service-account
-  namespace: default
+  namespace: {{ .Release.Namespace }}
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: hazelcast
@@ -51,4 +51,4 @@ roleRef:
 subjects:
   - kind: ServiceAccount
     name: cps-hazelcast-service-account
-    namespace: default
\ No newline at end of file
+    namespace: {{ .Release.Namespace }}
\ No newline at end of file
index 9945c92..d7f6a43 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: cps-{{ include "cps-and-ncmp.name" . }}-hazelcast
+  name: cps-{{ include "cps-and-ncmp.name" . }}-hazelcast-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: cps-and-ncmp
index 5b84d47..e3fb80b 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}
+  name: {{ include "cps-and-ncmp.release-name" . }}-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: cps-and-ncmp
index 4852329..99c4701 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
+  name: {{ include "cps-and-ncmp.release-name" . }}-dmi-stub-1
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
@@ -26,19 +26,15 @@ spec:
           ports:
             - containerPort: {{ .Values.dmiStub.deployment1.containerPort }}
           env:
-            - name: DMI_STUB_SERVER_PORT
-              value: "{{ .Values.dmiStub.deployment1.containerPort }}"
-            - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE
-              value: "health,info"
-            - name: MANAGEMENT_ENDPOINT_HEALTH_SHOW_DETAILS
-              value: "always"
             {{- range $key, $value := .Values.dmiStub.env }}
-            - name: {{ $key }}
+            - name: {{ $key | upper }}
               value: "{{ $value }}"
             {{- end }}
+            - name: DMI_SERVER_PORT
+              value: "{{ .Values.dmiStub.deployment1.containerPort }}"
           resources:
             {{- toYaml .Values.dmiStub.resources | nindent 12 }}
           livenessProbe:
-            {{- toYaml .Values.dmiStub.livenessProbe.deployment1 | nindent 12 }}
+            {{- toYaml .Values.dmiStub.livenessProbe | nindent 12 }}
           readinessProbe:
-            {{- toYaml .Values.dmiStub.readinessProbe.deployment1 | nindent 12 }}
\ No newline at end of file
+            {{- toYaml .Values.dmiStub.readinessProbe | nindent 12 }}
\ No newline at end of file
index 04435d1..2341d6e 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+  name: {{ include "cps-and-ncmp.release-name" . }}-dmi-stub-2
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
@@ -26,19 +26,15 @@ spec:
           ports:
             - containerPort: {{ .Values.dmiStub.deployment2.containerPort }}
           env:
-            - name: DMI_STUB_SERVER_PORT
-              value: "{{ .Values.dmiStub.deployment2.containerPort }}"
-            - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE
-              value: "health,info"
-            - name: MANAGEMENT_ENDPOINT_HEALTH_SHOW_DETAILS
-              value: "always"
             {{- range $key, $value := .Values.dmiStub.env }}
-            - name: {{ $key }}
+            - name: {{ $key | upper }}
               value: "{{ $value }}"
             {{- end }}
+            - name: DMI_STUB_SERVER_PORT
+              value: "{{ .Values.dmiStub.deployment2.containerPort }}"
           resources:
             {{- toYaml .Values.dmiStub.resources | nindent 12 }}
           livenessProbe:
             {{- toYaml .Values.dmiStub.livenessProbe.deployment2 | nindent 12 }}
           readinessProbe:
-            {{- toYaml .Values.dmiStub.readinessProbe.deployment2 | nindent 12 }}
+            {{- toYaml .Values.dmiStub.readinessProbe.deployment2 | nindent 12 }}
\ No newline at end of file
index 1feca0e..11e036b 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
+  name: {{ include "cps-and-ncmp.release-name" . }}-dmi-stub-1-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
@@ -18,4 +18,4 @@ spec:
   selector:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
-    instance: dmi-stub-1
+    instance: dmi-stub-1
\ No newline at end of file
index cc128cd..5b4f2f8 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+  name: {{ include "cps-and-ncmp.release-name" . }}-dmi-stub-2-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
@@ -18,4 +18,4 @@ spec:
   selector:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
-    instance: dmi-stub-2
+    instance: dmi-stub-2
\ No newline at end of file
index 9d3978f..951ad8d 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-kafka
+  name: {{ include "cps-and-ncmp.release-name" . }}-kafka
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: kafka
@@ -9,51 +9,33 @@ spec:
   replicas: {{ .Values.kafka.replicaCount }}
   selector:
     matchLabels:
-      app: kafka
+      app: {{ include "cps-and-ncmp.name" . }}
+      component: kafka
   template:
     metadata:
       labels:
-        app: kafka
+        app: {{ include "cps-and-ncmp.name" . }}
+        component: kafka
     spec:
       containers:
         - name: kafka
           image: "{{ .Values.kafka.image.repository }}:{{ .Values.kafka.image.tag }}"
           imagePullPolicy: {{ .Values.kafka.image.pullPolicy }}
           ports:
-            - containerPort: {{ .Values.kafka.service.ports.internal }}
+            - containerPort: 29092
               name: internal
-            - containerPort: {{ .Values.kafka.service.ports.external }}
+            - containerPort: 9092
               name: external
+            - containerPort: 9093
+              name: nodeport
           env:
-            - name: KAFKA_BROKER_ID
-              value: "{{ .Values.kafka.brokerId }}"
-            - name: KAFKA_ZOOKEEPER_CONNECT
-              value: "{{ .Values.kafka.zookeeperConnect }}:2181"
-            - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
-              value: "{{ .Values.kafka.listenerSecurityProtocolMap }}"
-            - name: KAFKA_LISTENERS
-              value: "{{ .Values.kafka.listeners }}"
-            - name: KAFKA_ADVERTISED_LISTENERS
-              value: "{{ .Values.kafka.advertisedListeners }}"
-            - name: KAFKA_INTER_BROKER_LISTENER_NAME
-              value: "{{ .Values.kafka.interBrokerListenerName }}"
-            - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
-              value: "{{ .Values.kafka.offsetsTopicReplicationFactor }}"
+            {{- range $key, $value := .Values.kafka.env }}
+            - name: {{ $key | upper }}
+              value: "{{ $value }}"
+            {{- end }}
           resources:
-            requests:
-              cpu: {{ .Values.kafka.resources.requests.cpu }}
-              memory: {{ .Values.kafka.resources.requests.memory }}
-            limits:
-              cpu: "{{ .Values.kafka.resources.limits.cpu }}"
-              memory: "{{ .Values.kafka.resources.limits.memory }}"
+            {{- toYaml .Values.kafka.resources | nindent 12 }}
+          livenessProbe:
+            {{- toYaml .Values.kafka.livenessProbe | nindent 12 }}
           readinessProbe:
-            exec:
-              command:
-                - kafka-topics
-                - --bootstrap-server
-                - localhost:{{ .Values.kafka.service.ports.internal }}
-                - --list
-            initialDelaySeconds: {{ .Values.kafka.healthcheck.startPeriod | default 30 }}
-            periodSeconds: {{ .Values.kafka.healthcheck.interval | default 10 }}
-            timeoutSeconds: {{ .Values.kafka.healthcheck.timeout | default 10 }}
-            failureThreshold: {{ .Values.kafka.healthcheck.retries | default 3 }}
+            {{- toYaml .Values.kafka.readinessProbe | nindent 12 }}
index 906c996..57f267e 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-kafka-external
+  name: {{ include "cps-and-ncmp.release-name" . }}-kafka-external-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: kafka-external
@@ -16,4 +16,5 @@ spec:
       targetPort: {{ .Values.kafka.externalService.ports.external }}
       nodePort: {{ .Values.kafka.externalService.nodePorts.external }}
   selector:
-    app: kafka
\ No newline at end of file
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: kafka
\ No newline at end of file
index b50aadd..44d3359 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-kafka
+  name: {{ include "cps-and-ncmp.release-name" . }}-kafka-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: kafka
@@ -15,4 +15,5 @@ spec:
       port: {{ .Values.kafka.service.ports.external }}
       targetPort: {{ .Values.kafka.service.ports.external }}
   selector:
-    app: kafka
\ No newline at end of file
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: kafka
\ No newline at end of file
index 3f888f7..0f565d5 100644 (file)
@@ -1,10 +1,10 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-postgresql
+  name: {{ include "cps-and-ncmp.release-name" . }}-postgresql
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
-    component: postgres
+    component: postgresql
 spec:
   replicas: 1
   selector:
@@ -23,32 +23,19 @@ spec:
           ports:
             - containerPort: 5432
           env:
-            - name: POSTGRES_DB
-              value: "{{ .Values.postgresql.env.POSTGRES_DB }}"
-            - name: POSTGRES_USER
-              value: "{{ .Values.postgresql.env.POSTGRES_USER }}"
-            - name: POSTGRES_PASSWORD
-              value: "{{ .Values.postgresql.env.POSTGRES_PASSWORD }}"
+            {{- range $envName, $envValue := .Values.postgresql.env }}
+            - name: {{ $envName | upper }}
+              value: "{{ $envValue }}"
+            {{- end }}
           volumeMounts:
             - name: init-sql
               mountPath: {{ .Values.postgresql.initSql.mountPath }}
           resources:
-            requests:
-              cpu: {{ .Values.postgresql.resources.requests.cpu }}
-              memory: {{ .Values.postgresql.resources.requests.memory }}
-            limits:
-              cpu: {{ .Values.postgresql.resources.limits.cpu }}
-              memory: {{ .Values.postgresql.resources.limits.memory }}
+            {{- toYaml .Values.postgresql.resources | nindent 12 }}
+          livenessProbe:
+            {{- toYaml .Values.postgresql.livenessProbe | nindent 12 }}
           readinessProbe:
-            exec:
-              command:
-                - sh
-                - -c
-                - pg_isready -U {{ .Values.postgresql.env.POSTGRES_USER }} -d {{ .Values.postgresql.env.POSTGRES_DB }}
-            initialDelaySeconds: 10
-            periodSeconds: 10
-            timeoutSeconds: 5
-            failureThreshold: 10
+            {{- toYaml .Values.postgresql.readinessProbe | nindent 12 }}
       volumes:
         - name: init-sql
           configMap:
index ad6b0e6..2fbe0be 100644 (file)
@@ -1,10 +1,10 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-postgresql
+  name: {{ include "cps-and-ncmp.release-name" . }}-postgresql-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
-    component: postgres
+    component: postgresql
 spec:
   type: ClusterIP
   selector:
index 6e14c16..494c6c0 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-zookeeper
+  name: {{ include "cps-and-ncmp.release-name" . }}-zookeeper
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: zookeeper
@@ -24,26 +24,13 @@ spec:
           ports:
             - containerPort: {{ .Values.zookeeper.service.port }}
           env:
-            - name: ZOOKEEPER_CLIENT_PORT
-              value: "{{ .Values.zookeeper.env.ZOOKEEPER_CLIENT_PORT }}"
-          readinessProbe:
-            exec:
-              command: {{ toJson .Values.zookeeper.healthcheck.command }}
-            initialDelaySeconds: {{ .Values.zookeeper.healthcheck.startPeriod | int }}
-            periodSeconds: {{ .Values.zookeeper.healthcheck.interval | int }}
-            timeoutSeconds: {{ .Values.zookeeper.healthcheck.timeout | int }}
-            failureThreshold: {{ .Values.zookeeper.healthcheck.retries | int }}
-          livenessProbe:
-            exec:
-              command: {{ toJson .Values.zookeeper.healthcheck.command }}
-            initialDelaySeconds: {{ .Values.zookeeper.healthcheck.startPeriod | int }}
-            periodSeconds: {{ .Values.zookeeper.healthcheck.interval | int }}
-            timeoutSeconds: {{ .Values.zookeeper.healthcheck.timeout | int }}
-            failureThreshold: {{ .Values.zookeeper.healthcheck.retries | int }}
+            {{- range $envName, $envValue := .Values.zookeeper.env }}
+            - name: {{ $envName  | upper}}
+              value: "{{ $envValue }}"
+            {{- end }}
           resources:
-            requests:
-              cpu: {{ .Values.zookeeper.resources.requests.cpu }}
-              memory: {{ .Values.zookeeper.resources.requests.memory }}
-            limits:
-              cpu: {{ .Values.zookeeper.resources.limits.cpu }}
-              memory: {{ .Values.zookeeper.resources.limits.memory }}
+            {{- toYaml .Values.zookeeper.resources | nindent 12 }}
+          livenessProbe:
+            {{- toYaml .Values.zookeeper.livenessProbe | nindent 12 }}
+          readinessProbe:
+            {{- toYaml .Values.zookeeper.readinessProbe | nindent 12 }}
index ee793ea..ce87c3c 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-zookeeper
+  name: {{ include "cps-and-ncmp.release-name" . }}-zookeeper-service
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: zookeeper
index 7050773..9d9ab2f 100644 (file)
@@ -1,5 +1,7 @@
 postgresql:
   image: "postgres:14.1-alpine"
+  persistence:
+    enabled: false
   resources:
     requests:
       cpu: "2000m"
@@ -13,15 +15,34 @@ postgresql:
     POSTGRES_USER: "cps"
     POSTGRES_PASSWORD: "cps"
   initSql:
-    enabled: true
+    enabled: false
     configMapName: postgres-init-sql
     mountPath: /docker-entrypoint-initdb.d
+  livenessProbe:
+    exec:
+      command:
+        - sh
+        - -c
+        - pg_isready -U cps
+    initialDelaySeconds: 30
+    periodSeconds: 10
+    failureThreshold: 3
+  readinessProbe:
+    exec:
+      command:
+        - sh
+        - -c
+        - pg_isready -U cps -d cpsdb
+    initialDelaySeconds: 5
+    periodSeconds: 5
+    timeoutSeconds: 3
+    failureThreshold: 6
 
 cps:
   image:
     repository: "nexus3.onap.org:10003/onap/cps-and-ncmp"
     tag: "latest"
-    pullPolicy: IfNotPresent
+    pullPolicy: Always
   replicas: 2
   servicePort: 8080
   service:
@@ -30,18 +51,42 @@ cps:
     nodePort: 30080
   resources:
     requests:
-      cpu: "2000m"
-      memory: "3Gi"
+      cpu: "500m"
+      memory: "1Gi"
     limits:
-      cpu: "6000m"
-      memory: "5Gi"
+      cpu: "2000m"
+      memory: "2Gi"
+  livenessProbe:
+    # Give cps up to 170 seconds to become alive
+    httpGet:
+      path: /actuator/health/liveness
+      port: 8080
+    initialDelaySeconds: 120
+    periodSeconds: 10
+    timeoutSeconds: 5
+    failureThreshold: 5
+  readinessProbe:
+    # After CPS is alive it can take up to 110 seconds to be ready for requests
+    httpGet:
+      path: /actuator/health/readiness
+      port: 8080
+    initialDelaySeconds: 60
+    periodSeconds: 10
+    timeoutSeconds: 5
+    failureThreshold: 5
   env:
-    DB_HOST: "cps-ncmp-postgresql"
+    DB_HOST: "cps-ncmp-postgresql-service"
     DB_USERNAME: "cps"
     DB_PASSWORD: "cps"
+    DB_NAME: "cpsdb"
+    SPRING_DATASOURCE_URL: "jdbc:postgresql://cps-ncmp-postgresql-service:5432/cpsdb"
+    SPRING_DATASOURCE_USERNAME: "cps"
+    SPRING_DATASOURCE_PASSWORD: "cps"
     DMI_USERNAME: "cpsuser"
     DMI_PASSWORD: "cpsr0cks!"
-    KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka.default.svc.cluster.local:9092"
+    SPRING_KAFKA_BOOTSTRAP_SERVERS: "cps-ncmp-kafka-service:9092"
+    SPRING_KAFKA_CONSUMER_BOOTSTRAP_SERVERS: "cps-ncmp-kafka-service:9092"
+    SPRING_KAFKA_PRODUCER_BOOTSTRAP_SERVERS: "cps-ncmp-kafka-service:9092"
     notification_enabled: "true"
     ONAP_TRACING_ENABLED: "false"
     ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT: "http://jaeger-service:14250"
@@ -49,7 +94,7 @@ cps:
     POLICY_SERVICE_ENABLED: "false"
     POLICY_SERVICE_DEFAULT_DECISION: "deny from env"
     CPS_MONITORING_MICROMETER_JVM_EXTRAS: "true"
-    JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
+    JAVA_TOOL_OPTIONS: "-Xms512m -Xmx1g -XX:+UseG1GC"
     HAZELCAST_MODE_KUBERNETES_ENABLED: "true"
     NCMP_INVENTORY_MODEL_UPGRADE_R20250722_ENABLED: 'false'
 
@@ -63,21 +108,26 @@ kafka:
   service:
     type: ClusterIP
     ports:
-      external: 9092
       internal: 29092
+      external: 9092
   externalService:
     ports:
       internal: 9092
       external: 9093
     nodePorts:
       external: 30093
-  zookeeperConnect: "cps-ncmp-zookeeper.default.svc.cluster.local"
-  brokerId: 1
-  listeners: "INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092,NODEPORT://0.0.0.0:9093"
-  advertisedListeners: "INTERNAL://localhost:29092,EXTERNAL://cps-ncmp-kafka:9092,NODEPORT://localhost:30093"
-  interBrokerListenerName: "INTERNAL"
-  listenerSecurityProtocolMap: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,NODEPORT:PLAINTEXT"
-  offsetsTopicReplicationFactor: 1
+  env:
+    KAFKA_ZOOKEEPER_CONNECT: "cps-ncmp-zookeeper-service:2181"
+    KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: "60000"
+    KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: "60000"
+    KAFKA_BROKER_ID: "1"
+    KAFKA_LISTENERS: "INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092,NODEPORT://0.0.0.0:9093"
+    KAFKA_ADVERTISED_LISTENERS: "INTERNAL://cps-ncmp-kafka-service:29092,EXTERNAL://cps-ncmp-kafka-service:9092,NODEPORT://localhost:30093"
+    KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
+    KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,NODEPORT:PLAINTEXT"
+    KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1"
+    KAFKA_RESTART_ATTEMPTS: "10"
+    KAFKA_RESTART_DELAY_MS: "5000"
   resources:
     requests:
       cpu: "500m"
@@ -85,14 +135,20 @@ kafka:
     limits:
       cpu: "2000m"
       memory: "2Gi"
-  healthcheck:
-    enabled: true
-    command: >
-      kafka-topics --bootstrap-server cps-ncmp-kafka:29092 --list || exit 1
-    interval: 10
-    timeout: 10
-    retries: 3
-    startPeriod: 30
+  livenessProbe:
+    tcpSocket:
+      port: 29092
+    initialDelaySeconds: 60
+    periodSeconds: 30
+    failureThreshold: 5
+    timeoutSeconds: 10
+  readinessProbe:
+    tcpSocket:
+      port: 29092
+    initialDelaySeconds: 5
+    periodSeconds: 3
+    timeoutSeconds: 3
+    failureThreshold: 3
 
 zookeeper:
   enabled: true
@@ -112,13 +168,19 @@ zookeeper:
       memory: "1Gi"
   env:
     ZOOKEEPER_CLIENT_PORT: 2181
-  healthcheck:
-    enabled: true
-    command: ["sh", "-c", "nc -z localhost 2181 || exit 1"]
-    interval: 10s
-    timeout: 10s
-    retries: 3
-    startPeriod: 30s
+  livenessProbe:
+    exec:
+      command: [ "sh", "-c", "nc -z localhost 2181 || exit 1" ]
+    initialDelaySeconds: 15
+    periodSeconds: 5
+    failureThreshold: 3
+  readinessProbe:
+    exec:
+      command: [ "sh", "-c", "nc -z localhost 2181 || exit 1" ]
+    initialDelaySeconds: 5
+    periodSeconds: 3
+    timeoutSeconds: 3
+    failureThreshold: 3
 
 dmiStub:
   enabled: true
@@ -129,18 +191,18 @@ dmiStub:
   replicaCount: 1
   deployment1:
     containerPort: 8092
-  deployment2:
-    containerPort: 8092
   service1:
     type: NodePort
     port: 8092
     nodePort: 30092
+  deployment2:
+    containerPort: 8093
   service2:
     type: NodePort
     port: 8092
-    nodePort: 31092
+    nodePort: 30094
   env:
-    KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka.default.svc.cluster.local:9092"
+    KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka-service:9092"
     NCMP_CONSUMER_GROUP_ID: "ncmp-group"
     NCMP_ASYNC_M2M_TOPIC: "ncmp-async-m2m"
     MODULE_INITIAL_PROCESSING_DELAY_MS: 180000
@@ -156,36 +218,20 @@ dmiStub:
       cpu: "1000m"
       memory: "2Gi"
   livenessProbe:
-    deployment1:
-      httpGet:
-        path: /actuator/health
-        port: 8092
-      initialDelaySeconds: 60
-      periodSeconds: 30
-      failureThreshold: 5
-      timeoutSeconds: 10
-    deployment2:
-      httpGet:
-        path: /actuator/health
-        port: 8092
-      initialDelaySeconds: 60
-      periodSeconds: 30
-      failureThreshold: 5
-      timeoutSeconds: 10
+    httpGet:
+      path: /actuator/health/liveness
+      port: 8092
+    initialDelaySeconds: 30
+    periodSeconds: 15
+    failureThreshold: 3
+    timeoutSeconds: 5
   readinessProbe:
-    deployment1:
-      httpGet:
-        path: /actuator/health
-        port: 8092
-      initialDelaySeconds: 30
-      periodSeconds: 10
-      failureThreshold: 3
-      timeoutSeconds: 5
-    deployment2:
-      httpGet:
-        path: /actuator/health
-        port: 8092
-      initialDelaySeconds: 30
-      periodSeconds: 10
-      failureThreshold: 3
-      timeoutSeconds: 5
+    httpGet:
+      path: /actuator/health/readiness
+      port: 8092
+    initialDelaySeconds: 15
+    periodSeconds: 5
+    failureThreshold: 3
+    timeoutSeconds: 5
+
+
index afe8f6a..8503e1a 100644 (file)
@@ -7,7 +7,7 @@
   },
   "k8sHosts": {
     "ncmpBaseUrl": "http://localhost:30080",
-    "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
+    "dmiStubUrl": "http://cps-and-ncmp-dmi-stub-1-service:8092",
     "kafkaBootstrapServer": "localhost:30093"
   },
   "scenarios": {
index 7cade34..609de30 100644 (file)
@@ -7,7 +7,7 @@
   },
   "k8sHosts": {
     "ncmpBaseUrl": "http://localhost:30080",
-    "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
+    "dmiStubUrl": "http://cps-and-ncmp-dmi-stub-1-service:8092",
     "kafkaBootstrapServer": "localhost:30093"
   },
   "scenarios": {