From: Lathish Date: Wed, 1 Apr 2020 16:38:20 +0000 (+0100) Subject: Fixed external port in Policy service. X-Git-Tag: f-release~118^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=7e09001c5b58dab96d014fe3f9c41f89b53f3cc3;p=it%2Fdep.git Fixed external port in Policy service. 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 --- diff --git a/RECIPE_EXAMPLE/NONRTRIC b/RECIPE_EXAMPLE/NONRTRIC new file mode 120000 index 00000000..fcd504ea --- /dev/null +++ b/RECIPE_EXAMPLE/NONRTRIC @@ -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 index 00000000..fd7b85ee --- /dev/null +++ b/bin/deploy-nonrtric @@ -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 index 00000000..2a6c3fd4 --- /dev/null +++ b/bin/undeploy-nonrtric @@ -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 diff --git a/bin/verify-ric-charts b/bin/verify-ric-charts index e193afc9..734bc6a4 100755 --- a/bin/verify-ric-charts +++ b/bin/verify-ric-charts @@ -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" diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index 59a08ed2..0968601b 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -19,28 +19,47 @@ #------------------------------------------------------------------------- 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 + diff --git a/nonrtric/bin/install b/nonrtric/bin/install index 56376faa..e49b8e93 100755 --- a/nonrtric/bin/install +++ b/nonrtric/bin/install @@ -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 diff --git a/nonrtric/bin/uninstall b/nonrtric/bin/uninstall index 23d2fc3f..4ace9fb5 100755 --- a/nonrtric/bin/uninstall +++ b/nonrtric/bin/uninstall @@ -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 index 00000000..ba44395e --- /dev/null +++ b/nonrtric/helm/a1controller/requirements.yaml @@ -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" diff --git a/nonrtric/helm/a1controller/templates/deployment.yaml b/nonrtric/helm/a1controller/templates/deployment.yaml index bb7b3b5d..d84bb37b 100644 --- a/nonrtric/helm/a1controller/templates/deployment.yaml +++ b/nonrtric/helm/a1controller/templates/deployment.yaml @@ -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 --- diff --git a/nonrtric/helm/a1controller/templates/service.yaml b/nonrtric/helm/a1controller/templates/service.yaml index 72d37938..cb6ad895 100644 --- a/nonrtric/helm/a1controller/templates/service.yaml +++ b/nonrtric/helm/a1controller/templates/service.yaml @@ -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 }} diff --git a/nonrtric/helm/a1controller/values.yaml b/nonrtric/helm/a1controller/values.yaml index 76eb3f29..c4bd0c9f 100644 --- a/nonrtric/helm/a1controller/values.yaml +++ b/nonrtric/helm/a1controller/values.yaml @@ -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 diff --git a/nonrtric/helm/a1simulator/Chart.yaml b/nonrtric/helm/a1simulator/Chart.yaml index d0bdfa0b..cc355900 100644 --- a/nonrtric/helm/a1simulator/Chart.yaml +++ b/nonrtric/helm/a1simulator/Chart.yaml @@ -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 index 00000000..ba44395e --- /dev/null +++ b/nonrtric/helm/a1simulator/requirements.yaml @@ -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" diff --git a/nonrtric/helm/a1simulator/templates/service.yaml b/nonrtric/helm/a1simulator/templates/service.yaml index 4bcde799..4c16903e 100644 --- a/nonrtric/helm/a1simulator/templates/service.yaml +++ b/nonrtric/helm/a1simulator/templates/service.yaml @@ -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 diff --git a/nonrtric/helm/a1simulator/templates/deployment.yaml b/nonrtric/helm/a1simulator/templates/statefulset.yaml similarity index 87% rename from nonrtric/helm/a1simulator/templates/deployment.yaml rename to nonrtric/helm/a1simulator/templates/statefulset.yaml index 2b399ae6..bc65edef 100644 --- a/nonrtric/helm/a1simulator/templates/deployment.yaml +++ b/nonrtric/helm/a1simulator/templates/statefulset.yaml @@ -14,10 +14,10 @@ # 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 diff --git a/nonrtric/helm/a1simulator/values.yaml b/nonrtric/helm/a1simulator/values.yaml index af7ff5de..8fa377b7 100644 --- a/nonrtric/helm/a1simulator/values.yaml +++ b/nonrtric/helm/a1simulator/values.yaml @@ -19,9 +19,12 @@ # 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 diff --git a/nonrtric/helm/controlpanel/Chart.yaml b/nonrtric/helm/controlpanel/Chart.yaml index 8d960dcf..cf00a1fb 100644 --- a/nonrtric/helm/controlpanel/Chart.yaml +++ b/nonrtric/helm/controlpanel/Chart.yaml @@ -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 index 00000000..ba44395e --- /dev/null +++ b/nonrtric/helm/controlpanel/requirements.yaml @@ -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" diff --git a/nonrtric/helm/controlpanel/templates/deployment.yaml b/nonrtric/helm/controlpanel/templates/deployment.yaml index 023c4463..d2fbd579 100644 --- a/nonrtric/helm/controlpanel/templates/deployment.yaml +++ b/nonrtric/helm/controlpanel/templates/deployment.yaml @@ -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: diff --git a/nonrtric/helm/controlpanel/templates/service.yaml b/nonrtric/helm/controlpanel/templates/service.yaml index e031ea63..cf0d36fb 100644 --- a/nonrtric/helm/controlpanel/templates/service.yaml +++ b/nonrtric/helm/controlpanel/templates/service.yaml @@ -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 diff --git a/nonrtric/helm/controlpanel/values.yaml b/nonrtric/helm/controlpanel/values.yaml index be16a156..fb1f41a6 100644 --- a/nonrtric/helm/controlpanel/values.yaml +++ b/nonrtric/helm/controlpanel/values.yaml @@ -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 index 00000000..af058561 --- /dev/null +++ b/nonrtric/helm/nonrtric/Chart.yaml @@ -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 index 00000000..f2d67e41 --- /dev/null +++ b/nonrtric/helm/nonrtric/requirements.yaml @@ -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 index 00000000..adf2fa54 --- /dev/null +++ b/nonrtric/helm/nonrtric/values.yaml @@ -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. # +################################################################################ + + + diff --git a/nonrtric/helm/policymanagementservice/Chart.yaml b/nonrtric/helm/policymanagementservice/Chart.yaml index f5aeb037..9387bcd6 100644 --- a/nonrtric/helm/policymanagementservice/Chart.yaml +++ b/nonrtric/helm/policymanagementservice/Chart.yaml @@ -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 index 00000000..ba44395e --- /dev/null +++ b/nonrtric/helm/policymanagementservice/requirements.yaml @@ -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" diff --git a/nonrtric/helm/policymanagementservice/templates/configmap.yaml b/nonrtric/helm/policymanagementservice/templates/configmap.yaml index 87e7edaa..0cd9a988 100644 --- a/nonrtric/helm/policymanagementservice/templates/configmap.yaml +++ b/nonrtric/helm/policymanagementservice/templates/configmap.yaml @@ -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 diff --git a/nonrtric/helm/policymanagementservice/templates/deployment.yaml b/nonrtric/helm/policymanagementservice/templates/deployment.yaml index 3a87aa8b..9f059590 100644 --- a/nonrtric/helm/policymanagementservice/templates/deployment.yaml +++ b/nonrtric/helm/policymanagementservice/templates/deployment.yaml @@ -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 diff --git a/nonrtric/helm/policymanagementservice/templates/service.yaml b/nonrtric/helm/policymanagementservice/templates/service.yaml index 211ffdfd..f7bde7cd 100644 --- a/nonrtric/helm/policymanagementservice/templates/service.yaml +++ b/nonrtric/helm/policymanagementservice/templates/service.yaml @@ -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 diff --git a/nonrtric/helm/policymanagementservice/values.yaml b/nonrtric/helm/policymanagementservice/values.yaml index 6db476d4..21d2732c 100644 --- a/nonrtric/helm/policymanagementservice/values.yaml +++ b/nonrtric/helm/policymanagementservice/values.yaml @@ -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 index 00000000..1aec95ba --- /dev/null +++ b/ric-common/Common-Template/helm/nonrtric-common/Chart.yaml @@ -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 diff --git a/nonrtric/helm/a1controller/templates/_a1controller.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_a1controller.tpl similarity index 85% rename from nonrtric/helm/a1controller/templates/_a1controller.tpl rename to ric-common/Common-Template/helm/nonrtric-common/templates/_a1controller.tpl index 283ba00f..afb5097b 100644 --- a/nonrtric/helm/a1controller/templates/_a1controller.tpl +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_a1controller.tpl @@ -18,15 +18,7 @@ {{- 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 diff --git a/nonrtric/helm/a1simulator/templates/_a1simulator.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_a1simulator.tpl similarity index 91% rename from nonrtric/helm/a1simulator/templates/_a1simulator.tpl rename to ric-common/Common-Template/helm/nonrtric-common/templates/_a1simulator.tpl index 75a23cd6..c7f5f314 100644 --- a/nonrtric/helm/a1simulator/templates/_a1simulator.tpl +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_a1simulator.tpl @@ -18,10 +18,6 @@ {{- 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 index 00000000..5636ed11 --- /dev/null +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_common.tpl @@ -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 -}} diff --git a/nonrtric/helm/controlpanel/templates/_controlpanel.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_controlpanel.tpl similarity index 85% rename from nonrtric/helm/controlpanel/templates/_controlpanel.tpl rename to ric-common/Common-Template/helm/nonrtric-common/templates/_controlpanel.tpl index c8efba33..1f1430e9 100644 --- a/nonrtric/helm/controlpanel/templates/_controlpanel.tpl +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_controlpanel.tpl @@ -18,15 +18,7 @@ {{- 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 diff --git a/nonrtric/helm/policymanagementservice/templates/_policymanagementservice.tpl b/ric-common/Common-Template/helm/nonrtric-common/templates/_policymanagementservice.tpl similarity index 90% rename from nonrtric/helm/policymanagementservice/templates/_policymanagementservice.tpl rename to ric-common/Common-Template/helm/nonrtric-common/templates/_policymanagementservice.tpl index 44522a34..b265ec34 100644 --- a/nonrtric/helm/policymanagementservice/templates/_policymanagementservice.tpl +++ b/ric-common/Common-Template/helm/nonrtric-common/templates/_policymanagementservice.tpl @@ -18,13 +18,7 @@ {{- 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 index 00000000..10520add --- /dev/null +++ b/ric-common/Common-Template/helm/nonrtric-common/values.yaml @@ -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 bc4d2b32..91184df8 160000 --- a/ric-dep +++ b/ric-dep @@ -1 +1 @@ -Subproject commit bc4d2b325c496bbf2557b634ce70ba86ac353997 +Subproject commit 91184df84b97b4d867f3324c5dc3e6a6a734134a