OCNRF Deployment

This chapter contains information about the OCNRF Deployment in Cloud Native Environment.

Pre-installation Procedure

Create Database User/Group

The OCNRF uses a MySQL database to store the configuration and run time data.

The OCNRF deployment using MySQL NDB cluster requires the database administrator to create a user in the MYSQL DB, and to provide the user with the necessary permissions to access the tables in the NDB cluster.

Note:

This procedure must be performed only once before initiating the OCNRF deployment.
  1. Login to the server where the ssh keys are stored and SQL nodes are accessible.
  2. Connect to the SQL nodes.
  3. Login to the Database as a root user.
  4. Create a user and assign it to a group having necessary permission to access the tables on all the SQL nodes:

    Create User with permission to access the tables on all the SQL nodes present in the NDB cluster, by executing:

    CREATE USER '****'@'%' IDENTIFIED BY '****';
    DROP DATABASE if exists nrfdb;
    CREATE DATABASE nrfdb CHARACTER SET utf8;
    GRANT SELECT, INSERT, CREATE, ALTER, DROP, LOCK TABLES, CREATE TEMPORARY TABLES, DELETE, UPDATE,
    EXECUTE ON nrfdb.* TO '****'@'%';
    USE nrfdb;

    Note:

    • Check if the user already exists, if yes then first drop the existing user and create a new one.
    • The <username> and <password> is created by the Database Administrator.
  5. In case OCNRF 1.2 is installed on a system having MYSQL cluster that was used in OCNRF 1.0 or OCNRF 1.1, the existing tables must be dropped before creating again for OCNRF 1.2, by executing the following command on one of the NDB SQL Nodes:
    DROP TABLE IF EXISTS `NfInstances`; 
    DROP TABLE IF EXISTS `NfStatusMonitor`;
    DROP TABLE IF EXISTS `NfSubscriptions`;
    DROP TABLE IF EXISTS `NfScreening`;
    DROP TABLE IF EXISTS `NrfSystemOptions`;
  6. Create OCNRF tables on one of the SQL Nodes by executing:
    CREATE TABLE IF NOT EXISTS `NfInstances` (
      `nfInstanceId` VARCHAR(36) NOT NULL,
      `nfType` VARCHAR(30) NOT NULL,
      `nfStatus` ENUM('REGISTERED', 'SUSPENDED', 'UNDISCOVERABLE') NOT NULL,
      `doc` JSON NOT NULL,
      `creationTimestamp` DATETIME NOT NULL,
      `lastUpdateTimestamp` DATETIME NOT NULL,
      primary key (`nfInstanceId`)
    )ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
      
    CREATE TABLE IF NOT EXISTS `NfStatusMonitor` (
      `nfInstanceId` VARCHAR(36) NOT NULL,
      `lastHbTimestamp` DATETIME,
      `lastNotifLoad` INTEGER,
      `nfLoad` INTEGER,
      `heartBeatTimer` INTEGER,
      `nfStatus` ENUM('REGISTERED', 'SUSPENDED','UNDISCOVERABLE') NOT NULL,
      `numHbMissed` INTEGER NOT NULL,
      `numHbMissedBeforeAudit` INTEGER NOT NULL,
      `suspendedTimestamp` DATETIME,
      `creationTimestamp` DATETIME NOT NULL,
      `lastUpdateTimestamp` DATETIME NOT NULL,
      primary key (`nfInstanceId`)
    )ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
      
    CREATE TABLE IF NOT EXISTS `NfSubscriptions`(
      `subscriptionId` VARCHAR(36) NOT NULL,
      `nfStatusNotificationUri` VARCHAR(256) NOT NULL,
      `doc` JSON NOT NULL,
      `validityTime` DATETIME NOT NULL,
      `creationTimestamp` DATETIME NOT NULL,
      `lastUpdateTimestamp` DATETIME NOT NULL,
      primary key (`subscriptionId`)
    )ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
     
    CREATE TABLE IF NOT EXISTS `NfScreening` (
      `nfScreeningRulesListType` ENUM('NF_FQDN', 'NF_IP_ENDPOINT', 'CALLBACK_URI', 'PLMN_ID', 'NF_TYPE_REGISTER') NOT NULL,
      `nfScreeningType` ENUM('BLACKLIST', 'WHITELIST') NOT NULL,
      `nfScreeningRulesListStatus` ENUM('ENABLED', 'DISABLED') NOT NULL DEFAULT 'DISABLED',
      `nfScreeningData` JSON NOT NULL,
      `creationTimestamp` DATETIME NOT NULL,
      `lastUpdateTimestamp` DATETIME NOT NULL,
      primary key (`nfScreeningRulesListType`)
    )ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
      
    CREATE TABLE IF NOT EXISTS `NrfSystemOptions` (
      `id` VARCHAR(36) UNIQUE NOT NULL,
      `nfScreeningFeatureStatus` ENUM('ENABLED','DISABLED') NOT NULL,
      `nfScreeningFailureHttpCode` SMALLINT NOT NULL,
      `nfHeartBeatTimer` SMALLINT NOT NULL,
      `nrfPlmnList` JSON NOT NULL,
      `nfNotifyLoadThreshold` SMALLINT NOT NULL,
      `nrfSupportForProfileChangesInResponse` BOOLEAN NOT NULL,
      `subscriptionValidityDuration` INTEGER NOT NULL,
      `nrfSupportForProfileChangesInNotification` BOOLEAN NOT NULL,
      `nfProfileSuspendDuration` INTEGER NOT NULL,
      `nfHearbeatMissAllowed` SMALLINT NOT NULL,
      `discoveryValidityPeriod` INTEGER NOT NULL,
      `profilesCountInDiscoveryResponse` SMALLINT,
      `discoveryResultLoadThreshold` SMALLINT,
      `creationTimestamp` DATETIME NOT NULL,
      `lastUpdateTimestamp` DATETIME NOT NULL,
      primary key (`id`)
    )ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
  7. Exit from database and logout from SQL node.

OCNRF Deployment on Kubernetes

Note:

By default, the namespace and helm release for OCNRF is ocnrf.

Table 3-3 OCNRF Deployment

Step # Procedure Description

1

Create customized ocnrf-custom-values-1.2.0.yaml file Create the customized ocnrf-custom-values-1.2.0.yaml with the required input parameters.

To configure the parameters, see section OCNRF Configuration.

or,

The ocnrf-custom-values-1.2.0.yaml template can be downloaded from OHC.

Download the Network Repository Function (NRF) Custom Template. Unzip the ocnrf-custom-configTemplates-1.2.0.0.0.zip to get ocnrf-custom-values-1.2.0.yaml file.

2

Go to the unzipped OCNRF package

Go to the unzipped OCNRF package in the following directory:

cd ocnrf-pkg-1.2.0.0.0

3

Deploy OCNRF Execute the following command:

helm install ocnrf/ --name <helm-release> --namespace <k8s namespace> -f <ocnrf_customized_values.yaml>

For example: helm install ocnrf/ --name ocnrf --namespace ocnrf -f ocnrf-custom-values-1.2.0.yaml

4

Check status of the deployment Execute the following command:

helm status <helm-release>

For example: helm status ocnrf

5

Check status of the services Execute the following command:

kubectl get services -n <k8s namespace>

For example:

kubectl get services -n ocnrf

Note: If metallb is used, EXTERNAL-IP is assigned to ocnrf-endpoint.

6

Check status of the pods Execute the following command:

kubectl get pods -n <k8s namespace>

Status column of all the pods should be 'Running'.

Ready column of all the pods should be n/n, where n is number of containers in the pod.

For example:

kubectl get pods -n ocnrf

NAME READY STATUS RESTARTS AGE
ocnrf-endpoint-6cb48bdc57-s6vws 2/2 Running 0 18h
ocnrf-mysql-5d695b599f-5gwhh 1/1 Running 0 18h
ocnrf-nfdiscovery-6c4b69c97f-sc84n 1/1 Running 0 18h
ocnrf-nfregistration-6bcf5d84b7-qfrjm 1/1 Running 0 18h
ocnrf-nfsubscription-67c6cc8fff-gtldj 1/1 Running 0 18h
ocnrf-nrfauditor-77d57949c7-gx2p2 1/1 Running 0 18h

Table 3-4 Parameters and Definitions for OCNRF Installation

Parameters Definitions
<helm-release> It is a name provided by the user to identify the helm deployment
<k8s namespace> It is a name provided by the user to identify the kubernetes namespace of the OCNRF. All the OCNRF micro services are deployed in this kubernetes namespace.