F Uninstall NRF
This section includes the sections that are used in the NRF uninstallation procedure.
F.1 Uninstalling NRF Using Helm
This section describes the procedure for uninstalling NRF using Helm.
- Run the following command to find the namespace of the NRF deployment which should be
uninstalled.
helm ls -n <namespace>Where,
<namespace>is the NRF deployment namespace name. - Run the following command to uninstall NRF.
Run the following command to completely delete or remove the NRF deployment:
helm uninstall <helm-release> -n <namespace>Where,<helm-release>is a name provided to identify the Helm deployment.<namespace>is the name provided to identify the namespace of NRF deployment.
For example:
helm uninstall ocnrf -n ocnrf
Helm keeps a record of its releases, so you can still reactivate the release after uninstalling it.
To verify the NRF uninstallation, run the following command:
$ kubectl get all -n <release-namespace>
In case of successful uninstallation, no NRF resource is displayed in the command output. DBTier or cnDBTier resources can still remain by design until DBTier uninstall step is executed.
If the command output displays the NRF resources or objects, then perform Delete Kubernetes Resources (if required).
F.2 Delete Kubernetes Resources (if required)
This section describes how to delete Kubernetes resources or objects where NRF is deployed.
Caution:
- Be sure before running the following commands as it deletes all the Kubernetes objects in the specified namespace.
- If the RBAC and service account details are to be reused, then the below step of removing the kubernetes resources can be skipped.
- Run the following command to delete all the Kubernetes
objects:
kubectl delete all --all -n <release-namespace> - Run the following command to delete all the
configmaps:
kubectl delete cm --all -n <release-namespace> - Run the following command to delete the specific
resources:
kubectl delete <resource-type> <resource-name> -n <release-namespace>
F.3 Deleting Kubernetes Namespace (if required)
This section describes how to delete the Kubernetes namespace where NRF is deployed.
Run the following command to delete the Kubernetes namespace:
Caution:
Be sure before removing the namespace, as it deletes all the resources or objects created in the namespace.kubectl delete namespace <ocnrf kubernetes namespace>For example:
kubectl delete namespace ocnrf
F.4 Clear the Application DB, Network DB, Common Configuration DB, and Leader Election DB from the Database
This section describes how to clear the application, network, common configuration, and leader election database.
- Remove the application
database
Drop database nrfApplicationDB - Remove the network database
Drop database nrfNetworkDB - Remove the common configuration database
Drop database commonConfigurationDB - Remove the Leader Election database
Drop database leaderElectionDB
F.5 Remove the site specific data from the state and the Configuration Databases
This section details the steps for deleting the site specific data from the state and the configuration databases.
- Delete the following data from the NRF application
database:
$ DELETE FROM NfScreening WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NrfSystemOptions WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NfInstances WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NfStatusMonitor WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NfSubscriptions WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NrfEventTransactions WHERE recordCreator = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM SiteJsonSchemaVersionInfo WHERE SiteId = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM SiteIdToNrfInstanceIdMapping WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; - Delete the following data from the NRF network
database:
$ DELETE FROM ReleaseConfig WHERE SiteId = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NfScreening_backup WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM NrfSystemOptions_backup WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; $ DELETE FROM SiteIdToNrfInstanceIdMapping_backup WHERE recordOwner = '<NRF’s NF Instance ID of Site under deletion>'; - Delete the following data from NRF site-specific common configuration database
(commonConfigurationDB):
DROP TABLE IF EXISTS common_configuration; DROP TABLE IF EXISTS common_configuration_backup; - Delete the following data from the NRF site-specific Leader Election database
(leaderElectionDB):
DROP TABLE IF EXISTS NrfAuditorLeaderPod; DROP TABLE IF EXISTS perf_info_leader_election;
F.6 Remove Uninstalled NRFs from the Georedundancy Options of the Other Sites
Post NRF uninstallation, you can reinstall the same NRF version that is supported by the cnDBTier.
After uninstalling NRF sites, it is necessary to update the georedundancy configuration on the remaining sites to remove references to the uninstalled NRFs.
{apiRoot}/nrf-configuration/v1/geoRedundancyOptions) must be
updated on each surviving site. At runtime, this update is performed using an HTTP PUT
request. As part of the update, ensure that
siteNameToNrfInstanceIdMappingList includes only the surviving NRF
instances.
"siteNameToNrfInstanceIdMappingList": [
{
"siteName": "Site-2",
"nrfInstanceId": "6faf1bbc-6e4a-4454-a507-a14ef8e1bc5d"
}
]To update the georedundancy configuration, see Oracle Communications Cloud Native Core, Network Repository Function REST API Guide.