From b65c3bec7e8f560fb70150c4f10d4cd0299bba0d Mon Sep 17 00:00:00 2001 From: egernug Date: Wed, 7 Jan 2026 15:49:50 +0000 Subject: [PATCH] dmi-stub-2 restart issue and "Connection refused exception" - Fixed Template Structure - Standardized Port Configuration (unified container ports 8092) - Added actuator environment variables - Configured working probes - The setup now provides two independent DMI stub services with reliable health monitoring and external access. Issue-ID: CPS-3056 Change-Id: I7e4b7db4c0e29ab887597ef5f8ba16778f4d74d2 Signed-off-by: egernug --- cps-charts/templates/dmi-stub-deployment-1.yaml | 10 +++++++++ cps-charts/templates/dmi-stub-deployment-2.yaml | 8 +++++++ cps-charts/templates/dmi-stub-service-1.yaml | 1 + cps-charts/templates/dmi-stub-service-2.yaml | 1 + cps-charts/values.yaml | 29 ++++++++++++++++++++----- 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/cps-charts/templates/dmi-stub-deployment-1.yaml b/cps-charts/templates/dmi-stub-deployment-1.yaml index e4593c2a04..4852329f0c 100644 --- a/cps-charts/templates/dmi-stub-deployment-1.yaml +++ b/cps-charts/templates/dmi-stub-deployment-1.yaml @@ -11,11 +11,13 @@ spec: matchLabels: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-1 template: metadata: labels: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-1 spec: containers: - name: dmi-stub @@ -24,6 +26,12 @@ 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 }} value: "{{ $value }}" @@ -32,3 +40,5 @@ spec: {{- toYaml .Values.dmiStub.resources | nindent 12 }} livenessProbe: {{- toYaml .Values.dmiStub.livenessProbe.deployment1 | nindent 12 }} + readinessProbe: + {{- toYaml .Values.dmiStub.readinessProbe.deployment1 | nindent 12 }} \ No newline at end of file diff --git a/cps-charts/templates/dmi-stub-deployment-2.yaml b/cps-charts/templates/dmi-stub-deployment-2.yaml index 4ad307b9fa..04435d10e3 100644 --- a/cps-charts/templates/dmi-stub-deployment-2.yaml +++ b/cps-charts/templates/dmi-stub-deployment-2.yaml @@ -11,11 +11,13 @@ spec: matchLabels: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-2 template: metadata: labels: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-2 spec: containers: - name: dmi-stub @@ -26,6 +28,10 @@ spec: 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 }} value: "{{ $value }}" @@ -34,3 +40,5 @@ spec: {{- toYaml .Values.dmiStub.resources | nindent 12 }} livenessProbe: {{- toYaml .Values.dmiStub.livenessProbe.deployment2 | nindent 12 }} + readinessProbe: + {{- toYaml .Values.dmiStub.readinessProbe.deployment2 | nindent 12 }} diff --git a/cps-charts/templates/dmi-stub-service-1.yaml b/cps-charts/templates/dmi-stub-service-1.yaml index f498a95a4d..1feca0ef9b 100644 --- a/cps-charts/templates/dmi-stub-service-1.yaml +++ b/cps-charts/templates/dmi-stub-service-1.yaml @@ -18,3 +18,4 @@ spec: selector: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-1 diff --git a/cps-charts/templates/dmi-stub-service-2.yaml b/cps-charts/templates/dmi-stub-service-2.yaml index 5cf8667f34..cc128cd979 100644 --- a/cps-charts/templates/dmi-stub-service-2.yaml +++ b/cps-charts/templates/dmi-stub-service-2.yaml @@ -18,3 +18,4 @@ spec: selector: app: {{ include "cps-and-ncmp.name" . }} component: dmi-stub + instance: dmi-stub-2 diff --git a/cps-charts/values.yaml b/cps-charts/values.yaml index 4c0557463f..70507738af 100644 --- a/cps-charts/values.yaml +++ b/cps-charts/values.yaml @@ -130,14 +130,14 @@ dmiStub: deployment1: containerPort: 8092 deployment2: - containerPort: 8093 + containerPort: 8092 service1: type: NodePort port: 8092 nodePort: 30092 service2: type: NodePort - port: 8093 + port: 8092 nodePort: 31092 env: KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka.default.svc.cluster.local:9092" @@ -158,15 +158,34 @@ dmiStub: livenessProbe: deployment1: httpGet: - path: /actuator/health/readiness + 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 + readinessProbe: + deployment1: + httpGet: + path: /actuator/health port: 8092 initialDelaySeconds: 30 periodSeconds: 10 failureThreshold: 3 + timeoutSeconds: 5 deployment2: httpGet: - path: /actuator/health/readiness - port: 8093 + path: /actuator/health + port: 8092 initialDelaySeconds: 30 periodSeconds: 10 failureThreshold: 3 + timeoutSeconds: 5 -- 2.16.6