From f36dc4aa083d3feecc84293860cc598ccac116a0 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Tue, 14 Nov 2023 13:17:48 +0000 Subject: [PATCH] Add NONRTRIC rAppmanager HELM charts rAppmanager helm charts added. This version uses snapshot repo/image and it needs to be modified later once the release image is available. Issue-ID: NONRTRIC-953 Signed-off-by: aravind.est Change-Id: I6f83e8b4bcead410e92ba4aebea2659ffc31b3f7 --- bin/deploy-nonrtric | 3 +- nonrtric/RECIPE_EXAMPLE/example_recipe.yaml | 27 +++++++- nonrtric/helm/nonrtric/Chart.yaml | 6 ++ nonrtric/helm/nonrtric/values.yaml | 2 + nonrtric/helm/rappmanager/.helmignore | 22 ++++++ nonrtric/helm/rappmanager/Chart.yaml | 22 ++++++ nonrtric/helm/rappmanager/requirements.yaml | 21 ++++++ .../rappmanager/resources/config/application.yaml | 49 ++++++++++++++ nonrtric/helm/rappmanager/templates/configmap.yaml | 29 ++++++++ nonrtric/helm/rappmanager/templates/ingress.yaml | 39 +++++++++++ nonrtric/helm/rappmanager/templates/secret.yaml | 25 +++++++ nonrtric/helm/rappmanager/templates/service.yaml | 37 ++++++++++ .../helm/rappmanager/templates/statefulset.yaml | 79 ++++++++++++++++++++++ nonrtric/helm/rappmanager/values.yaml | 45 ++++++++++++ .../helm/nonrtric-common/templates/rappmanager.tpl | 24 +++++++ 15 files changed, 428 insertions(+), 2 deletions(-) create mode 100644 nonrtric/helm/rappmanager/.helmignore create mode 100644 nonrtric/helm/rappmanager/Chart.yaml create mode 100644 nonrtric/helm/rappmanager/requirements.yaml create mode 100644 nonrtric/helm/rappmanager/resources/config/application.yaml create mode 100644 nonrtric/helm/rappmanager/templates/configmap.yaml create mode 100644 nonrtric/helm/rappmanager/templates/ingress.yaml create mode 100755 nonrtric/helm/rappmanager/templates/secret.yaml create mode 100644 nonrtric/helm/rappmanager/templates/service.yaml create mode 100644 nonrtric/helm/rappmanager/templates/statefulset.yaml create mode 100644 nonrtric/helm/rappmanager/values.yaml create mode 100644 ric-common/Common-Template/helm/nonrtric-common/templates/rappmanager.tpl diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric index eda170e8..ee118a0c 100755 --- a/bin/deploy-nonrtric +++ b/bin/deploy-nonrtric @@ -1,6 +1,7 @@ #!/bin/bash ################################################################################ # Copyright (c) 2023 Nordix Foundation. # +# Copyright (C) 2023 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. # @@ -106,7 +107,7 @@ rm $HELM_LOCAL_REPO/* helm repo remove local $ROOT_DIR/prepare-common-templates -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm" +COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm rappmanager" for component in $COMPONENTS; do echo "Packaging NONRTRIC component [$component]" helm dep up $ROOT_DIR/../nonrtric/helm/$component diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index 2851708c..e1da6e3c 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -1,5 +1,6 @@ ################################################################################ # Copyright (c) 2023 Nordix Foundation. # +# Copyright (C) 2023 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. # @@ -37,6 +38,7 @@ nonrtric: installRansliceassurance: true installCapifcore: true installRanpm: true + installrAppmanager: true volume1: # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) @@ -374,4 +376,27 @@ capifcore: tag: 1.1.0 env: chart_museum_url: "http://chartmuseum:8080" - repo_name: "capifcore" \ No newline at end of file + repo_name: "capifcore" + +rappmanager: + rappmanager: + imagePullPolicy: IfNotPresent + image: + registry: "nexus3.o-ran-sc.org:10003/o-ran-sc" + name: nonrtric-plt-rappmanager + tag: 0.0.1-SNAPSHOT + service: + httpName: http + internalPort1: 8080 + targetPort1: 8080 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + ingress: + enabled: true + acm: + username: cnVudGltZVVzZXI= + password: emIhWHp0RzM0 diff --git a/nonrtric/helm/nonrtric/Chart.yaml b/nonrtric/helm/nonrtric/Chart.yaml index 2cb1aaf7..af3e5e10 100644 --- a/nonrtric/helm/nonrtric/Chart.yaml +++ b/nonrtric/helm/nonrtric/Chart.yaml @@ -1,5 +1,6 @@ ################################################################################ # Copyright (c) 2020 Nordix Foundation. # +# Copyright (C) 2023 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. # @@ -94,3 +95,8 @@ dependencies: version: ~1.0.0 repository: "@local" condition: nonrtric.installCapifcore + + - name: rappmanager + version: ~1.0.0 + repository: "@local" + condition: nonrtric.installrAppmanager diff --git a/nonrtric/helm/nonrtric/values.yaml b/nonrtric/helm/nonrtric/values.yaml index c8206996..c2f97c6a 100644 --- a/nonrtric/helm/nonrtric/values.yaml +++ b/nonrtric/helm/nonrtric/values.yaml @@ -1,5 +1,6 @@ ################################################################################ # Copyright (c) 2020 Nordix Foundation. # +# Copyright (C) 2023 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. # @@ -29,6 +30,7 @@ nonrtric: installOrufhrecovery: true installRansliceassurance: true installCapifcore: true + installrAppmanager: true volume1: size: 1Gi diff --git a/nonrtric/helm/rappmanager/.helmignore b/nonrtric/helm/rappmanager/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/nonrtric/helm/rappmanager/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/nonrtric/helm/rappmanager/Chart.yaml b/nonrtric/helm/rappmanager/Chart.yaml new file mode 100644 index 00000000..45c78f44 --- /dev/null +++ b/nonrtric/helm/rappmanager/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +appVersion: "2.0.0" +description: A Helm chart for rAppmanager +name: rappmanager +version: 1.0.0 diff --git a/nonrtric/helm/rappmanager/requirements.yaml b/nonrtric/helm/rappmanager/requirements.yaml new file mode 100644 index 00000000..d0fba08b --- /dev/null +++ b/nonrtric/helm/rappmanager/requirements.yaml @@ -0,0 +1,21 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +dependencies: + - name: nonrtric-common + version: ^2.0.0 + repository: "@local" diff --git a/nonrtric/helm/rappmanager/resources/config/application.yaml b/nonrtric/helm/rappmanager/resources/config/application.yaml new file mode 100644 index 00000000..813325eb --- /dev/null +++ b/nonrtric/helm/rappmanager/resources/config/application.yaml @@ -0,0 +1,49 @@ +################################################################################ +# Copyright (C) 2023 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. # +################################################################################ + +rappmanager: + csarlocation: /opt/app/rappmanager/csar + acm: + baseurl: http://policy-clamp-runtime-acm.default:6969/onap/policy/clamp/acm/v2/ + maxRetries: 10 + retryInterval: 2 #seconds + sme: + baseurl: http://capifcore:8090 + providerBasePath: /api-provider-management/v1/ + invokerBasePath: /api-invoker-management/v1/ + publishApiBasePath: /published-apis/v1/ + maxRetries: 3 + retryInterval: 2 #seconds + dme: + baseurl: http://informationservice:9082 + +spring: + jackson: + default-property-inclusion: non_null + +logging: + level: + root: INFO + com.oransc: DEBUG + org.apache.http: DEBUG + httpclient.wire: DEBUG + org.springframework.web.client.RestTemplate: TRACE + +management: + endpoints: + web: + exposure: + include: "*" \ No newline at end of file diff --git a/nonrtric/helm/rappmanager/templates/configmap.yaml b/nonrtric/helm/rappmanager/templates/configmap.yaml new file mode 100644 index 00000000..8130fbbf --- /dev/null +++ b/nonrtric/helm/rappmanager/templates/configmap.yaml @@ -0,0 +1,29 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.name.rappmanager" . }}-configmap-config + namespace: {{ include "common.namespace.nonrtric" . }} + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/nonrtric/helm/rappmanager/templates/ingress.yaml b/nonrtric/helm/rappmanager/templates/ingress.yaml new file mode 100644 index 00000000..3ab75f6a --- /dev/null +++ b/nonrtric/helm/rappmanager/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{/* +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# +*/}} + +{{- if .Values.rappmanager.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "common.name.rappmanager" . }} + namespace: {{ include "common.namespace.nonrtric" . }} + +spec: + ingressClassName: {{ include "common.ingressClassName" . }} + rules: + - http: + paths: + - backend: + service: + name: {{ include "common.name.rappmanager" . }} + port: + number: {{ .Values.rappmanager.service.internalPort1 }} + path: "/rapps" + pathType: Prefix +{{- end -}} \ No newline at end of file diff --git a/nonrtric/helm/rappmanager/templates/secret.yaml b/nonrtric/helm/rappmanager/templates/secret.yaml new file mode 100755 index 00000000..a8cbfc14 --- /dev/null +++ b/nonrtric/helm/rappmanager/templates/secret.yaml @@ -0,0 +1,25 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.name.rappmanager" . }}-acm-secret +type: Opaque +data: + username: {{ .Values.rappmanager.acm.username }} + password: {{ .Values.rappmanager.acm.password }} diff --git a/nonrtric/helm/rappmanager/templates/service.yaml b/nonrtric/helm/rappmanager/templates/service.yaml new file mode 100644 index 00000000..e1062ff4 --- /dev/null +++ b/nonrtric/helm/rappmanager/templates/service.yaml @@ -0,0 +1,37 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +kind: Service +apiVersion: v1 +metadata: + name: {{ include "common.name.rappmanager" . }} + namespace: {{ include "common.namespace.nonrtric" . }} + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + ports: + - name: {{ index .Values.rappmanager.service.httpName }} + port: {{ .Values.rappmanager.service.internalPort1 }} + targetPort: {{ .Values.rappmanager.service.targetPort1 }} + protocol: TCP + selector: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + release: {{ .Release.Name }} + type: ClusterIP diff --git a/nonrtric/helm/rappmanager/templates/statefulset.yaml b/nonrtric/helm/rappmanager/templates/statefulset.yaml new file mode 100644 index 00000000..dccb2859 --- /dev/null +++ b/nonrtric/helm/rappmanager/templates/statefulset.yaml @@ -0,0 +1,79 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +kind: StatefulSet +apiVersion: apps/v1 +metadata: + name: {{ include "common.name.rappmanager" . }} + namespace: {{ include "common.namespace.nonrtric" . }} + generation: 1 + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + deployment.kubernetes.io/revision: '1' +spec: + serviceName: {{ include "common.name.rappmanager" . }} + replicas: 1 + selector: + matchLabels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.rappmanager" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.name.rappmanager" . }} + containers: + - name: {{ include "common.container.rappmanager" . }} + image: {{ .Values.rappmanager.image.registry }}/{{ .Values.rappmanager.image.name }}:{{ .Values.rappmanager.image.tag }} + imagePullPolicy: {{ .Values.rappmanager.imagePullPolicy }} + ports: + - containerPort: {{ .Values.rappmanager.service.targetPort1 }} + protocol: TCP + readinessProbe: + tcpSocket: + port: {{ .Values.rappmanager.service.targetPort1 }} + initialDelaySeconds: {{ .Values.rappmanager.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.rappmanager.liveness.periodSeconds }} + livenessProbe: + tcpSocket: + port: {{ .Values.rappmanager.service.targetPort1 }} + initialDelaySeconds: {{ .Values.rappmanager.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.rappmanager.liveness.periodSeconds }} + env: + - name: RAPPMANAGER_ACM_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "common.name.rappmanager" . }}-acm-secret + key: username + - name: RAPPMANAGER_ACM_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "common.name.rappmanager" . }}-acm-secret + key: password + volumeMounts: + - name: {{ include "common.name.rappmanager" . }}-rappmanager-config + mountPath: /opt/app/rappmanager/config + volumes: + - name: {{ include "common.name.rappmanager" . }}-rappmanager-config + configMap: + name: {{ include "common.name.rappmanager" . }}-configmap-config diff --git a/nonrtric/helm/rappmanager/values.yaml b/nonrtric/helm/rappmanager/values.yaml new file mode 100644 index 00000000..4fcb3c17 --- /dev/null +++ b/nonrtric/helm/rappmanager/values.yaml @@ -0,0 +1,45 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2023 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. +# ============LICENSE_END================================================= +# + +# Default values for rApp Manager. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +rappmanager: + imagePullPolicy: IfNotPresent + image: + registry: "nexus3.o-ran-sc.org:10002/o-ran-sc" + name: nonrtric-plt-rappmanager + tag: 1.0.0 + service: + httpName: http + internalPort1: 8080 + targetPort1: 8080 + liveness: + initialDelaySeconds: 20 + periodSeconds: 10 + readiness: + initialDelaySeconds: 20 + periodSeconds: 10 + persistence: + size: 2Gi + storageClassName: standard + ingress: + enabled: false + acm: + username: cnVudGltZVVzZXI= + password: emIhWHp0RzM0 diff --git a/ric-common/Common-Template/helm/nonrtric-common/templates/rappmanager.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/rappmanager.tpl new file mode 100644 index 00000000..4d6e9895 --- /dev/null +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/rappmanager.tpl @@ -0,0 +1,24 @@ +################################################################################ +# Copyright (C) 2023 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. # +################################################################################ + +{{- define "common.name.rappmanager" -}} + {{- printf "rappmanager" -}} +{{- end -}} + +{{- define "common.container.rappmanager" -}} + {{- $name := ( include "common.name.rappmanager" . ) -}} + {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} -- 2.16.6