5.5 Uninstalling NEF
This section provides information about uninstalling Oracle Communications Cloud
Native Core, Network Exposure Function (NEF).
Note:
When you uninstall a Helm chart from the NEF deployment, it removes only the Kubernetes objects created during the installation.5.5.1 Uninstalling NEF Using Helm
To uninstall NEF, run the following command:
Run the following command to completely delete or remove the NEF 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 NEF deployment.
For example:
helm uninstall ocnef -n ocnef
Helm keeps a record of its releases, so you can still reactivate the release after uninstalling it.
To completely remove a release from the cluster, add the
--purge
parameter to helm delete
command:helm delete --purge release_name
For
example:helm delete --purge ocnef
To verify the NEF uninstallation, run the following
command:
$ kubectl get all -n <release-namespace>
To check the uninstallation status of the pods, use the following
command:
kubectl get pods -<release-namespace>
Note:
- During helm uninstallation if the Kubernetes jobs started by the helm hooks get
stuck, then you can use the following command to delete the jobs
manually:
while true; do kubectl delete jobs --all -n <release-namespace>; sleep 5;done
- If the command output displays the NEF resources or objects, then perform Deleting Kubernetes Resources.
- If the command output displays any Kubernetes namespace, then perform the Deleting Kubernetes Namespace.
5.5.2 Deleting Kubernetes Namespace
This section describes how to delete Kubernetes namespace where NEF is deployed.
Run the following command to delete the Kubernetes namespace:
Note:
Be sure before removing the namespace as it deletes all the resources or objects created in the namespace.kubectl delete namespace <ocnef Kubernetes namespace>
For
example:kubectl delete namespace ocnef
To verify the NEF uninstallation, run the following
command:
$ kubectl get all -n <release-namespace>
In case of successful uninstallation, no NEF resource is displayed in the command output.
If the command output displays the NEF resources or objects, then perform the
following procedure:
- Run the following command to delete all the objects:
- To delete all the Kubernetes
objects:
kubectl delete all --all -n <release-namespace>
- To delete all the
configmaps:
kubectl delete cm --all -n <release-namespace>
Caution:
The command deletes all the Kubernetes objects of the specified namespace. In case you have created the RBAC resources and service accounts before the helm installation in the same namespace, and these resources are required, then do not delete them. - To delete all the Kubernetes
objects:
- Run the following command to delete the specific
resources:
kubectl delete <resource-type> <resource-name> -n <release-namespace>
- Run the following command to delete the Kubernetes
namespace:
kubectl delete namespace <release-namespace>
5.5.3 Deleting Kubernetes Resources
This section describes how to delete Kubernetes resources or objects where NEF is
deployed.
Note:
Be sure before running the following commands as it deletes all the Kubernetes objects in the specified namespace.- 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>
Note:
If the user has created RBAC and service account details before Helm, installing in the same namespace is required, do not delete RBAC and service account details. In case a custom service account is not provided by the user, and it is safe to remove it, then run the following commands to delete the resources or objects which are not required. - Run the following command to delete the specific
resources:
kubectl delete <resource-type> <resource-name> -n <release-namespace>
5.5.4 Deleting the MySQL Details
Procedure for complete removal of MySQL database and username
This procedure explains the steps to complete removal of MySQL database and users.
- Log in to the machine which has permission to access the SQL nodes of NDB cluster.
- Connect to the SQL node of NDB cluster successively.
- Log in to the MySQL prompt using root permission or user, which has permission
to drop the tables. For example:
mysql -h 127.0.0.1 -uroot -p
Note:
This command may vary from system to system, path for MySQL binary, root user and root password. After running this command, the user must enter the password specific to the user mentioned in the command. - Run the following command to remove NEF
databases:
$ DROP DATABASE if exists <NEF database>;
For example, to remove a database named ocnef_db, run the following command:DROP DATABASE IF EXISTS ocnef_db;
- Run the following command to remove the NEF MySQL Users:
Remove NEF privileged user:
For example:$ DROP USER IF EXISTS <NEF Privileged-User Name>;
$ DROP USER IF EXISTS 'priviledgeduser@'%';
Remove NEF application user:
For example:$ DROP USER IF EXISTS <NEF Application User Name>;
$ DROP USER IF EXISTS 'appuser@'%';
Note:
Removal of MySQL Users must be done on all the SQL nodes from all the NEF sites. - Exit from MySQL prompt and SQL node.