6 Uninstalling UDR

This chapter provides information about uninstalling Oracle Communications Cloud Native Core, Unified Data Repository (UDR).

6.1 Uninstalling UDR Using Helm

To uninstall or completely delete the UDR deployment, run the following command:
helm uninstall <helm_release_name_for_ocudr> --namespace <ocudr_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.
Example:
helm uninstall ocudr -n ocudr

Important:

As part of UDR uninstallation, its databases are not dropped. If you want to drop the databases, see Removing UDR Database.

Note:

The kubectl commands may vary depending on the platform deployment. Replace kubectl with Kubernetes environment-specific command line tool to configure Kubernetes resources through kube-api server. The instructions provided in this section are as per the Oracle Communications Cloud Native Environment (OCCNE) version of kube-api server.

Caution:

User, computer and applications, and character encoding settings may cause an issue when copy-pasting commands or any content from PDF. The PDF reader version also affects the copy-pasting functionality. It is recommended to verify the pasted content especially when the hyphens or any special characters are part of the copied content.

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 ocudr

To verify the UDR uninstallation, run the following command:

kubectl get all -n <release-namespace>

In case of successful uninstallation, no UDR resource is displayed in the command output.

If the command output displays the UDR resources or objects, then perform Deleting Kubernetes Namespace.

If the command output displays any Kubernetes namespace, then perform Deleting Kubernetes Namespace.

6.2 Deleting Kubernetes Namespace

This section describes how to delete Kubernetes namespace where UDR is deployed.

Run the following command to delete the Kubernetes namespace:
kubectl delete namespace <release_namespace>
Where,

<release_namespace> is the deployment namespace used by the Helm command.

For example:
kubectl delete namespace ocudr

6.3 Removing UDR Database

This section describes how to remove database when uninstalling UDR.

Single Site Deployment

Run the following command to remove UDR subscriber and configurations database on single site setup

Note:

When dropping <udrdb_name> or <udrconfigdb_name> database, make sure that there are no service or tools like nudr-bulk-import or nudr-odmand-migration running. If the service or tools are running, you must uninstall UDR deployment and UDR tools.
  1. Run the following command to log in to one of the ndb app SQL node pods.
    kubectl exec -it ndbappmysqld-0 -n <dbtier-ns> bash

    Example:

    kubectl exec -it ndbappmysqld-0 -n occne-rs1 bash
  2. Run the following command to log in to the SQL terminal using UDR database user credentials.
    mysql -h127.0.0.1 -u<username> -p<password>

    Example:

    mysql -h 127.0.0.1 -uudruser -pudrpasswd
  3. Run the following commands to drop the configuration and subscriber databases.
    drop database <udrdb_name>;
    drop database <udrconfigdb_name>;

    Example:

    drop database udrdb;
    drop database udrconfigdb;

Multiple Site Deployment

Run the following command to remove UDR subscriber and configurations databases on multisite setup.

Attention:

Perform the following steps on one of the sites by logging into one of the ndb app SQL nodes.

Note:

When dropping <udrdb_name> or <udrconfigdb_name> DB for multiple site , Make sure there are no service or tools like nudr-bulk-import or nudr-odmand-migration running in any site. If the service or tools are running, you must uninstall UDR deployment and UDR tools from all site.
  1. Run the following command to log in to one of the ndb app SQL node pods on one of the sites.
    kubectl exec -it ndbappmysqld-0 -n <dbtier-ns> bash

    Example:

    kubectl exec -it ndbappmysqld-0 -n occne-rs1 bash
  2. Run the following command to log in to the SQL terminal using UDR database user credentials.
    mysql -h127.0.0.1 -u<username> -p<password>

    Example:

    mysql -h 127.0.0.1 -uudruser -pudrpasswd
  3. Run the following commands to drop the configuration and subscriber databases.
    drop database <udrdb_name>;
    drop database <udrconfigdb_name>;

    Example:

    drop database udrdb;
    drop database udrconfigsite1db;
    drop database udrconfigsite2db;
    drop database udrconfigsite3db;

6.4 Cleaning UDR Deployment

This section describes how to clean the UDR deployment:

  1. Run the following command to remove all failed Helm releases:
    helm ls --all
  2. If UDR Helm release is in a failed state, then run the following command to uninstall the namespace:
    helm3 uninstall <release-name> -n <release-namespace>

    Note:

    If this is taking more time as it is running the delete hook jobs, then run the following script in parallel (in another session) to clear all the delete jobs.
    while true; do kubectl delete jobs --all -n <release-namespace>; sleep 5;done

    Monitor the "helm delete <release-namespace>" command. Once that is succeeded, press "ctrl+c" to stop the above command.

  3. Run the following command to clean all the Kubernetes objects:
    kubectl get all -n <release-namespace>

    It gives a detailed overview of the current objects of <release-namespace>. Delete all those objects.

    Caution:

    Be sure before running the following commands as it deletes all objects of Kubernetes in the specified namespace. In case the user has created RBAC and service account details before Helm install in the same namespace and is required, then do not delete them. In case, custom service account was 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:
    Deleting all the Kubernetes objects:
    kubectl delete all --all -n <release-namespace>
    Deleting all the current configmaps:
    kubectl delete cm --all -n <release-namespace>
  4. Run the following command to view all the pending resources not cleaned during helm uninstall.
    kubectl get all -n <release-namespace>
  5. Run the following command to delete the pending resources:
    kubectl delete <resource-type> <resource-name> -n <release-namespace>
  6. Run the following command to delete Kubernetes namespace:

    Caution:

    Be sure before removing the namespace. It deletes all the resources or objects created in the namespace.
    kubectl delete namespace <ocudr kubernetes namespace>
    Example:
    kubectl delete namespace ocudr