added second dmi-stub to cps-charts 07/142407/4
authorhalil.cakal <halil.cakal@est.tech>
Wed, 5 Nov 2025 15:26:45 +0000 (15:26 +0000)
committerhalil.cakal <halil.cakal@est.tech>
Thu, 13 Nov 2025 09:51:50 +0000 (09:51 +0000)
- cps-charts should support two dmi-stub instances, each uses its own
  pod. Since each pod should return its own Servlet URI (dmi-stub
address)
- the services for dmi-stub instances should be defined seperately since
  a fixed dmi-stub address is required. (otherwise adress would be
dynamic on each deployment)
- env. variable DMI_STUB_SERVER_PORT is used to override ther server
  port for second dmi-stub (ports should be different on pod levels)
- for the latest architecture please visit the solution page:
   https://lf-onap.atlassian.net/wiki/spaces/DW/pages/347537434/CPS-2933+Kubernetes+container+management+system+for+CPS+and+NCMP
- updated Uri address for dmi stub services

Issue-ID: CPS-2934

Change-Id: I1c6bda107ed362278dea7c26fa842a286de76009
Signed-off-by: halil.cakal <halil.cakal@est.tech>
cps-charts/templates/dmi-stub-deployment-1.yaml [moved from cps-charts/templates/dmi-stub-deployment.yaml with 80% similarity]
cps-charts/templates/dmi-stub-deployment-2.yaml [new file with mode: 0644]
cps-charts/templates/dmi-stub-service-1.yaml [new file with mode: 0644]
cps-charts/templates/dmi-stub-service-2.yaml [new file with mode: 0644]
cps-charts/templates/dmi-stub-service.yaml [deleted file]
cps-charts/values.yaml
k6-tests/ncmp/config/endurance.json
k6-tests/ncmp/config/kpi.json

@@ -1,7 +1,7 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
+  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
   labels:
     app: {{ include "cps-and-ncmp.name" . }}
     component: dmi-stub
@@ -22,7 +22,7 @@ spec:
           image: "{{ .Values.dmiStub.image.repository }}:{{ .Values.dmiStub.image.tag }}"
           imagePullPolicy: {{ .Values.dmiStub.image.pullPolicy }}
           ports:
-            - containerPort: {{ .Values.dmiStub.containerPort }}
+            - containerPort: {{ .Values.dmiStub.deployment1.containerPort }}
           env:
             {{- range $key, $value := .Values.dmiStub.env }}
             - name: {{ $key }}
@@ -31,4 +31,4 @@ spec:
           resources:
             {{- toYaml .Values.dmiStub.resources | nindent 12 }}
           livenessProbe:
-            {{- toYaml .Values.dmiStub.livenessProbe | nindent 12 }}
+            {{- toYaml .Values.dmiStub.livenessProbe.deployment1 | nindent 12 }}
diff --git a/cps-charts/templates/dmi-stub-deployment-2.yaml b/cps-charts/templates/dmi-stub-deployment-2.yaml
new file mode 100644 (file)
index 0000000..4ad307b
--- /dev/null
@@ -0,0 +1,36 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: dmi-stub
+spec:
+  replicas: {{ .Values.dmiStub.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "cps-and-ncmp.name" . }}
+      component: dmi-stub
+  template:
+    metadata:
+      labels:
+        app: {{ include "cps-and-ncmp.name" . }}
+        component: dmi-stub
+    spec:
+      containers:
+        - name: dmi-stub
+          image: "{{ .Values.dmiStub.image.repository }}:{{ .Values.dmiStub.image.tag }}"
+          imagePullPolicy: {{ .Values.dmiStub.image.pullPolicy }}
+          ports:
+            - containerPort: {{ .Values.dmiStub.deployment2.containerPort }}
+          env:
+            - name: DMI_STUB_SERVER_PORT
+              value: "{{ .Values.dmiStub.deployment2.containerPort }}"
+            {{- range $key, $value := .Values.dmiStub.env }}
+            - name: {{ $key }}
+              value: "{{ $value }}"
+            {{- end }}
+          resources:
+            {{- toYaml .Values.dmiStub.resources | nindent 12 }}
+          livenessProbe:
+            {{- toYaml .Values.dmiStub.livenessProbe.deployment2 | nindent 12 }}
diff --git a/cps-charts/templates/dmi-stub-service-1.yaml b/cps-charts/templates/dmi-stub-service-1.yaml
new file mode 100644 (file)
index 0000000..f498a95
--- /dev/null
@@ -0,0 +1,20 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: dmi-stub
+spec:
+  type: {{ .Values.dmiStub.service1.type }}
+  ports:
+    - port: {{ .Values.dmiStub.service1.port }}
+      targetPort: {{ .Values.dmiStub.deployment1.containerPort }}
+      protocol: TCP
+      name: http
+      {{- if and (eq .Values.dmiStub.service1.type "NodePort") .Values.dmiStub.service1.nodePort }}
+      nodePort: {{ .Values.dmiStub.service1.nodePort }}
+      {{- end }}
+  selector:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: dmi-stub
diff --git a/cps-charts/templates/dmi-stub-service-2.yaml b/cps-charts/templates/dmi-stub-service-2.yaml
new file mode 100644 (file)
index 0000000..5cf8667
--- /dev/null
@@ -0,0 +1,20 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: dmi-stub
+spec:
+  type: {{ .Values.dmiStub.service2.type }}
+  ports:
+    - port: {{ .Values.dmiStub.service2.port }}
+      targetPort: {{ .Values.dmiStub.deployment2.containerPort }}
+      protocol: TCP
+      name: http
+      {{- if and (eq .Values.dmiStub.service2.type "NodePort") .Values.dmiStub.service2.nodePort }}
+      nodePort: {{ .Values.dmiStub.service2.nodePort }}
+      {{- end }}
+  selector:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: dmi-stub
diff --git a/cps-charts/templates/dmi-stub-service.yaml b/cps-charts/templates/dmi-stub-service.yaml
deleted file mode 100644 (file)
index 79f727d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
-  labels:
-    app: {{ include "cps-and-ncmp.name" . }}
-    component: dmi-stub
-spec:
-  type: {{ .Values.dmiStub.service.type }}
-  ports:
-    - port: {{ .Values.dmiStub.service.port }}
-      targetPort: {{ .Values.dmiStub.containerPort }}
-      protocol: TCP
-      name: http
-      {{- if and (eq .Values.dmiStub.service.type "NodePort") .Values.dmiStub.service.nodePort }}
-      nodePort: {{ .Values.dmiStub.service.nodePort }}
-      {{- end }}
-  selector:
-    app: {{ include "cps-and-ncmp.name" . }}
-    component: dmi-stub
index 72f040d..4c05574 100644 (file)
@@ -127,11 +127,18 @@ dmiStub:
     tag: "1.8.0-SNAPSHOT"
     pullPolicy: IfNotPresent
   replicaCount: 1
-  service:
+  deployment1:
+    containerPort: 8092
+  deployment2:
+    containerPort: 8093
+  service1:
     type: NodePort
     port: 8092
     nodePort: 30092
-  containerPort: 8092
+  service2:
+    type: NodePort
+    port: 8093
+    nodePort: 31092
   env:
     KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka.default.svc.cluster.local:9092"
     NCMP_CONSUMER_GROUP_ID: "ncmp-group"
@@ -149,9 +156,17 @@ dmiStub:
       cpu: "1000m"
       memory: "2Gi"
   livenessProbe:
-    httpGet:
-      path: /actuator/health/readiness
-      port: 8092
-    initialDelaySeconds: 30
-    periodSeconds: 10
-    failureThreshold: 3
+    deployment1:
+      httpGet:
+        path: /actuator/health/readiness
+        port: 8092
+      initialDelaySeconds: 30
+      periodSeconds: 10
+      failureThreshold: 3
+    deployment2:
+      httpGet:
+        path: /actuator/health/readiness
+        port: 8093
+      initialDelaySeconds: 30
+      periodSeconds: 10
+      failureThreshold: 3
index e216ed0..afe8f6a 100644 (file)
@@ -7,7 +7,7 @@
   },
   "k8sHosts": {
     "ncmpBaseUrl": "http://localhost:30080",
-    "dmiStubUrl": "http://cps-ncmp-dmi-stub:8092",
+    "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
     "kafkaBootstrapServer": "localhost:30093"
   },
   "scenarios": {
index 666f70a..7cade34 100644 (file)
@@ -7,7 +7,7 @@
   },
   "k8sHosts": {
     "ncmpBaseUrl": "http://localhost:30080",
-    "dmiStubUrl": "http://cps-ncmp-dmi-stub:8092",
+    "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
     "kafkaBootstrapServer": "localhost:30093"
   },
   "scenarios": {