From: seanbeirne Date: Wed, 11 Feb 2026 15:44:38 +0000 (+0000) Subject: Add policy executor stub container to kubernetes deployment X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=5224281ce87ba9acab737b032ef5ba6bd14ff970;p=cps.git Add policy executor stub container to kubernetes deployment - Updated readme to enable policy executor Issue-ID: CPS-3108 Change-Id: I220eaa1879f4902fcd5f55a513e8488a3d42cbeb Signed-off-by: seanbeirne --- diff --git a/cps-charts/README.md b/cps-charts/README.md index 42317801c5..b9f685559c 100644 --- a/cps-charts/README.md +++ b/cps-charts/README.md @@ -34,6 +34,10 @@ helm install cps ./ ``` Replace with the path to this Helm chart. +To install with policy executor checking enabled +```bash +helm install cps ./ --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 index 0000000000..d0fe8a8ac8 --- /dev/null +++ b/cps-charts/templates/policy-executor-stub-deployment.yaml @@ -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 index 0000000000..4f50c4ee74 --- /dev/null +++ b/cps-charts/templates/policy-executor-stub-service.yaml @@ -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 diff --git a/cps-charts/values.yaml b/cps-charts/values.yaml index d087ab5981..33a5a71ca3 100644 --- a/cps-charts/values.yaml +++ b/cps-charts/values.yaml @@ -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 diff --git a/k6-tests/k6-main.sh b/k6-tests/k6-main.sh index 8e4970212c..ad56776c1e 100755 --- a/k6-tests/k6-main.sh +++ b/k6-tests/k6-main.sh @@ -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 diff --git a/policy-executor-stub/src/main/resources/application.yml b/policy-executor-stub/src/main/resources/application.yml index 8ed5742a41..9d9dcfaf53 100644 --- a/policy-executor-stub/src/main/resources/application.yml +++ b/policy-executor-stub/src/main/resources/application.yml @@ -16,4 +16,4 @@ # ============LICENSE_END========================================================= server: - port: 8093 + port: ${POLICY_SERVICE_PORT:8093}