Local k8s env. running k6 test (Split-1) 68/142068/1
authorhalil.cakal <halil.cakal@est.tech>
Fri, 19 Sep 2025 11:41:41 +0000 (12:41 +0100)
committerhalil.cakal <halil.cakal@est.tech>
Fri, 19 Sep 2025 11:46:58 +0000 (12:46 +0100)
- add a new service for kafka to provide broker external connectivity
- update resources with remedy values (hardware resources will be align
  with stakeholder requirements later)
- update kafka broker address to correct one for dmi-stub
- update licence headers for readme.md

Issue-ID: CPS-2967

Change-Id: I518f3c8f620efd3965efb6a5d1fa19a12ce28676
Signed-off-by: halil.cakal <halil.cakal@est.tech>
cps-charts/README.md
cps-charts/templates/kafka-deployment.yaml
cps-charts/templates/kafka-external-service.yaml [new file with mode: 0644]
cps-charts/values.yaml

index b28e6a2..f80363f 100644 (file)
@@ -1,3 +1,23 @@
+<!--
+  ============LICENSE_START=======================================================
+   Copyright (C) 2025 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.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  SPDX-License-Identifier: Apache-2.0
+  ============LICENSE_END=========================================================
+-->
+
 
 # CPS and NCMP Helm Chart
 This Helm chart deploys the **CPS** and **NCMP** ecosystem along with PostgreSQL, Kafka, Zookeeper, and the DMI Stub service.
index 46fa90e..ecfc865 100644 (file)
@@ -43,9 +43,6 @@ spec:
             limits:
               cpu: "{{ .Values.kafka.resources.limits.cpu }}"
               memory: "{{ .Values.kafka.resources.limits.memory }}"
-            requests:
-              cpu: "{{ .Values.kafka.resources.requests.cpu }}"
-              memory: "{{ .Values.kafka.resources.requests.memory }}"
           readinessProbe:
             exec:
               command:
diff --git a/cps-charts/templates/kafka-external-service.yaml b/cps-charts/templates/kafka-external-service.yaml
new file mode 100644 (file)
index 0000000..6d819b4
--- /dev/null
@@ -0,0 +1,20 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "cps-and-ncmp.fullname" . }}-kafka-external
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: kafka-external
+spec:
+  type: NodePort  # Explicitly setting NodePort for external access
+  ports:
+    - name: internal
+      port: {{ .Values.kafka.externalService.ports.internal }}
+      targetPort: {{ .Values.kafka.externalService.ports.internal }}
+      nodePort: {{ .Values.kafka.externalService.nodePorts.internal }}
+    - name: external
+      port: {{ .Values.kafka.externalService.ports.external }}
+      targetPort: {{ .Values.kafka.externalService.ports.external }}
+      nodePort: {{ .Values.kafka.externalService.nodePorts.external }}
+  selector:
+    app: kafka
\ No newline at end of file
index cfb1eee..1a43f00 100644 (file)
@@ -29,8 +29,8 @@ cps:
     nodePort: 30080
   resources:
     limits:
-      cpu: "1"
-      memory: "1Gi"
+      cpu: "3"
+      memory: "3Gi"
   env:
     DB_HOST: "cps-cps-and-ncmp-postgresql"
     DB_USERNAME: "cps"
@@ -61,20 +61,23 @@ kafka:
     ports:
       external: 9092
       internal: 29092
+  externalService:
+    ports:
+      internal: 9092
+      external: 9093
+    nodePorts:
+      external: 30093  # Node port for external communication
   zookeeperConnect: "cps-cps-and-ncmp-zookeeper.default.svc.cluster.local"
   brokerId: 1
-  listeners: "INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092"
-  advertisedListeners: "INTERNAL://localhost:29092,EXTERNAL://cps-cps-and-ncmp-kafka:9092"
+  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-cps-and-ncmp-kafka:9092,NODEPORT://localhost:30093"
   interBrokerListenerName: "INTERNAL"
-  listenerSecurityProtocolMap: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
+  listenerSecurityProtocolMap: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,NODEPORT:PLAINTEXT"
   offsetsTopicReplicationFactor: 1
   resources:
     limits:
       cpu: "500m"
       memory: "1Gi"
-    requests:
-      cpu: "250m"
-      memory: "512Mi"
   healthcheck:
     enabled: true
     command: >
@@ -123,7 +126,7 @@ dmiStub:
     nodePort: 30092
   containerPort: 8092
   env:
-    KAFKA_BOOTSTRAP_SERVER: "cps-and-ncmp-kafka:29092"
+    KAFKA_BOOTSTRAP_SERVER: "cps-cps-and-ncmp-kafka.default.svc.cluster.local:9092"
     NCMP_CONSUMER_GROUP_ID: "ncmp-group"
     NCMP_ASYNC_M2M_TOPIC: "ncmp-async-m2m"
     MODULE_INITIAL_PROCESSING_DELAY_MS: 180000
@@ -133,11 +136,8 @@ dmiStub:
     WRITE_DATA_FOR_CM_HANDLE_DELAY_MS: 670
   resources:
     limits:
-      cpu: "500m"
-      memory: "512Mi"
-    requests:
-      cpu: "100m"
-      memory: "128Mi"
+      cpu: "3"
+      memory: "3Gi"
   livenessProbe:
     httpGet:
       path: /actuator/health/readiness