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:
  1. 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.
  2. Run the following command to delete the specific resources:
    kubectl delete <resource-type> <resource-name> -n <release-namespace>
  3. 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.
  1. Run the following command to delete all the Kubernetes objects:
    kubectl delete all --all -n <release-namespace>
  2. 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.
  3. 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.
  1. Log in to the machine which has permission to access the SQL nodes of NDB cluster.
  2. Connect to the SQL node of NDB cluster successively.
  3. 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.
  4. 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;
  5. Run the following command to remove the NEF MySQL Users:
    Remove NEF privileged user:
    $ DROP USER IF EXISTS <NEF Privileged-User Name>;
    For example:
    $ DROP USER IF EXISTS 'priviledgeduser@'%';
    Remove NEF application user:
    $ DROP USER IF EXISTS <NEF Application User Name>;
    For example:
    $ DROP USER IF EXISTS 'appuser@'%';

    Note:

    Removal of MySQL Users must be done on all the SQL nodes from all the NEF sites.
  6. Exit from MySQL prompt and SQL node.