Fixed external port in Policy service. 21/3121/10
authorLathish <lathishbabu.ganesan@est.tech>
Wed, 1 Apr 2020 16:38:20 +0000 (17:38 +0100)
committerZhe <zhehuang@research.att.com>
Wed, 15 Apr 2020 20:01:59 +0000 (16:01 -0400)
Issue-ID: NONRTRIC-176

NONRTRIC-171: Fixed the A1 simulator multiple instance in same helm release
NONRTRIC-179: Subcharts
Moved A1-Adapter to the subcharts
Change-Id: I5f7c40fb2a5d2a6d843749cfd264f58c520531e3
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
38 files changed:
RECIPE_EXAMPLE/NONRTRIC [new symlink]
bin/deploy-nonrtric [new file with mode: 0755]
bin/undeploy-nonrtric [new file with mode: 0755]
bin/verify-ric-charts
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
nonrtric/bin/install
nonrtric/bin/uninstall
nonrtric/helm/a1controller/requirements.yaml [new file with mode: 0644]
nonrtric/helm/a1controller/templates/deployment.yaml
nonrtric/helm/a1controller/templates/service.yaml
nonrtric/helm/a1controller/values.yaml
nonrtric/helm/a1simulator/Chart.yaml
nonrtric/helm/a1simulator/requirements.yaml [new file with mode: 0644]
nonrtric/helm/a1simulator/templates/service.yaml
nonrtric/helm/a1simulator/templates/statefulset.yaml [moved from nonrtric/helm/a1simulator/templates/deployment.yaml with 87% similarity]
nonrtric/helm/a1simulator/values.yaml
nonrtric/helm/controlpanel/Chart.yaml
nonrtric/helm/controlpanel/requirements.yaml [new file with mode: 0644]
nonrtric/helm/controlpanel/templates/deployment.yaml
nonrtric/helm/controlpanel/templates/service.yaml
nonrtric/helm/controlpanel/values.yaml
nonrtric/helm/nonrtric/Chart.yaml [new file with mode: 0644]
nonrtric/helm/nonrtric/requirements.yaml [new file with mode: 0644]
nonrtric/helm/nonrtric/values.yaml [new file with mode: 0644]
nonrtric/helm/policymanagementservice/Chart.yaml
nonrtric/helm/policymanagementservice/requirements.yaml [new file with mode: 0644]
nonrtric/helm/policymanagementservice/templates/configmap.yaml
nonrtric/helm/policymanagementservice/templates/deployment.yaml
nonrtric/helm/policymanagementservice/templates/service.yaml
nonrtric/helm/policymanagementservice/values.yaml
ric-common/Common-Template/helm/nonrtric-common/Chart.yaml [new file with mode: 0644]
ric-common/Common-Template/helm/nonrtric-common/templates/_a1controller.tpl [moved from nonrtric/helm/a1controller/templates/_a1controller.tpl with 85% similarity]
ric-common/Common-Template/helm/nonrtric-common/templates/_a1simulator.tpl [moved from nonrtric/helm/a1simulator/templates/_a1simulator.tpl with 91% similarity]
ric-common/Common-Template/helm/nonrtric-common/templates/_common.tpl [new file with mode: 0644]
ric-common/Common-Template/helm/nonrtric-common/templates/_controlpanel.tpl [moved from nonrtric/helm/controlpanel/templates/_controlpanel.tpl with 85% similarity]
ric-common/Common-Template/helm/nonrtric-common/templates/_policymanagementservice.tpl [moved from nonrtric/helm/policymanagementservice/templates/_policymanagementservice.tpl with 90% similarity]
ric-common/Common-Template/helm/nonrtric-common/values.yaml [new file with mode: 0644]
ric-dep

diff --git a/RECIPE_EXAMPLE/NONRTRIC b/RECIPE_EXAMPLE/NONRTRIC
new file mode 120000 (symlink)
index 0000000..fcd504e
--- /dev/null
@@ -0,0 +1 @@
+../nonrtric/RECIPE_EXAMPLE/
\ No newline at end of file
diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric
new file mode 100755 (executable)
index 0000000..fd7b85e
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+# This script deploys NonRtRic components automatically
+
+if [ "$#" -eq 1 ]; then
+    OVERRIDEYAML=$1
+else
+
+    while [ -n "$1" ]; do # while loop starts
+
+        case "$1" in
+
+        -f) OVERRIDEYAML=$2
+            shift
+            ;;
+        *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
+
+        esac
+
+        shift
+
+    done
+fi
+
+
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
+fi
+
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+# Start Helm local repo if there isn't one
+HELM_REPO_PID=$(ps -x | grep  "helm serve" | grep -v "grep" | awk '{print $1}')
+if [ -z "$HELM_REPO_PID" ]; then
+    nohup helm serve >& /dev/null &
+fi
+
+# Package nonrtric-common and serve it using Helm local repo
+HELM_HOME=$(helm home)
+COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common
+cp /tmp/nonrtric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+
+COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice"}
+echo "Packaging NONRTRIC components [$COMPONENTS]"
+
+for component in $COMPONENTS; do
+    helm dep up $ROOT_DIR/../nonrtric/helm/$component
+    VERSION=$(cat $ROOT_DIR/../nonrtric/helm/$component/Chart.yaml | grep version | awk '{print $2}')
+    helm package -d /tmp $ROOT_DIR/../nonrtric/helm/$component
+    cp /tmp/$component-$VERSION.tgz $HELM_HOME/repository/local/
+done
+
+helm repo index $HELM_HOME/repository/local/
+
+# Make sure that helm local repo is added
+helm repo remove local
+helm repo add local http://127.0.0.1:8879/charts
+
+echo "Finished Packaging NONRTRIC components [$COMPONENTS]"
+
+$ROOT_DIR/../nonrtric/bin/install -f $OVERRIDEYAML
diff --git a/bin/undeploy-nonrtric b/bin/undeploy-nonrtric
new file mode 100755 (executable)
index 0000000..2a6c3fd
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+# This script to undeploy the NONRTRIC
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+$ROOT_DIR/../nonrtric/bin/uninstall
index e193afc..734bc6a 100755 (executable)
@@ -39,6 +39,12 @@ AUX_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/aux-
 helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/aux-common
 cp /tmp/aux-common-$AUX_COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
 
+NONRTRIC_COMMON_CHART_VERSION=$(cat $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $ROOT_DIR/../ric-common/Common-Template/helm/nonrtric-common
+cp /tmp/nonrtric-common-$NONRTRIC_COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
+
+
+
 helm repo index $HELM_HOME/repository/local/
 
 echo "Make sure that helm local repo is added"
index 59a08ed..0968601 100644 (file)
 #-------------------------------------------------------------------------
 
 common:
-  releasePrefix: r2
-
-# If a local docker registry is used, please specify it using the following option 
-#  localregistry: nexus3.o-ran-sc.org:10004
-
-# Change the overall image pull policy using the following option
-#  pullpolicy: IfNotPresent
+  releasePrefix: r2-dev-nonrtric
 
 # Change the namespaces using the following options
   namespace:
     nonrtric: nonrtric
 
-# Specify the number of NEARRT-RIC instance
-  simulatorinstance:
-    count: 1
+component: nonrtric
+
+a1controller:
+  imagePullPolicy: IfNotPresent
+  image:
+    registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
+    name: nonrtric-a1-controller
+    tag: 1.7.4
+  replicaCount: 1
+  service:
+    internalPort: 8181
+    externalPort: 8282
 
 a1simulator:
+  instanceName: a1-sim
   imagePullPolicy: IfNotPresent
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: near-rt-ric-simulator
     tag: 1.0.1
+  replicaCount: 2
+  service:
+    internalPort: 8085
+
+controlpanel:
+  imagePullPolicy: IfNotPresent
+  # image registry and tag to be changed after first release of controlpanel
+  image:
+    registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
+    name: nonrtric-controlpanel
+    tag: 1.0.0
+  replicaCount: 1
+  service:
+    internalPort: 8080
+    externalPort: 30090
 
 policymanagementservice:
   imagePullPolicy: IfNotPresent
@@ -48,3 +67,8 @@ policymanagementservice:
     registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: nonrtric-policy-agent
     tag: 1.0.0
+  service:
+    internalPort: 8081
+    #Need to check the external port Availability
+    externalPort: 30091
+
index 56376fa..e49b8e9 100755 (executable)
@@ -51,10 +51,9 @@ COMMON_BLOCK=$(cat $OVERRIDEYAML | awk '/^common:/{getline; while ($0 ~ /^ +.*|^
 NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
 NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}')
 RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
-SIMULATOR_BLOCK=$(cat $OVERRIDEYAML | awk '/^  simulatorinstance:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
-SIMULATOR_COUNT=$(echo "$SIMULATOR_BLOCK" | awk '/^ *count:/{print $2}')
-COMPONENTS=${LIST_OF_COMPONENTS:-"a1simulator policymanagementservice"}
-echo "SIMULATOR_COUNT [$SIMULATOR_COUNT]"
+PARENT_CHART=$(cat $OVERRIDEYAML | awk '/^ *component:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"controlpanel a1controller a1simulator policymanagementservice nonrtric"}
+echo "Chart name- $PARENT_CHART"
 
 if ! kubectl get ns ${NONRTRIC_NAMESPACE:-nonrtric}> /dev/null 2>&1; then
     kubectl create ns ${NONRTRIC_NAMESPACE:-nonrtric}
@@ -67,18 +66,8 @@ kubectl create configmap -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe --fr
 
 echo "Deploying NONRTRIC components [$COMPONENTS]"
 
-for component in $COMPONENTS; do
-    helm dep up $DIR/../helm/$component
-    case "$component" in
-            a1simulator)
-               for((i=1;i<=$SIMULATOR_COUNT;i++)) ; do
-                    echo "CREATING SIMUALATOR INSTANCE $i"
-                   helm install -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" --name "${RELEASE_PREFIX}-$component-$i" --set a1simulator.instanceName=a1-sim-$i $DIR/../helm/$component
-                done
-           ;;
-            *)
-                helm install -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
+echo "Updating the Parent Chart [$PARENT_CHART]"
+helm dep up $DIR/../helm/$PARENT_CHART
 
-    esac
+helm install $DIR/../helm/"${PARENT_CHART}" -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" --name "${RELEASE_PREFIX}"
 
-done
index 23d2fc3..4ace9fb 100755 (executable)
@@ -16,7 +16,7 @@
 ################################################################################
 
 
-COMPONENTS="a1simulator policymanagementservice"
+COMPONENTS="controlpanel a1controller a1simulator policymanagementservice"
 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
 
@@ -29,25 +29,10 @@ COMMON_BLOCK=$(cat /tmp/recipe.yaml | awk '/^common:/{getline; while ($0 ~ /^ +.
 NAMESPACE_BLOCK=$(cat /tmp/recipe.yaml | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
 NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}')
 RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
-SIMULATOR_BLOCK=$(cat /tmp/recipe.yaml | awk '/^  simulatorinstance:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
-SIMULATOR_COUNT=$(echo "$SIMULATOR_BLOCK" | awk '/^ *count:/{print $2}')
 
 echo "Undeploying NONRTRIC components [$COMPONENTS]"
 
-
-for component in $COMPONENTS; do
-    case "$component" in
-            a1simulator)
-                           for((i=1;i<=$SIMULATOR_COUNT;i++)) ; do
-                        echo "Undeploying SIMUALATOR INSTANCE $i"
-                        helm delete --purge ${RELEASE_PREFIX}-$component-$i
-                    done
-                       ;;
-            *)
-                helm delete --purge ${RELEASE_PREFIX}-$component
-
-    esac
-done
+helm delete --purge ${RELEASE_PREFIX}
 
 kubectl delete cm -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe
 
diff --git a/nonrtric/helm/a1controller/requirements.yaml b/nonrtric/helm/a1controller/requirements.yaml
new file mode 100644 (file)
index 0000000..ba44395
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+dependencies:
+  - name: nonrtric-common
+    version: ^1.0.0
+    repository: "@local"
index bb7b3b5..d84bb37 100644 (file)
@@ -52,11 +52,11 @@ spec:
           command:
             - /opt/onap/sdnc/bin/startODL.sh
           ports:
-            - containerPort: {{ include "common.serviceport.a1controller.internal" . }}
+            - containerPort: {{ .Values.a1controller.service.internalPort }}
               protocol: TCP
           readinessProbe:
             tcpSocket:
-              port: {{ include "common.serviceport.a1controller.internal" . }}
+              port: {{ .Values.a1controller.service.internalPort }}
             initialDelaySeconds: 15
             periodSeconds: 15
 ---
index 72d3793..cb6ad89 100644 (file)
@@ -27,9 +27,9 @@ metadata:
 spec:
   type: ClusterIP
   ports:
-    - port: {{ include "common.serviceport.a1controller.external" . }}
+    - port: {{ .Values.a1controller.service.externalPort }}
       protocol: TCP
-      targetPort: {{ include "common.serviceport.a1controller.internal" . }}
+      targetPort: {{ .Values.a1controller.service.internalPort }}
   selector:
     app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1controller" . }}
     release: {{ .Release.Name }}
index 76eb3f2..c4bd0c9 100644 (file)
@@ -24,4 +24,7 @@ a1controller:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: nonrtric-a1-controller
     tag: 1.7.4
-  replicaCount: 1
\ No newline at end of file
+  replicaCount: 1
+  service:
+    internalPort: 8181
+    externalPort: 8282
\ No newline at end of file
index d0bdfa0..cc35590 100644 (file)
@@ -15,7 +15,6 @@
 ################################################################################
 
 apiVersion: v1
-appVersion: "1.0"
 description: A Helm chart for A1 simulator
 name: a1simulator
 version: 1.0.1
diff --git a/nonrtric/helm/a1simulator/requirements.yaml b/nonrtric/helm/a1simulator/requirements.yaml
new file mode 100644 (file)
index 0000000..ba44395
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+dependencies:
+  - name: nonrtric-common
+    version: ^1.0.0
+    repository: "@local"
index 4bcde79..4c16903 100644 (file)
@@ -28,9 +28,10 @@ spec:
   ports:
   - name: http
     protocol: TCP
-    port: {{ include "common.serviceport.a1simulator.http" . }}
-    targetPort: {{ include "common.serviceport.a1simulator.http" . }}
+    port: {{ .Values.a1simulator.service.internalPort }}
+    targetPort: {{ .Values.a1simulator.service.internalPort }}
   selector:
     app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }}
     release: {{ .Release.Name }}
   type: ClusterIP
+  clusterIP: None
\ No newline at end of file
 #   limitations under the License.                                             #
 ################################################################################
 
-kind: Deployment
+kind: StatefulSet
 apiVersion: apps/v1
 metadata:
-  name: {{ .Release.Name }}-{{ .Values.a1simulator.instanceName }}
+  name: {{ .Values.a1simulator.instanceName }}
   namespace: {{ include "common.namespace.nonrtric" . }}
   generation: 1
   labels:
@@ -28,11 +28,12 @@ metadata:
   annotations:
     deployment.kubernetes.io/revision: '1'
 spec:
-  replicas: 1
+  replicas: {{ .Values.a1simulator.replicaCount }}
   selector:
     matchLabels:
       app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }}
       release: {{ .Release.Name }}
+  serviceName: {{ .Values.a1simulator.instanceName }}
   template:
     metadata:
       labels:
@@ -45,10 +46,10 @@ spec:
         image: {{ .Values.a1simulator.image.registry }}/{{ .Values.a1simulator.image.name }}:{{ .Values.a1simulator.image.tag }}
         imagePullPolicy: {{ .Values.a1simulator.imagePullPolicy }}
         ports:
-        - containerPort: {{ include "common.serviceport.a1simulator.http" . }}
+        - containerPort: {{ .Values.a1simulator.service.internalPort }}
           protocol: TCP
         readinessProbe:
           tcpSocket:
-            port: {{ include "common.serviceport.a1simulator.http" . }}
+            port: {{ .Values.a1simulator.service.internalPort }}
           initialDelaySeconds: 5
           periodSeconds: 15
\ No newline at end of file
index af7ff5d..8fa377b 100644 (file)
 # Declare variables to be passed into your templates.
 
 a1simulator:
-  instanceName: a1-sim1
+  instanceName: a1-sim
   imagePullPolicy: IfNotPresent
   image:
     registry: "nexus3.o-ran-sc.org:10002/o-ran-sc"
     name: near-rt-ric-simulator
     tag: 1.0.1
+  replicaCount: 2
+  service:
+    internalPort: 8085
index 8d960dc..cf00a1f 100644 (file)
@@ -15,7 +15,6 @@
 ################################################################################
 
 apiVersion: v1
-appVersion: "1.0"
 description: A Helm chart for nonrtric controlpanel
 name: controlpanel
 version: 1.0.0
diff --git a/nonrtric/helm/controlpanel/requirements.yaml b/nonrtric/helm/controlpanel/requirements.yaml
new file mode 100644 (file)
index 0000000..ba44395
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+dependencies:
+  - name: nonrtric-common
+    version: ^1.0.0
+    repository: "@local"
index 023c446..d2fbd57 100644 (file)
@@ -46,7 +46,7 @@ spec:
           imagePullPolicy: {{ .Values.controlpanel.imagePullPolicy }}
           ports:
             - name: http
-              containerPort: {{ include "common.serviceport.controlpanel.container" . }}
+              containerPort: {{ .Values.controlpanel.service.internalPort }}
               protocol: TCP
           volumeMounts:
             - name: configmap
@@ -55,7 +55,7 @@ spec:
               readOnly: true
           readinessProbe:
             tcpSocket:
-              port: {{ include "common.serviceport.controlpanel.container" . }}
+              port: {{ .Values.controlpanel.service.internalPort }}
             initialDelaySeconds: 15
             periodSeconds: 15
       volumes:
index e031ea6..cf0d36f 100644 (file)
@@ -27,10 +27,10 @@ metadata:
 spec:
   type: NodePort
   ports:
-    - port: {{ include "common.serviceport.controlpanel.container" . }}
-      nodePort: {{ include "common.serviceport.controlpanel.http" . }}
+    - port: {{ .Values.controlpanel.service.internalPort }}
+      nodePort: {{ .Values.controlpanel.service.externalPort }}
       protocol: TCP
-      targetPort: http
+      targetPort: {{ .Values.controlpanel.service.internalPort }}
   selector:
     app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.controlpanel" . }}
     release: {{ .Release.Name }}
\ No newline at end of file
index be16a15..fb1f41a 100644 (file)
@@ -25,4 +25,7 @@ controlpanel:
     registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: nonrtric-controlpanel
     tag: 1.0.0
-  replicaCount: 1
\ No newline at end of file
+  replicaCount: 1
+  service:
+    internalPort: 8080
+    externalPort: 30090
diff --git a/nonrtric/helm/nonrtric/Chart.yaml b/nonrtric/helm/nonrtric/Chart.yaml
new file mode 100644 (file)
index 0000000..af05856
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+apiVersion: v1
+description: NonRealTime RAN Intelligent Controller
+name: nonrtric
+version: 1.0.0
diff --git a/nonrtric/helm/nonrtric/requirements.yaml b/nonrtric/helm/nonrtric/requirements.yaml
new file mode 100644 (file)
index 0000000..f2d67e4
--- /dev/null
@@ -0,0 +1,32 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+dependencies:
+  - name: a1controller
+    version: ~1.0.0
+    repository: "@local"
+  - name: a1simulator
+    version: ~1.0.1
+    repository: "@local"
+  - name: controlpanel
+    version: ~1.0.0
+    repository: "@local"
+  - name: policymanagementservice
+    version: ~1.0.0
+    repository: "@local"
+  - name: nonrtric-common
+    version: ^1.0.0
+    repository: "@local"
diff --git a/nonrtric/helm/nonrtric/values.yaml b/nonrtric/helm/nonrtric/values.yaml
new file mode 100644 (file)
index 0000000..adf2fa5
--- /dev/null
@@ -0,0 +1,18 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+
+    
index f5aeb03..9387bcd 100644 (file)
@@ -15,7 +15,6 @@
 ################################################################################
 
 apiVersion: v1
-appVersion: "1.0"
 description: A Helm chart for Policy Management Service
 name: policymanagementservice
-version: 1.0.1
+version: 1.0.0
diff --git a/nonrtric/helm/policymanagementservice/requirements.yaml b/nonrtric/helm/policymanagementservice/requirements.yaml
new file mode 100644 (file)
index 0000000..ba44395
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+dependencies:
+  - name: nonrtric-common
+    version: ^1.0.0
+    repository: "@local"
index 87e7eda..0cd9a98 100644 (file)
@@ -18,7 +18,7 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ .Release.Name }}-policy-configmap
+  name: {{ include "common.name.policymanagementservice" . }}-configmap
   namespace: {{ include "common.namespace.nonrtric" . }}
   labels:
     app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
@@ -26,4 +26,4 @@ metadata:
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
 data:
-{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
+{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
\ No newline at end of file
index 3a87aa8..9f05959 100644 (file)
@@ -45,18 +45,18 @@ spec:
         image: {{ .Values.policymanagementservice.image.registry }}/{{ .Values.policymanagementservice.image.name }}:{{ .Values.policymanagementservice.image.tag }}
         imagePullPolicy: {{ .Values.policymanagementservice.imagePullPolicy }}
         ports:
-        - containerPort: {{ include "common.serviceport.policymanagementservice.http" . }}
+        - containerPort: {{ .Values.policymanagementservice.service.internalPort }}
           protocol: TCP
         readinessProbe:
           tcpSocket:
-            port: {{ include "common.serviceport.policymanagementservice.http" . }}
+            port: {{ .Values.policymanagementservice.service.internalPort }}
           initialDelaySeconds: 5
           periodSeconds: 15
         volumeMounts:
-        - name: {{ .Release.Name }}-policy-conf
+        - name: {{ include "common.name.policymanagementservice" . }}-policy-conf
           mountPath: /opt/app/policy-agent/config/application_configuration.json
           subPath: application_configuration.json
       volumes:
-        - name: {{ .Release.Name }}-policy-conf
+        - name: {{ include "common.name.policymanagementservice" . }}-policy-conf
           configMap:
-            name: {{ .Release.Name }}-policy-configmap
\ No newline at end of file
+            name: {{ include "common.name.policymanagementservice" . }}-configmap
\ No newline at end of file
index 211ffdf..f7bde7c 100644 (file)
@@ -26,11 +26,11 @@ metadata:
     heritage: {{ .Release.Service }}
 spec:
   ports:
-  - name: http
+  - name: {{ .Values.policymanagementservice.service.name }}
     protocol: TCP
-    port: {{ include "common.serviceport.policymanagementservice.http" . }}
-    targetPort: {{ include "common.serviceport.policymanagementservice.http" . }}
+    port: {{ .Values.policymanagementservice.service.internalPort }}
+    nodePort: {{ .Values.policymanagementservice.service.externalPort }}
   selector:
-    app: nonrtric-{{ include "common.name.policymanagementservice" . }}
+    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
     release: {{ .Release.Name }}
-  type: ClusterIP
+  type: NodePort
index 6db476d..21d2732 100644 (file)
@@ -24,3 +24,10 @@ policymanagementservice:
     registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: nonrtric-policy-agent
     tag: 1.0.0
+  service:
+    name: http
+    internalPort: 8081
+    #Need to check the external port Availability
+    externalPort: 30091
+
+    
diff --git a/ric-common/Common-Template/helm/nonrtric-common/Chart.yaml b/ric-common/Common-Template/helm/nonrtric-common/Chart.yaml
new file mode 100644 (file)
index 0000000..1aec95b
--- /dev/null
@@ -0,0 +1,20 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+apiVersion: v1
+description: NONRTRIC Common templates for inclusion in other charts
+name: nonrtric-common
+version: 1.0.0
\ No newline at end of file
   {{- printf "a1controller" -}}
 {{- end -}}
 
-{{- define "common.namespace.nonrtric" -}}
-  {{- printf "nonrtric" -}}
-{{- end -}}
-
 {{- define "common.containername.a1controller" -}}
   {{- $name := ( include "common.name.a1controller" . ) -}}
   {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-{{- define "common.serviceport.a1controller.internal" -}}8181{{- end -}}
-
-{{- define "common.serviceport.a1controller.external" -}}8282{{- end -}}
\ No newline at end of file
+{{- end -}}
\ No newline at end of file
   {{- printf "a1simulator" -}}
 {{- end -}}
 
-{{- define "common.namespace.nonrtric" -}}
-  {{- printf "nonrtric" -}}
-{{- end -}}
-
 {{- define "common.fullname.a1simulator" -}}
   {{- $name := ( include "common.name.a1simulator" . ) -}}
   {{- $namespace := "nonrtric" -}}
@@ -32,5 +28,3 @@
   {{- $name := ( include "common.fullname.a1simulator" . ) -}}
   {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
-
-{{- define "common.serviceport.a1simulator.http" -}}8085{{- end -}}
diff --git a/ric-common/Common-Template/helm/nonrtric-common/templates/_common.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_common.tpl
new file mode 100644 (file)
index 0000000..5636ed1
--- /dev/null
@@ -0,0 +1,19 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
+
+{{- define "common.namespace.nonrtric" -}}
+  {{- printf "nonrtric" -}}
+{{- end -}}
   {{- printf "controlpanel" -}}
 {{- end -}}
 
-{{- define "common.namespace.nonrtric" -}}
-  {{- printf "nonrtric" -}}
-{{- end -}}
-
 {{- define "common.containername.controlpanel" -}}
   {{- $name := ( include "common.name.controlpanel" . ) -}}
   {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-{{- define "common.serviceport.controlpanel.http" -}}30090{{- end -}}
-
-{{- define "common.serviceport.controlpanel.container" -}}8080{{- end -}}
\ No newline at end of file
+{{- end -}}
\ No newline at end of file
   {{- printf "policymanagementservice" -}}
 {{- end -}}
 
-{{- define "common.namespace.nonrtric" -}}
-  {{- printf "nonrtric" -}}
-{{- end -}}
-
 {{- define "common.container.policymanagementservice" -}}
   {{- $name := ( include "common.name.policymanagementservice" . ) -}}
   {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
-
-{{- define "common.serviceport.policymanagementservice.http" -}}8081{{- end -}}
diff --git a/ric-common/Common-Template/helm/nonrtric-common/values.yaml b/ric-common/Common-Template/helm/nonrtric-common/values.yaml
new file mode 100644 (file)
index 0000000..10520ad
--- /dev/null
@@ -0,0 +1,15 @@
+################################################################################
+#   Copyright (c) 2020 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.                                             #
+################################################################################
\ No newline at end of file
diff --git a/ric-dep b/ric-dep
index bc4d2b3..91184df 160000 (submodule)
--- a/ric-dep
+++ b/ric-dep
@@ -1 +1 @@
-Subproject commit bc4d2b325c496bbf2557b634ce70ba86ac353997
+Subproject commit 91184df84b97b4d867f3324c5dc3e6a6a734134a