--- /dev/null
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
--- /dev/null
+apiVersion: v2
+name: cps-and-ncmp
+description: Helm chart for CPS and NCMP for testing purposes
+version: 0.1.0
+type: application
+appVersion: "1.0.0"
+home: "https://docs.onap.org/projects/onap-cps/en/latest/index.html"
+sources:
+ - "https://gerrit.onap.org/r/admin/repos/cps,general"
+maintainers:
+ - name: "CPS Team"
+ email: "cpsteam@est.tech"
--- /dev/null
+
+# CPS and NCMP Helm Chart
+This Helm chart deploys the **CPS** and **NCMP** ecosystem along with PostgreSQL, Kafka, Zookeeper, and the DMI Stub service.
+---
+## Prerequisites
+- Kubernetes cluster (tested on K8s 1.24+)
+- Helm 3.x
+- Access to the necessary Docker image registry (e.g., `nexus3.onap.org`)
+---
+## Installation
+To install the chart into the **default namespace**:
+```bash
+helm install cps-and-ncmp ./<chart-directory>
+```
+Replace <chart-directory> with the path to this Helm chart.
+You can verify the deployment using:
+```bash
+kubectl get all -l app.kubernetes.io/instance=cps-and-ncmp
+```
+---
+## Uninstallation
+To uninstall the chart and delete all related resources:
+```bash
+helm uninstall cps-and-ncmp
+```
+---
+## Port Forwarding
+You can access the services locally using kubectl port-forward.
+---
+## CPS and NCMP (API) Service
+```bash
+kubectl port-forward service/cps-and-ncmp 8080:8080
+```
+Once port forwarding is active, you can access the CPS/NCMP API at:
+http://localhost:8080
+---
+## DMI Stub Service
+```bash
+kubectl port-forward service/dmi-stub 8092:8092
+```
+Access the DMI stub API at:
+http://localhost:8092
+---
+## Default Credentials
+### PostgreSQL
+Database: cpsdb
+Username: cps
+Password: cps
+### DMI Stub
+Username: cpsuser
+Password: cpsr0cks!
+---
+## Configuration
+This chart includes default settings suitable for local development and testing. You can customize values using a custom values.yaml file or by passing --set parameters at install time.
+Example:
+```bash
+helm install cps-and-ncmp ./<chart-directory> --set cps.replicas=1
+```
+---
+## Chart Components
+This Helm chart deploys the following components:
+- postgresql: CPS database
+- cps-and-ncmp: CPS and NCMP backend services
+- kafka: Kafka message broker
+- zookeeper: Zookeeper coordination service for Kafka
+- dmi-stub: Stub service for NCMP device interactions
+---
--- /dev/null
+ALTER SYSTEM SET shared_buffers = '512MB';
\ No newline at end of file
--- /dev/null
+{{- define "cps-and-ncmp.name" -}}
+{{ .Chart.Name }}
+{{- end }}
+
+{{- define "cps-and-ncmp.fullname" -}}
+{{ .Release.Name }}-{{ .Chart.Name }}
+{{- end }}
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-cps
+spec:
+ replicas: {{ .Values.cps.replicas }}
+ selector:
+ matchLabels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: cps
+ template:
+ metadata:
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: cps
+ spec:
+ containers:
+ - name: cps
+ image: "{{ .Values.cps.image.repository }}:{{ .Values.cps.image.tag }}"
+ ports:
+ - containerPort: 8080
+ - containerPort: 5701
+ env:
+ - name: DB_HOST
+ value: "{{ .Values.cps.env.DB_HOST }}"
+ - name: DB_USERNAME
+ value: "{{ .Values.cps.env.DB_USERNAME }}"
+ - name: DB_PASSWORD
+ value: "{{ .Values.cps.env.DB_PASSWORD }}"
+ - name: DMI_USERNAME
+ value: "{{ .Values.cps.env.DMI_USERNAME }}"
+ - name: DMI_PASSWORD
+ value: "{{ .Values.cps.env.DMI_PASSWORD }}"
+ - name: KAFKA_BOOTSTRAP_SERVER
+ value: "{{ .Values.cps.env.KAFKA_BOOTSTRAP_SERVER }}"
+ - name: notification.enabled
+ value: "{{ .Values.cps.env.notification_enabled }}"
+ - name: ONAP_TRACING_ENABLED
+ value: "{{ .Values.cps.env.ONAP_TRACING_ENABLED }}"
+ - name: ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT
+ value: "{{ .Values.cps.env.ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT }}"
+ - name: ONAP_OTEL_EXPORTER_ENDPOINT
+ value: "{{ .Values.cps.env.ONAP_OTEL_EXPORTER_ENDPOINT }}"
+ - name: POLICY_SERVICE_ENABLED
+ value: "{{ .Values.cps.env.POLICY_SERVICE_ENABLED }}"
+ - name: POLICY_SERVICE_DEFAULT_DECISION
+ value: "{{ .Values.cps.env.POLICY_SERVICE_DEFAULT_DECISION }}"
+ - name: CPS_MONITORING_MICROMETER_JVM_EXTRAS
+ value: "{{ .Values.cps.env.CPS_MONITORING_MICROMETER_JVM_EXTRAS }}"
+ - name: JAVA_TOOL_OPTIONS
+ value: "{{ .Values.cps.env.JAVA_TOOL_OPTIONS }}"
+ - name: HAZELCAST_MODE_KUBERNETES_ENABLED
+ value: "{{ .Values.cps.env.HAZELCAST_MODE_KUBERNETES_ENABLED }}"
+ - name: CPS_NCMP_SERVICE_NAME
+ value: {{ include "cps-and-ncmp.name" . }}-cps-hazelcast
+ resources:
+ limits:
+ cpu: {{ .Values.cps.resources.limits.cpu }}
+ memory: {{ .Values.cps.resources.limits.memory }}
+ readinessProbe:
+ httpGet:
+ path: /actuator/health/readiness
+ port: 8080
+ initialDelaySeconds: 60
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 5
+ livenessProbe:
+ httpGet:
+ path: /actuator/health/liveness
+ port: 8080
+ initialDelaySeconds: 60
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 5
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.name" . }}-cps-hazelcast
+spec:
+ clusterIP: None
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: cps
+ ports:
+ - port: 5701
+ targetPort: 5701
+ protocol: TCP
+ name: hazelcast-port
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-cps
+spec:
+ type: {{ .Values.cps.service.type | default "ClusterIP" }}
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: cps
+ ports:
+ - port: {{ .Values.cps.servicePort }}
+ targetPort: 8080
+ nodePort: {{ .Values.cps.service.nodePort | default nil }}
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+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.containerPort }}
+ env:
+ {{- range $key, $value := .Values.dmiStub.env }}
+ - name: {{ $key }}
+ value: "{{ $value }}"
+ {{- end }}
+ resources:
+ {{- toYaml .Values.dmiStub.resources | nindent 12 }}
+ livenessProbe:
+ {{- toYaml .Values.dmiStub.livenessProbe | nindent 12 }}
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+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
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-kafka
+ labels:
+ app: kafka
+spec:
+ replicas: {{ .Values.kafka.replicaCount }}
+ selector:
+ matchLabels:
+ app: kafka
+ template:
+ metadata:
+ labels:
+ app: kafka
+ spec:
+ containers:
+ - name: kafka
+ image: "{{ .Values.kafka.image.repository }}:{{ .Values.kafka.image.tag }}"
+ imagePullPolicy: {{ .Values.kafka.image.pullPolicy }}
+ ports:
+ - containerPort: {{ .Values.kafka.service.ports.internal }}
+ name: internal
+ - containerPort: {{ .Values.kafka.service.ports.external }}
+ name: external
+ env:
+ - name: KAFKA_BROKER_ID
+ value: "{{ .Values.kafka.brokerId }}"
+ - name: KAFKA_ZOOKEEPER_CONNECT
+ value: "{{ .Values.kafka.zookeeperConnect }}:2181"
+ - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
+ value: "{{ .Values.kafka.listenerSecurityProtocolMap }}"
+ - name: KAFKA_LISTENERS
+ value: "{{ .Values.kafka.listeners }}"
+ - name: KAFKA_ADVERTISED_LISTENERS
+ value: "{{ .Values.kafka.advertisedListeners }}"
+ - name: KAFKA_INTER_BROKER_LISTENER_NAME
+ value: "{{ .Values.kafka.interBrokerListenerName }}"
+ - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
+ value: "{{ .Values.kafka.offsetsTopicReplicationFactor }}"
+ resources:
+ 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:
+ - kafka-topics
+ - --bootstrap-server
+ - localhost:{{ .Values.kafka.service.ports.internal }}
+ - --list
+ initialDelaySeconds: {{ .Values.kafka.healthcheck.startPeriod | default 30 }}
+ periodSeconds: {{ .Values.kafka.healthcheck.interval | default 10 }}
+ timeoutSeconds: {{ .Values.kafka.healthcheck.timeout | default 10 }}
+ failureThreshold: {{ .Values.kafka.healthcheck.retries | default 3 }}
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-kafka
+ labels:
+ app: kafka
+spec:
+ type: {{ .Values.kafka.service.type }}
+ ports:
+ - name: internal
+ port: {{ .Values.kafka.service.ports.internal }}
+ targetPort: {{ .Values.kafka.service.ports.internal }}
+ - name: external
+ port: {{ .Values.kafka.service.ports.external }}
+ targetPort: {{ .Values.kafka.service.ports.external }}
+ selector:
+ app: kafka
\ No newline at end of file
--- /dev/null
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: postgres-init-sql
+data:
+ postgres-init.sql: |-
+ {{ .Files.Get "config/postgres-init.sql" | indent 4 }}
\ No newline at end of file
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-postgresql
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: postgresql
+ template:
+ metadata:
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: postgresql
+ spec:
+ containers:
+ - name: postgresql
+ image: "{{ .Values.postgresql.image }}"
+ ports:
+ - containerPort: 5432
+ env:
+ - name: POSTGRES_DB
+ value: "{{ .Values.postgresql.env.POSTGRES_DB }}"
+ - name: POSTGRES_USER
+ value: "{{ .Values.postgresql.env.POSTGRES_USER }}"
+ - name: POSTGRES_PASSWORD
+ value: "{{ .Values.postgresql.env.POSTGRES_PASSWORD }}"
+ volumeMounts:
+ - name: init-sql
+ mountPath: {{ .Values.postgresql.initSql.mountPath }}
+ resources:
+ requests:
+ cpu: {{ .Values.postgresql.resources.requests.cpu }}
+ memory: {{ .Values.postgresql.resources.requests.memory }}
+ limits:
+ cpu: {{ .Values.postgresql.resources.limits.cpu }}
+ memory: {{ .Values.postgresql.resources.limits.memory }}
+ readinessProbe:
+ exec:
+ command:
+ - sh
+ - -c
+ - pg_isready -U {{ .Values.postgresql.env.POSTGRES_USER }} -d {{ .Values.postgresql.env.POSTGRES_DB }}
+ initialDelaySeconds: 10
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 10
+ volumes:
+ - name: init-sql
+ configMap:
+ name: {{ .Values.postgresql.initSql.configMapName }}
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-postgresql
+spec:
+ type: ClusterIP
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: postgresql
+ ports:
+ - port: {{ .Values.postgresql.servicePort }}
+ targetPort: 5432
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-zookeeper
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: zookeeper
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: zookeeper
+ template:
+ metadata:
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: zookeeper
+ spec:
+ containers:
+ - name: zookeeper
+ image: "{{ .Values.zookeeper.image.repository }}:{{ .Values.zookeeper.image.tag }}"
+ imagePullPolicy: {{ .Values.zookeeper.image.pullPolicy }}
+ ports:
+ - containerPort: {{ .Values.zookeeper.service.port }}
+ env:
+ - name: ZOOKEEPER_CLIENT_PORT
+ value: "{{ .Values.zookeeper.env.ZOOKEEPER_CLIENT_PORT }}"
+ readinessProbe:
+ exec:
+ command: {{ toJson .Values.zookeeper.healthcheck.command }}
+ initialDelaySeconds: {{ .Values.zookeeper.healthcheck.startPeriod | int }}
+ periodSeconds: {{ .Values.zookeeper.healthcheck.interval | int }}
+ timeoutSeconds: {{ .Values.zookeeper.healthcheck.timeout | int }}
+ failureThreshold: {{ .Values.zookeeper.healthcheck.retries | int }}
+ livenessProbe:
+ exec:
+ command: {{ toJson .Values.zookeeper.healthcheck.command }}
+ initialDelaySeconds: {{ .Values.zookeeper.healthcheck.startPeriod | int }}
+ periodSeconds: {{ .Values.zookeeper.healthcheck.interval | int }}
+ timeoutSeconds: {{ .Values.zookeeper.healthcheck.timeout | int }}
+ failureThreshold: {{ .Values.zookeeper.healthcheck.retries | int }}
+ resources:
+ limits:
+ cpu: {{ .Values.zookeeper.resources.limits.cpu }}
+ memory: {{ .Values.zookeeper.resources.limits.memory }}
+ requests:
+ cpu: {{ .Values.zookeeper.resources.requests.cpu }}
+ memory: {{ .Values.zookeeper.resources.requests.memory }}
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-zookeeper
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: zookeeper
+spec:
+ type: {{ .Values.zookeeper.service.type }}
+ ports:
+ - port: {{ .Values.zookeeper.service.port }}
+ targetPort: {{ .Values.zookeeper.service.port }}
+ protocol: TCP
+ name: client
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: zookeeper
--- /dev/null
+postgresql:
+ image: "postgres:14.1-alpine"
+ resources:
+ requests:
+ cpu: "1"
+ memory: "1Gi"
+ limits:
+ cpu: "1"
+ memory: "1Gi"
+ servicePort: 5432
+ env:
+ POSTGRES_DB: "cpsdb"
+ POSTGRES_USER: "cps"
+ POSTGRES_PASSWORD: "cps"
+ initSql:
+ enabled: true
+ configMapName: postgres-init-sql
+ mountPath: /docker-entrypoint-initdb.d
+
+cps:
+ image:
+ repository: "nexus3.onap.org:10003/onap/cps-and-ncmp"
+ tag: "latest"
+ replicas: 2
+ servicePort: 8080
+ service:
+ type: NodePort
+ port: 8080
+ nodePort: 30080
+ resources:
+ limits:
+ cpu: "1"
+ memory: "1Gi"
+ env:
+ DB_HOST: "cps-cps-and-ncmp-postgresql"
+ DB_USERNAME: "cps"
+ DB_PASSWORD: "cps"
+ DMI_USERNAME: "cpsuser"
+ DMI_PASSWORD: "cpsr0cks!"
+ KAFKA_BOOTSTRAP_SERVER: "cps-cps-and-ncmp-kafka.default.svc.cluster.local:9092"
+ notification_enabled: "true"
+ ONAP_TRACING_ENABLED: "false"
+ ONAP_OTEL_SAMPLER_JAEGER_REMOTE_ENDPOINT: "http://jaeger-service:14250"
+ ONAP_OTEL_EXPORTER_ENDPOINT: "http://jaeger-service:4317"
+ POLICY_SERVICE_ENABLED: "false"
+ POLICY_SERVICE_DEFAULT_DECISION: "deny from env"
+ CPS_MONITORING_MICROMETER_JVM_EXTRAS: "true"
+ JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0"
+ HAZELCAST_MODE_KUBERNETES_ENABLED: "true"
+
+kafka:
+ enabled: true
+ image:
+ repository: confluentinc/cp-kafka
+ tag: 7.8.0
+ pullPolicy: IfNotPresent
+ replicaCount: 1
+ service:
+ type: ClusterIP
+ ports:
+ external: 9092
+ internal: 29092
+ 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"
+ interBrokerListenerName: "INTERNAL"
+ listenerSecurityProtocolMap: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
+ offsetsTopicReplicationFactor: 1
+ resources:
+ limits:
+ cpu: "500m"
+ memory: "1Gi"
+ requests:
+ cpu: "250m"
+ memory: "512Mi"
+ healthcheck:
+ enabled: true
+ command: >
+ kafka-topics --bootstrap-server cps-cps-and-ncmp-kafka:29092 --list || exit 1
+ interval: 10
+ timeout: 10
+ retries: 3
+ startPeriod: 30
+
+zookeeper:
+ enabled: true
+ image:
+ repository: confluentinc/cp-zookeeper
+ tag: 7.8.0
+ pullPolicy: IfNotPresent
+ service:
+ type: ClusterIP
+ port: 2181
+ resources:
+ limits:
+ cpu: "500m"
+ memory: "1Gi"
+ requests:
+ cpu: "250m"
+ memory: "512Mi"
+ env:
+ ZOOKEEPER_CLIENT_PORT: 2181
+ healthcheck:
+ enabled: true
+ command: ["sh", "-c", "nc -z localhost 2181 || exit 1"]
+ interval: 10s
+ timeout: 10s
+ retries: 3
+ startPeriod: 30s
+
+dmiStub:
+ enabled: true
+ image:
+ repository: nexus3.onap.org:10003/onap/dmi-stub
+ tag: "1.8.0-SNAPSHOT"
+ pullPolicy: IfNotPresent
+ replicaCount: 1
+ service:
+ type: NodePort
+ port: 8092
+ nodePort: 30092
+ containerPort: 8092
+ env:
+ KAFKA_BOOTSTRAP_SERVER: "cps-and-ncmp-kafka:29092"
+ NCMP_CONSUMER_GROUP_ID: "ncmp-group"
+ NCMP_ASYNC_M2M_TOPIC: "ncmp-async-m2m"
+ MODULE_INITIAL_PROCESSING_DELAY_MS: "180000"
+ MODULE_REFERENCES_DELAY_MS: "100"
+ MODULE_RESOURCES_DELAY_MS: "1000"
+ READ_DATA_FOR_CM_HANDLE_DELAY_MS: "300"
+ WRITE_DATA_FOR_CM_HANDLE_DELAY_MS: "670"
+ resources:
+ limits:
+ cpu: "500m"
+ memory: "512Mi"
+ requests:
+ cpu: "100m"
+ memory: "128Mi"
+ livenessProbe:
+ httpGet:
+ path: /actuator/health/readiness
+ port: 8092
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ failureThreshold: 3