Add policy executor stub container to kubernetes deployment 64/143164/3
authorseanbeirne <sean.beirne@est.tech>
Wed, 11 Feb 2026 15:44:38 +0000 (15:44 +0000)
committerseanbeirne <sean.beirne@est.tech>
Tue, 17 Feb 2026 11:01:20 +0000 (11:01 +0000)
- Updated readme to enable policy executor

Issue-ID: CPS-3108
Change-Id: I220eaa1879f4902fcd5f55a513e8488a3d42cbeb
Signed-off-by: seanbeirne <sean.beirne@est.tech>
cps-charts/README.md
cps-charts/templates/policy-executor-stub-deployment.yaml [new file with mode: 0644]
cps-charts/templates/policy-executor-stub-service.yaml [new file with mode: 0644]
cps-charts/values.yaml
k6-tests/k6-main.sh
policy-executor-stub/src/main/resources/application.yml

index 4231780..b9f6855 100644 (file)
@@ -34,6 +34,10 @@ helm install cps ./<chart-directory>
 ```
 Replace <chart-directory> with the path to this Helm chart.
 
+To install with policy executor checking enabled
+```bash
+helm install cps ./<chart-directory> --set cps.env.POLICY_SERVICE_ENABLED=true
+```
 ---
 
 ## check deployment status
@@ -71,4 +75,5 @@ 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
+- policy-executor-stub: Stub service for Policy Executor interactions
 ---
\ No newline at end of file
diff --git a/cps-charts/templates/policy-executor-stub-deployment.yaml b/cps-charts/templates/policy-executor-stub-deployment.yaml
new file mode 100644 (file)
index 0000000..d0fe8a8
--- /dev/null
@@ -0,0 +1,32 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "cps-and-ncmp.release-name" . }}-policy-executor-stub
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: policy-executor-stub
+spec:
+  replicas: {{ .Values.policyExecutorStub.replicaCount }}
+  selector:
+    matchLabels:
+      app: {{ include "cps-and-ncmp.name" . }}
+      component: policy-executor-stub
+      instance: policy-executor-stub
+  template:
+    metadata:
+      labels:
+        app: {{ include "cps-and-ncmp.name" . }}
+        component: policy-executor-stub
+        instance: policy-executor-stub
+    spec:
+      containers:
+        - name: policy-executor-stub
+          image: "{{ .Values.policyExecutorStub.image.repository }}:{{ .Values.policyExecutorStub.image.tag }}"
+          imagePullPolicy: {{ .Values.policyExecutorStub.image.pullPolicy }}
+          ports:
+            - containerPort: {{ .Values.policyExecutorStub.service.port }}
+          env:
+            - name: POLICY_SERVICE_PORT
+              value: "{{ .Values.policyExecutorStub.service.port }}"
+          resources:
+            {{ toYaml .Values.policyExecutorStub.resources | nindent 12 }}
\ No newline at end of file
diff --git a/cps-charts/templates/policy-executor-stub-service.yaml b/cps-charts/templates/policy-executor-stub-service.yaml
new file mode 100644 (file)
index 0000000..4f50c4e
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "cps-and-ncmp.release-name" . }}-policy-executor-stub-service
+  labels:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: policy-executor-stub
+spec:
+  type: {{ .Values.policyExecutorStub.service.type }}
+  ports:
+    - port: {{ .Values.policyExecutorStub.service.port }}
+      targetPort: {{ .Values.policyExecutorStub.service.port }}
+      protocol: TCP
+      name: http
+      {{- if and (eq .Values.policyExecutorStub.service.type "NodePort") .Values.policyExecutorStub.service.nodePort }}
+      nodePort: {{ .Values.policyExecutorStub.service.nodePort }}
+      {{- end }}
+  selector:
+    app: {{ include "cps-and-ncmp.name" . }}
+    component: policy-executor-stub
+    instance: policy-executor-stub
\ No newline at end of file
index d087ab5..33a5a71 100644 (file)
@@ -103,6 +103,8 @@ cps:
     ONAP_OTEL_EXPORTER_ENDPOINT: "http://jaeger-service:4317"
     POLICY_SERVICE_ENABLED: "false"
     POLICY_SERVICE_DEFAULT_DECISION: "deny from env"
+    POLICY_SERVICE_PORT: "8094"
+    POLICY_SERVICE_URL: "http://cps-ncmp-policy-executor-stub-service"
     CPS_MONITORING_MICROMETER_JVM_EXTRAS: "true"
     JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
     HAZELCAST_MODE_KUBERNETES_ENABLED: "true"
@@ -244,4 +246,23 @@ dmiStub:
     failureThreshold: 3
     timeoutSeconds: 5
 
-
+policyExecutorStub:
+  enabled: true
+  image:
+    repository: nexus3.onap.org:10003/onap/policy-executor-stub
+    tag: "latest"
+    pullPolicy: IfNotPresent
+  replicaCount: 1
+  service:
+    type: NodePort
+    port: 8094
+    nodePort: 30095
+  env:
+    POLICY_SERVICE_PORT: 8094
+  resources:
+    requests:
+      cpu: "100m"
+      memory: "350Mi"
+    limits:
+      cpu: "1000m"
+      memory: "2Gi"
\ No newline at end of file
index 8e49702..ad56776 100755 (executable)
@@ -41,7 +41,7 @@ trap on_exit EXIT SIGINT SIGTERM SIGQUIT
 pushd "$(dirname "$0")" || exit 1
 
 # Install needed dependencies for any deployment type
-source install-deps.sh "$deploymentType"
+source ./install-deps.sh "$deploymentType"
 
 # Handle deployment type specific setup
 if [[ "$deploymentType" == "dockerHosts" ]]; then
index 8ed5742..9d9dcfa 100644 (file)
@@ -16,4 +16,4 @@
 #  ============LICENSE_END=========================================================
 
 server:
-    port: 8093
+    port: ${POLICY_SERVICE_PORT:8093}