5 OCNWDAF Installation
This chapter describes how to install Oracle Communications Network Data Analytics Function (OCNWDAF) on Oracle Communications Cloud Native Environment (OCCNE).
The steps are divided into two categories:
You are recommended to follow the steps in the given sequence for preparing and installing OCNWDAF.
5.1 Preinstallation
To install OCNWDAF, perform the steps described in this section.
Note:
The kubectl commands might vary based on the platform used for deploying CNC Policy. Users are recommended to replacekubectl
with environment-specific
command line tool to configure kubernetes resources through kube-api server. The
instructions provided in this document are as per the OCCNE’s version of kube-api
server.
5.1.1 Verifying and Creating OCNWDAF Namespace
This section explains how to verify or create a new namespace in the system.
To verify if the required namespace already exists in the system, run the following command:
$ kubectl get namespaces
In the output of the above command, check if the required namespace is available. If not available, create the namespace using the following command:
Note:
This is an optional step. Skip this step if the required namespace already exists.$ kubectl create namespace <required namespace>
Example:$ kubectl create namespace oc-nwdaf
Naming Convention for Namespaces
While choosing the name of the namespace where you wish to deploy OCNWDAF, make sure the following requirements are met:
- Starts and ends with an alphanumeric character
- Contains 63 characters or less
- Contains only alphanumeric characters or '-'
Note:
It is recommended to avoid using prefixkube-
when creating namespace as this prefix
is reserved for Kubernetes system namespaces.
5.1.2 Configuring Database, Creating Users, and Granting Permissions
This section explains how a database administrator can create the databases, users, and grant permissions to the users for OCNWDAF.
Perform the following steps to create the OCNWDAF MySQL database and grant permissions to the OCNWDAF user for database operations:
- Log in to the server or machine with permission to access the SQL nodes of NDB cluster.
- Connect to the SQL node of the NDB cluster or connect to the cnDBTier.
- Run the following command to connect to the
cnDBTier:
kubectl -n <cndbtier_namespace> exec -it <cndbtier_sql_pod_name> -c <cndbtier_sql_container_name> -- bash
- Run the following command to log in to the MySQL prompt as a user with
root permissions:
mysql -h -uroot -p
- Run the following commands to create the OCNWDAF
database:
CREATE DATABASE IF NOT EXISTS `mtlf`; CREATE DATABASE IF NOT EXISTS `nwdaf_subscription`; CREATE DATABASE IF NOT EXISTS `nwdaf_data_collection`; CREATE DATABASE IF NOT EXISTS `nwdaf_communication`; CREATE DATABASE IF NOT EXISTS `nwdaf_configuration_service`;
- Run the following commands to create a user and grant all the necessary
permissions to the
user:
CREATE USER 'ocn-nwdaf-user' IDENTIFIED BY 'Nwd@f-Db';
grant all privileges on mtlf.* to 'ocn-nwdaf-user'; grant all privileges on nwdaf_subscription.* to 'ocn-nwdaf-user'; grant all privileges on nwdaf_data_collection.* to 'ocn-nwdaf-user'; grant all privileges on nwdaf_communication.* to 'ocn-nwdaf-user'; grant all privileges on nwdaf_configuration_service.* to 'ocn-nwdaf-user';
5.1.3 Modifying OCNWDAF Database
To modify the OCNWDAF database, modify the following property:
dbc:mysql://{DB-HOST}:{DB-PORT}/{MICRO-SERVICE-DATABASE}
Note:
This must be done before continuing and deploying the CAP4Cs dependencies.Following is an example on how to configure the connection to the MySQL database that can have any name or scheme.
datasource:
url: dbc:mysql://mysql.performance-ns:3306/nwdaf_subscription
driver-class-name: com.mysql.cj.dbc.Driver
username: ocn-nwdaf-user
The microservices that can be configured for the database connection are as follows:
- ocn-nwdaf-communication
- ocn-nwdaf-mtlf
- ocn-nwdaf-data-collection
- ocn-nwdaf-subscription
- ocn-nwdaf-configuration-service
5.2 Installation Tasks
This section describes the tasks that the user must follow for installing OCNWDAF.
5.2.1 Pushing the Images to Customer Docker Registry
Table 5-1 Docker Images for OCNWDAF
Service Name | Docker Image Name | Image Tag |
---|---|---|
NWDAF Analytics Info Service | ocn-nwdaf-analytics | 22.1.0.0.0 |
NWDAF Communication Service (Egress Gateway) | ocn-nwdaf-communication | 22.1.0.0.0 |
NWDAF Configuration Service | ocn-nwdaf-configuration-service | 22.1.0.0.0 |
NWDAF Data Collection Service | ocn-nwdaf-data-collection | 22.1.0.0.0 |
NWDAF Gateway Service (Ingress Gateway) | ocn-nwdaf-gateway | 22.1.0.0.0 |
NWDAF MTLF Service | ocn-nwdaf-mtlf | 22.1.0.0.0 |
NWDAF Subscription Service | ocn-nwdaf-subscription | 22.1.0.0.0 |
NF Test | nf_test | 22.2.0 |
To push the images to customer docker registry, perform the following steps:
- Verify the package content from the
Readme.txt
file. - Load the
nwdaf-images-22.1.0.tar
file into the docker system.Note:
Thenwdaf-images-22.1.0.tar
file becomes available, once you have untarred the OCNWDAF package zip file. For more information, see Installation Package Download.docker load --input <image_file_name.tar>
Example:docker load --input nwdaf-images-22.1.0.tar
For CNE 1.8.0 and later, use the following command:
podman load --input nwdaf-images-22.1.0.tar
- Verify if the image is loaded correctly by running the following
command. Run the following
command:
docker images
For CNE 1.8.0 and later, use the following command:
podman images
- Create a new tag for each imported image and push the image to the
customer docker registry. Run the following
command:
docker tag <image-name>:<image-tag> <docker-repo>/<image-name>:<image-tag>
docker push <docker_repo>/<image_name>:<image-tag>
For CNE 1.8.0 and later, use the following command:
podman tag <image-name>:<image-tag> <docker-repo>/<image-name>:<image-tag>
podman push <docker_repo>/<image_name>:<image-tag>
Note:
It is recommended to configure the docker certificate before running the push command to access customer registry via HTTPS, otherwise, docker push command may fail. - Push the Helm charts to the Helm repository. Run the following
command:
Helm cm-push --force <chart name>.tgz <Helm repo>
5.2.2 Installing OCNWDAF
This section describes how to install OCNWDAF.
To install OCNWDAF, perform the following steps:
- Change directory into the
ocn-nwdaf-releases
directory. - Installing the Helm charts in the cluster.
Run the following commands:
# Deploy Communication Service cd ocn-nwdaf-communication/ helm install ocn-nwdaf-communication ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy Gateway Service cd ocn-nwdaf-gateway/ helm install ocn-nwdaf-gateway ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy MTLF Service cd ocn-nwdaf-mtlf-service helm install ocn-nwdaf-mtlf ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy Data Collection Service cd ocn-nwdaf-data-collection/ helm install ocn-nwdaf-data-collection ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy Subscription Service cd ocn-nwdaf-subscription/ helm install ocn-nwdaf-subscription ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy Analytics Service cd ocn-nwdaf-analytics/ helm install ocn-nwdaf-analytics ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../ # Deploy Configuration Service cd ocn-nwdaf-configuration-service/ helm install ocn-nwdaf-configuration-service ./ocn-nwdaf-chart --namespace=ocn-nwdaf cd ../
5.2.3 Verifying OCNWDAF Installation
This section describes how to verify if OCNWDAF is installed successfully.
To check the installation status, run any of the following commands:
helm3 ls release_name -n <release-namespace>
Example:
helm3 ls ocnwdaf -n ocnwdaf_namespace
You should see the status as DEPLOYED if the deployment is successful.
To get status of jobs and pods, run the following command:
kubectl get jobs,pods -n release_namespace
Example:
kubectl get pod -n ocnwdaf
You should see the status as Running and Ready for all the pods if the deployment is successful.
Run the following command to get status of services:
kubectl get services -n release_namespace
Example:
kubectl get services -n ocnwdaf_namespace
Note:
Take a backup of the following files that are required during disaster recovery:- Updated ocnwdaf-custom-values.yaml file
- Updated helm charts
- secrets, certificates, and keys that are used during installation
5.2.4 Performing Helm Test
Helm Test is a feature that validates the successful installation of OCNWDAF and determines if the NF is ready to take traffic. The pods are tested based on the namespace and label selector configured for the helm test configurations.
Note:
Helm Test can be performed only on helm3.Prerequisite: To perform the helm test, you must have the helm test configurations completed under the "Global Parameters" section of the custom_values.yaml
file. For more information on parameters, see Global Parameters.
Run the following command to perform the helm test:
helm3 test <helm-release_name> -n <namespace>
where:
helm-release-name
is the release name.
namespace
is the deployment namespace where OCNWDAF is installed.
Example:
helm3 test ocnwdaf -n ocnwdaf
Sample output:
NAME: ocnwdaf
LAST DEPLOYED: Mon Nov 14 11:01:24 2022
NAMESPACE: ocnwdaf
STATUS: deployed
REVISION: 1
TEST SUITE: ocnwdaf-test
Last Started: Mon Nov 14 11:01:45 2022
Last Completed: Mon Nov 14 11:01:53 2022
Phase: Succeeded
NOTES:
# Copyright 2022 (C), Oracle and/or its affiliates. All rights reserved