6 Uninstalling OCNADD

This chapter provides information on how to uninstall Oracle Communications Network Analytics Data Director (OCNADD).

When you uninstall a helm chart from the OCNADD deployment, it removes only the Kubernetes objects created during the installation.

Note:

kubectl commands might vary based 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 document are as per the Oracle Communications Cloud Native Core, Cloud Native Environment (CNE) version of kube-api server.

Caution:

  • While deleting any OCNADD resources make sure to provide the corresponding namespace used in the deployment.
  • Based on requirement, make sure to retain the OCNADD backup before the uninstallation procedure. For more information, see Performing OCNADD Backup Procedures.
  • Ensure any configured datafeeds are deleted using the OCNADD GUI prior to performing the OCNADD uninstallation steps. For deletion of the datafeeds, refer to Oracle Communications Network Analytics Data Director User Guide.

Uninstalling OCNADD in Non-Centralized Deployment Mode

To uninstall OCNADD in a Non-Centralized deployment mode, run the following command:

helm uninstall <ocnadd-release-name> --namespace <ocnadd-namespace>

Where,

<ocandd-release-name> is the release name of the OCNADD deployment.

<ocndd-namespace> is the name the namespace of OCNADD deployment.

For example:
helm  uninstall ocnadd -namespace ocnadd-deploy

Cleaning Up Database

To clean up database, perform the following steps:
  1. Log in to the MySQL client on SQL Node with the OCNADD user and password:
    mysql -h <IP_adress of SQL Node> -u <ocnadduser> -p (Give password in prompt)
  2. To clean up the configuration, alarm, and health database, run the following command:
    mysql> drop database <dbname>;
  3. To remove MySQL users while uninstalling OCNADD, run the following commands:
    SELECT user FROM mysql.user;
    DROP USER 'ocnaddappuser@'%';

Cleaning up Kafka Configuration

To clean up Kafka configuration, perform the following steps:
  1. To list the secrets in the namespace, run the following command:
    kubectl get secrets -n <namespace>
  2. To delete all the secrets related to Kafka, run the following command:
    kubectl delete secret --all -n <namespace>
  3. To delete configmap used for Kafka, run the following command:
    kubectl delete configmap --all -n <namespace>
  4. To delete PVCs used for Kafka,
    1. run the following command, and list the PVCs used in the namespace:
      kubectl get pvc -n <namespace>
    2. run the following command, and delete the PVCs used by the brokers and zookeepers:
      kubectl delete pvc --all -n <namespace>

Verifying Uninstallation

To verify the Oracle Communications Network Analytics Data Director (OCNADD) uninstallation, run the following command:

kubectl get all -n <release-namespace>

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

If the command output displays the OCNADD 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>

      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>
    Example:
    kubectl delete namespace ocnadd

    Caution:

    The command removes all the resources or objects created in the namespace. Therefore, ensure that you run the command only when you want to delete the namespace completely.

Uninstalling OCNADD in Centralized Deployment Mode

To uninstall OCNADD in Centralized deployment mode, run the following steps:
  1. Uninstall the worker groups one after another using the following command:
    helm uninstall <worker-group-release-name> --namespace <worker-group-namespace>
    For example:
    helm  uninstall ocnadd-wg1 -namespace dd-worker-group1
  2. Clean up Kafka Configuration for all the worker groups.

    To clean up the Kafka configuration, perform the following steps for all the worker groups:

    1. To list the secrets in the namespace, run the following command:
      kubectl get secrets -n <worker-group-namespace>
    2. To delete all the secrets related to Kafka, run the following command:
      kubectl delete secret --all -n <worker-group-namespace>
    3. To delete configmap used for Kafka, run the following command:
      kubectl delete configmap --all -n <worker-group-namespace>
    4. To delete PVCs used for Kafka,
      1. run the following command, and list the PVCs used in the namespace:
        kubectl get pvc -n <worker-group-namespace>
      2. run the following command, and delete the PVCs used by the brokers and zookeepers:
        kubectl delete pvc --all -n <worker-group-namespace>
  3. Delete all the worker group's hns namespaces using the below command:
    kubectl hns delete <worker-group-namespace> -n <mgmt-group-namespace>
  4. Uninstall the management group using the following command:
    helm uninstall <management-release-name> --namespace <management-group-namespace>
    For example:
    helm  uninstall ocnadd-mgmt --namespace dd-mgmt-group
  5. Clean up the Database.

    To clean up the database, perform the following steps:

    1. Log in to the MySQL client on SQL Node with the OCNADD user and password:
      mysql -h <IP_address of SQL Node> -u <ocnadduser> -p
    2. To clean up the configuration, alarm, and health database, run the following command: pass the database names in
      mysql> drop database <dbname>;
    3. To remove MySQL users while uninstalling OCNADD, run the following commands:
      
      SELECT user FROM mysql.user;        
      DROP USER 'ocnaddappuser@'%';

Verifying Uninstallation

To verify the OCNADD centralized deployment uninstallation, run the following command:
  1. Check the sub namespaces exists
    kubectl hns tree <mgmt-group-namespace>
    1. If the output list any sub namespaces then perform the following:
      kubectl hns delete <worker-group-namespace>  -n <mgmt-group-namespace>
  2. Check the parent namespace
     kubectl get all -n <management-group-namespace>

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

    If the command output displays the OCNADD resources or objects, then perform the following procedure:
    1. Run the following command to delete all the objects:
      1. To delete all the Kubernetes objects:
        kubectl delete all --all -n <mgmt-group-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 <management-group-namespace>
      3. Run the following command to delete the management group namespace:
        kubectl delete namespace <management-group-namespace>
        For example:
        kubectl delete namespace ocnadd-deploy

        Caution:

        The command removes all the resources or objects created in the namespace. Therefore, ensure that you run the command only when you want to delete the namespace completely.