...
- Control Panel
- Policy Management ServiceA1 Controller
- Enrichment Coordinator Service
- Non RT RIC Gateway
- R-App catalogue Service
- NearRT RIC Simulator
- A1 Controller
Refer this page for more details
Introduction to Helm Chart
In Nonrtric we use Helm chart as a packaging manager for kubernetes. Helm chart helps developer to package, configure & deploy the application and services into kubernetes environment.
For more information you could refer to below links,
https://helm.sh/docs/intro/quickstart/
Helm Chart in NONRTRIC
In Release B, the helm chart's are written in IT/Dep repo.
The following picture shows the hierarchy of the nonrtric within IT/Dep repo.
Each components in nonrtric repo are independent chart with common dependency of nonrtric-common. The nonrtric chart acts a parent chart where other charts like a1controller, a1simulator, controlpanel & policymanagemenservice are added as dependencies in it.
The nonrtric-common contains the common template shared across all the nonrtric componenets. The nonrtric-common chart is added as a dependency into all the components (a1controller, a1simulator, controlpanel, policymanagemenservice & nonrtric)
Each component can be built & packaged independently of others and the required version can be deployed by adding the same into requirements.yaml file in nonrtric
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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" |
The values.yaml file contains the default value of the individual components and it can be overridden with the override yaml file. The default values.yaml,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 |
Packaging & Repo update
All the logic behind the helm packaging & repo update are kept under deploy-nonrtric.sh file. This script crawls through the nonrtric directory and packages all the dependencies charts & copy it to the helm local repo.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# 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/ |
You can use the example recipe or your custom recipe file to invoke this script. Call the below command from /dep/bin directory,
...
language | bash |
---|---|
theme | Midnight |
title | run deploy command |
, there are helm charts for each these components. In addition, there is a chart called nonrtric, which is a composition of the components above.
Installation
There is a script that packs and installs the components by using the helm command. The installation uses an values override file, which can be used to customize the installation. There is also an example of an override file. This example can be run like this:
>sudo dep/bin/deploy-nonrtric dep/
...
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
The
...
example example_recipe.yaml contains reasonable values and installs a subset of the commands. The example contains documentation of how the parameters can be set. Most should not be updated, but for instance the parameters on which components to include should likely be updated.
Un-istallation
There is a script that uninstalls installs the NonRT RIC components. It is simply run like this:
>sudo dep/bin/undeploy-nonrtric
Introduction to Helm Chart
In Nonrtric we use Helm chart as a packaging manager for kubernetes. Helm chart helps developer to package, configure & deploy the application and services into kubernetes environment.
For more information you could refer to below links,
https://helm.sh/docs/intro/quickstart/
Namespace
The installation will create one helm release and all created kubernetes objects will be put in a namespace. This name is 'nonrtric' and cannot be changed.
Once the installation is done you can check the created kubernetes objects by using command kubectl. Example:
The above command also invokes the install script to do the actual deployment of our components which we cover in Deployment section.
Once you run the deploy command you see the below logs in the console,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Successfully packaged chart and saved it to: /tmp/nonrtric-common-1.0.0.tgz
Packaging NONRTRIC components [controlpanel a1controller a1simulator policymanagementservice]
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Error: Unable to move current charts to tmp dir: rename /root/dep/nonrtric/helm/controlpanel/charts /root/dep/nonrtric/helm/controlpanel/tmpcharts: file exists
Error: found in requirements.yaml, but missing in charts/ directory: nonrtric-common
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading nonrtric-common from repo http://127.0.0.1:8879/charts
Deleting outdated charts
Successfully packaged chart and saved it to: /tmp/a1controller-1.0.0.tgz
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading nonrtric-common from repo http://127.0.0.1:8879/charts
Deleting outdated charts
Successfully packaged chart and saved it to: /tmp/a1simulator-1.0.1.tgz
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading nonrtric-common from repo http://127.0.0.1:8879/charts
Deleting outdated charts
Successfully packaged chart and saved it to: /tmp/policymanagementservice-1.0.0.tgz
"local" has been removed from your repositories
"local" has been added to your repositories
Finished Packaging NONRTRIC components [controlpanel a1controller a1simulator policymanagementservice]
|
Deployment
This is where the actual deployment of the components into kubernetes cluster happens. The install script is responsible for identifying the namespace, helm release & parent chart to start the deployment process. It also creates the config map of the recipe file which is later used during uninstall process. Once all the above are done, it will call the below command to deploy the nonrtric components,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
helm install $DIR/../helm/"${PARENT_CHART}" -f $OVERRIDEYAML --namespace "${NONRTRIC_NAMESPACE:-nonrtric}" --name "${RELEASE_PREFIX}" |
The deploy-nonrtric script is called only the first time and every other redeployment should call install script as long as you don't do any change in helm charts. This saves time and resource as we reuse the existing charts packaged and served by helm repo.
To deploy the nonrtric components in kubernetes you need to call the below command from bin directory within nonrtric,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
root@vm1:~/dep/nonrtric/bin#./install -f ../RECIPE_EXAMPLE/example_recipe.yaml |
Once the deployment starts you see the below log in console,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Chart name- nonrtric
namespace/nonrtric created
configmap/nonrtric-recipe created
Deploying NONRTRIC components [controlpanel a1controller a1simulator policymanagementservice nonrtric]
Updating the Parent Chart [nonrtric]
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 5 charts
Downloading a1controller from repo http://127.0.0.1:8879/charts
Downloading a1simulator from repo http://127.0.0.1:8879/charts
Downloading controlpanel from repo http://127.0.0.1:8879/charts
Downloading policymanagementservice from repo http://127.0.0.1:8879/charts
Downloading nonrtric-common from repo http://127.0.0.1:8879/charts
Deleting outdated charts
NAME: r2-dev-nonrtric
LAST DEPLOYED: Tue Apr 21 10:43:46 2020
NAMESPACE: nonrtric
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
controlpanel-configmap 1 1s
policymanagementservice-configmap 1 1s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
a1controller ClusterIP 10.43.34.119 <none> 8282/TCP 1s
dbhost ClusterIP 10.43.30.35 <none> 3306/TCP 1s
sdnctldb01 ClusterIP 10.43.89.176 <none> 3306/TCP 1s
a1-sim ClusterIP None <none> 8085/TCP 1s
controlpanel NodePort 10.43.8.241 <none> 8080:30090/TCP 1s
policymanagementservice NodePort 10.43.79.184 <none> 8081:30092/TCP 1s
==> v1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
a1controller 1 1 1 0 1s
db 1 1 1 0 1s
controlpanel 1 1 1 0 1s
policymanagementservice 1 1 1 0 1s
==> v1/StatefulSet
NAME DESIRED CURRENT AGE
a1-sim-osc 2 1 1s
a1-sim-std 2 1 1s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
a1controller-5c9f5b586c-wktgg 0/1 ContainerCreating 0 1s
db-549ff9b4d5-9skl5 0/1 ContainerCreating 0 1s
controlpanel-5f4ccc78cb-lc97c 0/1 ContainerCreating 0 1s
policymanagementservice-79d5cdb475-lkhcn 0/1 ContainerCreating 0 1s
a1-sim-osc-0 0/1 ContainerCreating 0 1s
a1-sim-std-0 0/1 ContainerCreating 0 0s
|
Kubernetes Command
Once the above process completes without any error, you can check the status of all pod, services, deployments with below commands,
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
>sudo kubectl -n nonrtric get pod NAME READY STATUS RESTARTS AGE a1controlpanel-sim-osc-0 5cf589fb4-hbf78 1/1 Running 0 150m a1-sim-osc-1 1/1 Running 0 150m16s a1enrichmentservice-sim-std-0 10/1 Running 0 150m16s a1nonrtricgateway-simc76cb9c8-std-1wp5kt 1/1 Running 0 150m a1controller-5c9f5b586c-wktgg 1/1 Running 0 150m16s controlpanel-5f4ccc78cb-lc97c 1/1 Running 0 150m db-549ff9b4d5-9skl5 1/1policymanagementservice-0 Running 0 150m policymanagementservice-79d5cdb475-lkhcn 1/1 Running 0 150m | ||||||
Code Block | ||||||
| ||||||
kubectl -n nonrtric get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE a1-sim ClusterIP None <none> 8085/TCP 155m a1controller ClusterIP 10.43.34.119 <none> 8282/TCP 155m controlpanel NodePort 10.43.8.241 <none> 8080:30090/TCP 155m dbhost ClusterIP 10.43.30.35 <none> 3306/TCP 155m policymanagementservice NodePort 10.43.79.184 <none> 8081:30092/TCP 155m sdnctldb01 ClusterIP 10.43.89.176 <none> 3306/TCP 155m16s |