NONRTRIC-979: ServiceManager - deployment and undeployment 27/12627/6
authorDenisGNoonan <denis.noonan@est.tech>
Tue, 26 Mar 2024 14:46:10 +0000 (14:46 +0000)
committerDenisGNoonan <denis.noonan@est.tech>
Thu, 11 Apr 2024 09:14:22 +0000 (10:14 +0100)
Issue-ID: NONRTRIC-979
Change-Id: Iaad4a822a319d73bf7b248f493436c858a5e6e93
Signed-off-by: DenisGNoonan <denis.noonan@est.tech>
17 files changed:
bin/deploy-nonrtric
bin/undeploy-nonrtric
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
nonrtric/helm/kongstorage/Chart.yaml [new file with mode: 0644]
nonrtric/helm/kongstorage/kongvalues.yaml [new file with mode: 0644]
nonrtric/helm/kongstorage/templates/kongpv.yaml [new file with mode: 0644]
nonrtric/helm/kongstorage/templates/kongpvc.yaml [new file with mode: 0644]
nonrtric/helm/kongstorage/values.yaml [new file with mode: 0644]
nonrtric/helm/nonrtric/Chart.yaml
nonrtric/helm/nonrtric/values.yaml
nonrtric/helm/servicemanager/Chart.yaml [new file with mode: 0644]
nonrtric/helm/servicemanager/requirements.yaml [new file with mode: 0644]
nonrtric/helm/servicemanager/templates/configmap.yaml [new file with mode: 0644]
nonrtric/helm/servicemanager/templates/deployment.yaml [new file with mode: 0644]
nonrtric/helm/servicemanager/templates/service.yaml [new file with mode: 0644]
nonrtric/helm/servicemanager/values.yaml [new file with mode: 0644]
ric-common/Common-Template/helm/nonrtric-common/templates/servicemanager.tpl [new file with mode: 0644]

index 59d5911..2125ef3 100755 (executable)
@@ -114,7 +114,26 @@ curl --data-binary @/tmp/nonrtric-common-$NONRTRIC_COMMON_CHART_VERSION.tgz $CM_
 
 charts_already_exists=()
 
-COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore rappmanager dmeparticipant"
+COMPONENTS="
+a1controller \
+a1simulator \
+capifcore \
+controlpanel \
+dmaapadapterservice \
+dmaapmediatorservice \
+dmeparticipant \
+helmmanager \
+informationservice \
+nonrtricgateway \
+orufhrecovery \
+policymanagementservice \
+ransliceassurance \
+rappcatalogueenhancedservice \
+rappcatalogueservice \
+rappmanager \
+servicemanager \
+"
+
 for component in $COMPONENTS; do
     echo "Packaging NONRTRIC component [$component]"
     helm dep up $ROOT_DIR/../nonrtric/helm/$component
@@ -155,17 +174,26 @@ INSTALL_RANPM=$(cat $OVERRIDEYAML | awk '/^  installRanpm:/{print $2}')
 if ! kubectl get ns ${NONRTRIC_NAMESPACE:-nonrtric}> /dev/null 2>&1; then
     kubectl create ns ${NONRTRIC_NAMESPACE:-nonrtric}
 fi
+
 if ! kubectl get ns onap > /dev/null 2>&1; then
     kubectl create ns onap
 fi
 
+HELM_NAME_OPT=""
+if [ -z $IS_HELM3 ];then
+   HELM_NAME_OPT="--name"
+fi
+
 echo "Install Kong- $INSTALL_KONG"
 
 if [ "$INSTALL_KONG" = true ];then
-   echo "Installing Kong"
-   helm repo add kong https://charts.konghq.com --force-update
-   helm repo update
-   helm install kong-nonrtric --namespace ${NONRTRIC_NAMESPACE:-nonrtric} kong/kong --set ingressController.installCRDs=false --set admin.enabled=true
+  echo "Install kongstorage through helm"
+  helm install kongstorage -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT}  "$ROOT_DIR/../nonrtric/helm/kongstorage"
+
+  echo "Installing Kong"
+  helm repo add kong https://charts.konghq.com --force-update
+  helm repo update
+  helm install kong-nonrtric kong/kong -n ${NONRTRIC_NAMESPACE:-nonrtric} -f dep/nonrtric/helm/kongstorage/kongvalues.yaml
 fi
 
 kubectl create configmap -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe --from-file=recipe=$OVERRIDEYAML
@@ -181,10 +209,5 @@ if [ "$INSTALL_RANPM" = true ];then
    echo "install-ranpm.sh completed"
 fi
 
-HELM_NAME_OPT=""
-if [ -z $IS_HELM3 ];then
-   HELM_NAME_OPT="--name"
-fi
-
 echo "helm install -f $OVERRIDEYAML --namespace ${NONRTRIC_NAMESPACE:-nonrtric} ${HELM_NAME_OPT} ${RELEASE_PREFIX} $ROOT_DIR/../nonrtric/helm/nonrtric"
-helm install -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "${RELEASE_PREFIX}" "$ROOT_DIR/../nonrtric/helm/nonrtric"
+helm install -f $OVERRIDEYAML -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "${RELEASE_PREFIX}" "$ROOT_DIR/../nonrtric/helm/nonrtric"
index d6c827a..af9a31d 100755 (executable)
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 echo "** $ROOT_DIR"
 
-COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm"
+COMPONENTS="
+a1controller \
+a1simulator \
+capifcore \
+controlpanel \
+dmaapadapterservice \
+dmaapmediatorservice \
+dmeparticipant \
+helmmanager \
+informationservice \
+nonrtricgateway \
+orufhrecovery \
+policymanagementservice \
+ransliceassurance \
+rappcatalogueenhancedservice \
+rappcatalogueservice \
+rappmanager \
+servicemanager \
+"
+
 RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep nonrtric-recipe | awk '{print $1}')
 kubectl get configmap  -n $RECIPE_NAMESPACE nonrtric-recipe  -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml
 
@@ -37,8 +56,17 @@ INSTALL_KONG=$(cat /tmp/recipe.yaml | awk '/^  installKong:/{print $2}')
 INSTALL_RANPM=$(cat /tmp/recipe.yaml | awk '/^  installRanpm:/{print $2}')
 
 if [ "$INSTALL_KONG" = true ];then
-   echo "Uninstalling Kong"
-   helm delete kong-nonrtric --namespace kong
+  echo "Warning - deleting Kong routes and services for ServiceManager"
+  SERVICEMANAGER_POD=$(kubectl get pods -o custom-columns=NAME:.metadata.name -l app=nonrtric-servicemanager --no-headers -n ${NONRTRIC_NAMESPACE:-nonrtric})
+  if [[ -n $SERVICEMANAGER_POD ]]; then
+    kubectl exec $SERVICEMANAGER_POD -n ${NONRTRIC_NAMESPACE:-nonrtric} -- ./kongclearup
+  else
+      echo "Error - Servicemanager pod not found, didn't delete Kong routes and services for ServiceManager"
+  fi
+  echo "Uninstalling kongstorage"
+  helm delete kongstorage -n "${NONRTRIC_NAMESPACE:-nonrtric}"
+  echo "Uninstalling Kong"
+  helm delete kong-nonrtric -n ${NONRTRIC_NAMESPACE:-nonrtric}
 fi
 
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
index d1383c4..05211cf 100644 (file)
@@ -30,13 +30,14 @@ nonrtric:
   installRappcatalogueservice: true
   installRappcatalogueenhancedservice: true
   installNonrtricgateway: true
-  installKong: false
+  installKong: true
   installDmaapadapterservice: true
   installDmaapmediatorservice: true
   installHelmmanager: true
   installOrufhrecovery: true
   installRansliceassurance: true
   installCapifcore: true
+  installServicemanager: true
   installRanpm: false
   # rApp Manager functionality relies on ACM for its operation
   installrAppmanager: true
@@ -369,7 +370,6 @@ orufhrecovery:
       oru_to_odu_map_file: "o-ru-to-o-du-map.csv"
       log_level: "Info"
 
-
 capifcore:
   capifcore:
     imagePullPolicy: IfNotPresent
@@ -381,6 +381,14 @@ capifcore:
       chart_museum_url: "http://chartmuseum:8080"
       repo_name: "capifcore"
 
+servicemanager:
+  servicemanager:
+    imagePullPolicy: IfNotPresent
+    image:
+      registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
+      name: nonrtric-plt-servicemanager
+      tag: 0.1.0
+
 rappmanager:
   rappmanager:
     imagePullPolicy: IfNotPresent
diff --git a/nonrtric/helm/kongstorage/Chart.yaml b/nonrtric/helm/kongstorage/Chart.yaml
new file mode 100644 (file)
index 0000000..bb07ce6
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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
+appVersion: "2.0.0"
+description: A Helm chart for kongstorage
+name: kongstorage
+version: 1.0.0
diff --git a/nonrtric/helm/kongstorage/kongvalues.yaml b/nonrtric/helm/kongstorage/kongvalues.yaml
new file mode 100644 (file)
index 0000000..350cb03
--- /dev/null
@@ -0,0 +1,130 @@
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2024 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 Kong's Helm Chart.
+#
+# Sections:
+# - Deployment parameters
+# - Kong parameters
+# - Ingress Controller parameters
+# - Postgres sub-chart parameters
+# - Miscellaneous parameters
+# For a detailed example of values.yaml, please see https://github.com/Kong/charts/blob/main/charts/kong/values.yaml
+# -----------------------------------------------------------------------------
+# Deployment parameters
+# -----------------------------------------------------------------------------
+deployment:
+  kong:
+    enabled: true
+  serviceAccount:
+    create: true
+    automountServiceAccountToken: false
+# -----------------------------------------------------------------------------
+# Kong parameters
+# -----------------------------------------------------------------------------
+env:
+  database: "postgres"
+# Specify Kong's Docker image and repository details here
+image:
+  repository: kong
+  tag: "3.4"
+  pullPolicy: IfNotPresent
+# Specify Kong admin API service and listener configuration
+admin:
+  enabled: true
+  type: NodePort
+  http:
+    # Enable plaintext HTTP listen for the admin API
+    enabled: true
+    servicePort: 8001
+    containerPort: 8001
+    nodePort: 32081
+    parameters: []
+  tls:
+    # Enable HTTPS listen for the admin API
+    enabled: false
+    servicePort: 8444
+    containerPort: 8444
+    nodePort: 32444
+    parameters:
+    - http2
+  ingress:
+    enabled: false
+# Specify Kong proxy service configuration
+proxy:
+  # Enable creating a Kubernetes service for the proxy
+  enabled: true
+  type: LoadBalancer
+  loadBalancerClass:
+  nameOverride: ""
+  annotations: {}
+  labels:
+    enable-metrics: "true"
+  http:
+    # Enable plaintext HTTP listen for the proxy
+    enabled: true
+    servicePort: 80
+    containerPort: 8000
+    # Set a nodePort which is available if service type is NodePort
+    nodePort: 32080
+    parameters: []
+  tls:
+    # Enable HTTPS listen for the proxy
+    enabled: false
+    servicePort: 443
+    containerPort: 8443
+    parameters:
+    - http2
+# -----------------------------------------------------------------------------
+# Ingress Controller parameters
+# -----------------------------------------------------------------------------
+ingressController:
+  enabled: true
+  installCRDs: false
+  image:
+    repository: kong/kubernetes-ingress-controller
+    tag: "3.0"
+  env:
+    kong_admin_tls_skip_verify: true
+# -----------------------------------------------------------------------------
+# Postgres sub-chart parameters
+# -----------------------------------------------------------------------------
+postgresql:
+  enabled: true
+  auth:
+    username: kong
+    database: kong
+    password: kong
+    postgresPassword: kong
+  image:
+    # use postgres < 14 until is https://github.com/Kong/kong/issues/8533 resolved
+    tag: 13.11.0-debian-11-r20
+  service:
+    ports:
+      postgresql: "5432"
+  volumePermissions:
+    enabled: true
+  primary:
+    persistence:
+      existingClaim: kongpvc
+# -----------------------------------------------------------------------------
+# Miscellaneous parameters
+# -----------------------------------------------------------------------------
+waitImage:
+  enabled: true
+  pullPolicy: IfNotPresent
+replicaCount: 1
diff --git a/nonrtric/helm/kongstorage/templates/kongpv.yaml b/nonrtric/helm/kongstorage/templates/kongpv.yaml
new file mode 100644 (file)
index 0000000..1015a24
--- /dev/null
@@ -0,0 +1,30 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2024 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: PersistentVolume
+metadata:
+  name: kongpv
+  labels:
+    type: local
+spec:
+  capacity:
+    storage: "{{ .Values.kongpv.persistence.size }}"
+  accessModes:
+    - "{{ .Values.kongpv.persistence.accessMode }}"
+  hostPath:
+    path: "{{ .Values.kongpv.persistence.path }}"
+  persistentVolumeReclaimPolicy: "{{ .Values.kongpv.persistence.volumeReclaimPolicy }}"
diff --git a/nonrtric/helm/kongstorage/templates/kongpvc.yaml b/nonrtric/helm/kongstorage/templates/kongpvc.yaml
new file mode 100644 (file)
index 0000000..67fef19
--- /dev/null
@@ -0,0 +1,27 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2024 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: PersistentVolumeClaim
+metadata:
+  name: kongpvc
+spec:
+  accessModes:
+    - "{{ .Values.kongpvc.persistence.accessMode }}"
+  resources:
+    requests:
+      storage: "{{ .Values.kongpvc.persistence.size }}"
+  volumeName: kongpv
diff --git a/nonrtric/helm/kongstorage/values.yaml b/nonrtric/helm/kongstorage/values.yaml
new file mode 100644 (file)
index 0000000..e022b85
--- /dev/null
@@ -0,0 +1,31 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2024 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 Kong PV and PVC
+
+kongpv:
+  enabled: true # Disabled for Minikube
+  persistence:
+    volumeReclaimPolicy: Delete
+    accessMode: ReadWriteOnce
+    size: 2Gi
+    path: "/tmp/kongpv"
+
+kongpvc:
+  persistence:
+    volumeReclaimPolicy: Delete
+    accessMode: ReadWriteOnce
+    size: 2Gi
index bc4b175..aec8e39 100644 (file)
@@ -96,6 +96,11 @@ dependencies:
     repository: "@local"
     condition: nonrtric.installCapifcore
 
+  - name: servicemanager
+    version: ~1.0.0
+    repository: "@local"
+    condition: nonrtric.installServicemanager
+
   - name: rappmanager
     version: ~1.0.0
     repository: "@local"
index f610b2f..4f067e9 100644 (file)
@@ -30,6 +30,7 @@ nonrtric:
   installOrufhrecovery: true
   installRansliceassurance: true
   installCapifcore: true
+  installServicemanager: false
   installRanpm: true
   installrAppmanager: true
   installDmeParticipant: true
diff --git a/nonrtric/helm/servicemanager/Chart.yaml b/nonrtric/helm/servicemanager/Chart.yaml
new file mode 100644 (file)
index 0000000..ba0886a
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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
+appVersion: "2.0.0"
+description: A Helm chart for ServiceManager
+name: servicemanager
+version: 1.0.0
diff --git a/nonrtric/helm/servicemanager/requirements.yaml b/nonrtric/helm/servicemanager/requirements.yaml
new file mode 100644 (file)
index 0000000..f9c3ecc
--- /dev/null
@@ -0,0 +1,19 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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.                                             #
+################################################################################
+dependencies:
+  - name: nonrtric-common
+    version: ^2.0.0
+    repository: "@local"
diff --git a/nonrtric/helm/servicemanager/templates/configmap.yaml b/nonrtric/helm/servicemanager/templates/configmap.yaml
new file mode 100644 (file)
index 0000000..746b039
--- /dev/null
@@ -0,0 +1,24 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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: ConfigMap
+metadata:
+  name: servicemanager-configmap
+data:
+{{- range $key, $value := .Values.data }}
+  {{ $key }}: |
+{{ $value | indent 4 }}
+{{- end }}
diff --git a/nonrtric/helm/servicemanager/templates/deployment.yaml b/nonrtric/helm/servicemanager/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..cdf1af3
--- /dev/null
@@ -0,0 +1,60 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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.                                             #
+################################################################################
+kind: Deployment
+apiVersion: apps/v1
+metadata:
+  name: {{ include "common.name.servicemanager" . }}
+  namespace: {{ include "common.namespace.nonrtric" . }}
+  generation: 1
+  labels:
+    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.servicemanager" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+  annotations:
+    deployment.kubernetes.io/revision: '1'
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.servicemanager" . }}
+      release: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.servicemanager" . }}
+        release: {{ .Release.Name }}
+    spec:
+      hostname: {{ include "common.name.servicemanager" . }}
+      containers:
+      - name: {{ include "common.container.servicemanager" . }}
+        image: {{ .Values.servicemanager.image.registry }}/{{ .Values.servicemanager.image.name }}:{{ .Values.servicemanager.image.tag }}
+        imagePullPolicy: {{ .Values.servicemanager.imagePullPolicy }}
+        resources:
+          limits:
+            memory: 256Mi
+            cpu: "250m"
+          requests:
+            memory: 128Mi
+            cpu: "80m"
+        volumeMounts:
+        - name: servicemanager-config-volume
+          mountPath: /app/servicemanager/.env
+          subPath: .env
+      volumes:
+      - name: servicemanager-config-volume
+        configMap:
+          name:  servicemanager-configmap
diff --git a/nonrtric/helm/servicemanager/templates/service.yaml b/nonrtric/helm/servicemanager/templates/service.yaml
new file mode 100644 (file)
index 0000000..159b4ab
--- /dev/null
@@ -0,0 +1,40 @@
+################################################################################
+#   Copyright (c) 2024 OpenInfra Foundation Europe.                            #
+#                                                                              #
+#   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.                                             #
+################################################################################
+kind: Service
+apiVersion: v1
+metadata:
+  name: {{ include "common.name.servicemanager" . }}
+  namespace: {{ include "common.namespace.nonrtric" . }}
+  labels:
+    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.servicemanager" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  ports:
+    {{if eq .Values.servicemanager.service.allowHttp true -}}
+    - name: {{ index .Values.servicemanager.service.httpName }}
+      port: {{ .Values.servicemanager.service.port }}
+      targetPort: {{ .Values.servicemanager.service.targetPort }}
+      {{if eq .Values.servicemanager.service.type "NodePort" -}}
+      nodePort: {{ .Values.servicemanager.service.nodePort }}
+      {{- end }}
+      protocol: TCP
+    {{- end }}
+  selector:
+    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.servicemanager" . }}
+    release: {{ .Release.Name }}
+  type: {{ .Values.servicemanager.service.type }}
diff --git a/nonrtric/helm/servicemanager/values.yaml b/nonrtric/helm/servicemanager/values.yaml
new file mode 100644 (file)
index 0000000..ea8ce33
--- /dev/null
@@ -0,0 +1,48 @@
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2024 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 Servicemanager
+
+servicemanager:
+  imagePullPolicy: IfNotPresent
+  image:
+    registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
+    name: nonrtric-plt-servicemanager
+    tag: 0.1.0
+  apiVersion: v1
+  kind: ConfigMap
+  metadataName: servicemanager-configmap
+  service:
+    httpName: http
+    allowHttp: true
+    port: 8095
+    targetPort: 8095
+    nodePort: 31575
+    type: NodePort
+    SERVICE_MANAGER_ENV: ""
+
+data:
+  .env: |
+    KONG_DOMAIN: "kong"
+    KONG_PROTOCOL: "http"
+    KONG_IPV4: "kong-nonrtric-kong-admin.nonrtric.svc.cluster.local"
+    KONG_DATA_PLANE_PORT: "80"
+    KONG_CONTROL_PLANE_PORT: "8001"
+    CAPIF_PROTOCOL: "http"
+    CAPIF_IPV4: "capifcore.nonrtric.svc.cluster.local"
+    CAPIF_PORT: "8090"
+    LOG_LEVEL: "Debug"
+    SERVICE_MANAGER_PORT: "8095"
diff --git a/ric-common/Common-Template/helm/nonrtric-common/templates/servicemanager.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/servicemanager.tpl
new file mode 100644 (file)
index 0000000..ed1ba73
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+#   Copyright (C) 2024 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.servicemanager" -}}
+  {{- printf "servicemanager" -}}
+{{- end -}}
+{{- define "common.container.servicemanager" -}}
+  {{- $name := ( include "common.name.servicemanager" . ) -}}
+  {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}