From 7b3f31e512052357f6047472bdc65b3ff43dcbe6 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Tue, 23 Apr 2024 10:41:44 +0100 Subject: Add Participant Simulator chart Issue-ID: POLICY-4966 Change-Id: Id35a270be449c35cd8b2281c74457d36e1f65385 Signed-off-by: FrancescoFioraEst --- helm/policy/Chart.yaml | 6 +- .../components/policy-clamp-ac-sim-ppnt/Chart.yaml | 22 ++++ .../config/SimulatorParticipantParameters.yaml | 69 ++++++++++++ .../resources/config/logback.xml | 103 +++++++++++++++++ .../templates/configmap.yaml | 32 ++++++ .../templates/deployment.yaml | 124 +++++++++++++++++++++ .../templates/role-binding.yaml | 33 ++++++ .../templates/secrets.yaml | 33 ++++++ .../templates/service-account.yaml | 25 +++++ .../templates/service.yaml | 42 +++++++ .../policy-clamp-ac-sim-ppnt/values.yaml | 89 +++++++++++++++ helm/policy/values.yaml | 3 + 12 files changed, 580 insertions(+), 1 deletion(-) create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/Chart.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/logback.xml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/configmap.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/deployment.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/role-binding.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/secrets.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service-account.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service.yaml create mode 100644 helm/policy/components/policy-clamp-ac-sim-ppnt/values.yaml (limited to 'helm') diff --git a/helm/policy/Chart.yaml b/helm/policy/Chart.yaml index 91553112..6947078b 100755 --- a/helm/policy/Chart.yaml +++ b/helm/policy/Chart.yaml @@ -1,4 +1,4 @@ -# Copyright © 2022-2023 Nordix Foundation +# Copyright © 2022-2024 Nordix Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -66,6 +66,10 @@ dependencies: version: ~11.x-0 repository: 'file://components/policy-clamp-ac-http-ppnt' condition: policy-clamp-ac-http-ppnt.enabled + - name: policy-clamp-ac-sim-ppnt + version: ~11.x-0 + repository: 'file://components/policy-clamp-ac-sim-ppnt' + condition: policy-clamp-ac-sim-ppnt.enabled - name: policy-clamp-ac-kserve-ppnt version: ~11.x-0 repository: 'file://components/policy-clamp-ac-kserve-ppnt' diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/Chart.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/Chart.yaml new file mode 100644 index 00000000..4958bad3 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. +# ================================================================================ +# 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========================================================= + +apiVersion: v2 +description: ONAP Policy Clamp ACM Simulator Participant +name: policy-clamp-ac-sim-ppnt +version: 11.0.0 \ No newline at end of file diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml new file mode 100644 index 00000000..0b874d99 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/SimulatorParticipantParameters.yaml @@ -0,0 +1,69 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. +# ================================================================================ +# 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========================================================= + +spring: + autoconfigure: + exclude: + - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration + - org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration + - org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration + security: + user: + name: ${RESTSERVER_USER} + password: ${RESTSERVER_PASSWORD} + +security: + enable-csrf: false + +participant: + intermediaryParameters: + reportingTimeIntervalMs: 120000 + description: Participant Description + participantId: 101c62b3-8918-41b9-a747-d21eb79c6c90 + clampAutomationCompositionTopics: + topicSources: + - topic: policy-acruntime-participant + servers: + - "{{ .Values.global.kafkaServer }}:9092" + topicCommInfrastructure: kafka + fetchTimeout: 15000 + useHttps: false + topicSinks: + - topic: policy-acruntime-participant + servers: + - "{{ .Values.global.kafkaServer }}:9092" + topicCommInfrastructure: kafka + useHttps: false + participantSupportedElementTypes: + - + typeName: org.onap.policy.clamp.acm.SimAutomationCompositionElement + typeVersion: 1.0.0 + +management: + endpoints: + web: + base-path: / + exposure: + include: health, metrics, prometheus +server: + port: 6969 + servlet: + context-path: /onap/policy/simparticipant + ssl: + enabled: false diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/logback.xml b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/logback.xml new file mode 100644 index 00000000..38155c9a --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/resources/config/logback.xml @@ -0,0 +1,103 @@ + + + + + + /var/log/onap/policy/sim-participant/error.log + + /var/log/onap/policy/sim-participant/error.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + WARN + + + [%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n + + + + + + + + + /var/log/onap/policy/sim-participant/debug.log + + /var/log/onap/policy/sim-participant/debug.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + [%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n + + + + + + + + + /var/log/onap/policy/sim-participant/network.log + + /var/log/onap/policy/sim-participant/network.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + [%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%t]%m%n + + + + + + + + + + [%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/configmap.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/configmap.yaml new file mode 100644 index 00000000..34fe4046 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/configmap.yaml @@ -0,0 +1,32 @@ +{{/* +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. 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========================================================= +*/}} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-configmap + namespace: default + labels: + app: {{ .Chart.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: release + heritage: Helm +data: +{{ tpl (.Files.Glob "resources/config/*.{xml,yaml}").AsConfig . | indent 2 }} diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/deployment.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/deployment.yaml new file mode 100644 index 00000000..65260edd --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/deployment.yaml @@ -0,0 +1,124 @@ +{{/* +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. +# ================================================================================ +# 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========================================================= +*/}} + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }} + namespace: default + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + app.kubernetes.io/instance: release + app.kubernetes.io/managed-by: Helm +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: release + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + app.kubernetes.io/instance: release + app.kubernetes.io/managed-by: Helm + name: {{ .Chart.Name }} + spec: + initContainers: + - command: + - sh + args: + - -c + - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" + env: + - name: RESTSERVER_USER + valueFrom: + secretKeyRef: + name: {{ .Chart.Name }}-restserver-secret + key: login + - name: RESTSERVER_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Chart.Name }}-restserver-secret + key: password + + volumeMounts: + - mountPath: /config-input + name: ac-sim-ppnt-config + - mountPath: /config + name: ac-sim-ppnt-config-processed + image: docker.io/dibi/envsubst:1 + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ .Chart.Name }}-update-config + containers: + - name: {{ .Chart.Name }} + image: {{ .Values.global.repository }}/{{ .Values.global.image.simparticipant }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: ["/opt/app/policy/clamp/bin/sim-participant.sh"] + args: ["/opt/app/policy/clamp/etc/mounted/SimulatorParticipantParameters.yaml"] + ports: + - containerPort: 6969 + name: http-api + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.liveness.port }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.readiness.port }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/policy/clamp/etc/mounted + name: ac-sim-ppnt-config-processed + resources: +{{ toYaml .Values.resources.small | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + serviceAccountName: {{ .Chart.Name }}-read + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: ac-sim-ppnt-config + configMap: + name: {{ .Chart.Name }}-configmap + defaultMode: 0755 + - name: ac-sim-ppnt-config-processed + emptyDir: + medium: Memory + imagePullSecrets: + - name: "default-docker-registry-key" diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/role-binding.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/role-binding.yaml new file mode 100644 index 00000000..b7d101a3 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/role-binding.yaml @@ -0,0 +1,33 @@ +{{/* +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. 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========================================================= +*/}} + +apiVersion: rbac.authorization.k8s.io/v1 +# This cluster role binding allows anyone in the "manager" group to read secrets in any namespace. +kind: RoleBinding +metadata: + name: {{ .Chart.Name }}-read + namespace: default +subjects: + - kind: ServiceAccount + name: {{ .Chart.Name }}-read +roleRef: + kind: Role + name: release-read + apiGroup: rbac.authorization.k8s.io diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/secrets.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/secrets.yaml new file mode 100644 index 00000000..fb95316f --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/secrets.yaml @@ -0,0 +1,33 @@ +{{/* +#Copyright (C) 2024 Nordix Foundation. 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. +*/}} + +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Chart.Name }}-restserver-secret + namespace: default + labels: + app: {{ .Chart.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: release + heritage: Helm +type: Opaque +stringData: + login: {{ .Values.restServer.user }} + password: {{ .Values.restServer.password }} + + + diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service-account.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service-account.yaml new file mode 100644 index 00000000..b68ccb2b --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service-account.yaml @@ -0,0 +1,25 @@ +{{/* +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. 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========================================================= +*/}} + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Chart.Name }}-read \ No newline at end of file diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service.yaml new file mode 100644 index 00000000..d85f2317 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/templates/service.yaml @@ -0,0 +1,42 @@ +{{/* +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. 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========================================================= +*/}} + +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} + namespace: default + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + app.kubernetes.io/instance: release + app.kubernetes.io/managed-by: Helm +spec: + ports: + - port: {{ .Values.service.ports.port }} + targetPort: {{ .Values.service.ports.port }} + protocol: TCP + name: {{ .Values.service.ports.name }} + ipFamilyPolicy: PreferDualStack + type: {{ .Values.service.type }} + selector: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: release + sessionAffinity: None diff --git a/helm/policy/components/policy-clamp-ac-sim-ppnt/values.yaml b/helm/policy/components/policy-clamp-ac-sim-ppnt/values.yaml new file mode 100644 index 00000000..45fccdd0 --- /dev/null +++ b/helm/policy/components/policy-clamp-ac-sim-ppnt/values.yaml @@ -0,0 +1,89 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. +# ================================================================================ +# 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========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + persistence: {} + aafEnabled: false + +################################################################# +# Application configuration defaults. +################################################################# +# application image +pullPolicy: Always + +# application configuration +restServer: + user: participantUser + password: zb!XztG34 + +# flag to enable debugging - application support required +debugEnabled: false + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} +ingress: + enabled: false + +# probe configuration parameters +liveness: + initialDelaySeconds: 50 + periodSeconds: 10 + failureThreshold: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + port: http-api + +readiness: + initialDelaySeconds: 50 + periodSeconds: 10 + failureThreshold: 10 + port: http-api + +service: + type: ClusterIP + name: policy-clamp-ac-sim-ppnt + useNodePortExt: true + ports: + name: http-api + port: 6969 + nodePort: 42 + +flavor: small +resources: + small: + limits: + cpu: 1 + memory: 4Gi + requests: + cpu: 100m + memory: 1Gi + unlimited: {} +#Pods Service Account +serviceAccount: + nameOverride: policy-clamp-ac-sim-ppnt + roles: + - read + diff --git a/helm/policy/values.yaml b/helm/policy/values.yaml index 10d89199..86dfbeab 100755 --- a/helm/policy/values.yaml +++ b/helm/policy/values.yaml @@ -47,6 +47,7 @@ global: k8sparticipant: onap/policy-clamp-ac-k8s-ppnt:$tag pfparticipant: onap/policy-clamp-ac-pf-ppnt:$tag httpparticipant: onap/policy-clamp-ac-http-ppnt:$tag + simparticipant: onap/policy-clamp-ac-sim-ppnt:$tag a1pmsparticipant: onap/policy-clamp-ac-a1pms-ppnt:$tag policy-mariadb-galera: @@ -73,6 +74,8 @@ policy-distribution: enabled: false policy-clamp-ac-http-ppnt: enabled: false +policy-clamp-ac-sim-ppnt: + enabled: false policy-clamp-ac-kserve-ppnt: enabled: false policy-clamp-ac-a1pms-ppnt: -- cgit 1.2.3-korg