7 Uninstalling CNC Console

This chapter provides information about uninstalling Cloud Native Configuration Console.

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 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. 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.

7.1 Uninstalling CNC Console Using Helm

To uninstall CNC Console, run the following command:

$ helm uninstall <release_name> --namespace <namespace_name>
Where,

<release_name> is a name provided by the user to identify the helm deployment.

<namespace_name> is a name provided by the user to identify the namespace of CNC Console deployment.

For example:

$ helm uninstall cncc --namespace cncc

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 occncc

7.2 Deleting Kubernetes Namespace

Perform the following procedure to clean up the CNC Console deployment.

To delete the Jobs after CNC Console is uninstalled or purged:
  1. Run the following command to check whether the jobs are present after uninstalling CNC Console:
    $ kubectl get jobs -n <namespace_name>
    Example:
    $ kubectl get jobs -n cncc
  2. If jobs are present, delete jobs using following command:
    $ kubectl delete jobs --all -n <namespace_name>
    Example:
    $ kubectl delete jobs --all -n cncc

7.3 Deleting the CNC Console MySQL details

Perform the following procedure to delete the CNC Console MySQL database and MySQL user:

  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 as a user with 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, user need to enter the password specific to the user mentioned in the command.
  4. Run the following command to remove CNC Console databases:
    1. Run the following command to remove CNCC Console IAM database:
      $ DROP DATABASE if exists <CNCC IAM Database>;
      Example:
      $ DROP DATABASE if exists cnccdb;
    2. Run the following command to remove CNCC Console Core database:
      $ DROP DATABASE if exists <CNCC Core Common Config Database>;
      Example:
      
      $ DROP DATABASE if exists <CNCC Core Common Config Database>;
      $ DROP DATABASE if exists mcncccommonconfig;
  5. Run the following command to remove the CNCC MySQL Users:
    $ DROP USER IF EXISTS <CNCC User Name>;

    Example:

    $ DROP USER IF EXISTS cnccusr;

    Caution:

    Remove MySQL users on all the SQL nodes from all the CNCC clusters.
  6. Exit from MySQL prompt and SQL node.

7.4 CNC Console Cleanup During Upgrade Failure

The CNC Console 22.2.x or earlier releases used two helm chart deployment for deploying cncc-iam and cncc-core components. From CNC Console 22.3.0 onwards, single helm chart is used for deploying all the console components.

This section discuss about the required clean up, if the helm upgrade fails due to miss configuration. You must perform this procedure before running helm upgrade again.

Following resources require cleanup during upgrade failure:

  • Roles
  • RoleBindings
  • ServiceAccounts
  • ConfigMaps
  • PodDisruptionBudgets
  • Services

Note:

While upgrading from older CNCC version to CNCC 23.4.4, it is recommended to upgrade using the existing IAM release name ("cncc-iam"). The examples mentioned below are based on this assumption that release name is cncc-iam.

For more details about the upgrade, see CNC Console Upgrade and Rollback Procedure section.

Cleanup Steps:

  • For Roles
  1. Run the following command to check for the roles created:
    $ kubectl get roles –n <namespace_name>
    Example:
    $ kubectl get roles –n cncc
  2. Run the following command to delete the following roles if exists:
    $ kubectl delete roles -n <namespace_name> <release_name>-acore-ingressgateway-role
                                               <release_name>-mcore-ingressgateway-role
                                               <release_name>-iam-ingressgateway-role
                                               <release_name>-helmtest-role
    Example:
    $ kubectl delete roles -n cncc cncc-acore-ingressgateway-role cncc-mcore-ingressgateway-role cncc-iam-ingressgateway-role cncc-helmtest-role

  • RoleBindings
  1. Run the following command to check whether the RoleBindings already exist:
    $ kubectl get rolebindings –n <namespace_name>
    Example:
    $ kubectl get rolebindings –n cncc
  2. Run the following command to delete the following RoleBindings if exists:
    $ kubectl delete rolebindings -n <namespace_name> <release_name>-acore-ingressgateway-rolebinding-v1
                                                      <release_name>-mcore-ingressgateway-rolebinding-v1
                                                      <release_name>-iam-ingressgateway-rolebinding-v1
                                                      <release_name>-helmtest-rolebinding
    Example:
    $ kubectl delete rolebindings -n cncc cncc-acore-ingressgateway-rolebinding-v1
          cncc-mcore-ingressgateway-rolebinding-v1 cncc-iam-ingressgateway-rolebinding-v1
          cncc-helmtest-rolebinding
  • ServiceAccounts
  1. Run the following command to check whether the ServiceAccounts already exist:
    $ kubectl get sa –n <namespace_name>
    Example:
    $ kubectl get sa –n cncc
  2. Run the following command to delete the following ServiceAccounts if exists:
    $ kubectl delete sa -n cncc <release_name>-acore-ingress-gateway
                                 <release_name>-helmtest-serviceaccount
                                 <release_name>-mcore-ingress-gateway
    Example:
    $ kubectl delete sa -n cncc cncc-acore-ingress-gateway cncc-helmtest-serviceaccount
          cncc-mcore-ingress-gateway cncc-iam-ingress-gateway
  • ConfigMaps
  1. Run the following command to check whether the ConfigMaps already exist:
    $ kubectl get configmap –n <namespace_name>
    Example:
    $ kubectl get configmap –n cncc
  2. Run the following command to delete the following ConfigMaps if exists:
    kubectl delete configmap -n <namespace_name  <release_name>-acore-ingress-gateway
                                                   <release_name>-mcore-cmservice
                                                   <release_name>-mcore-ingress-gateway
                                                   <release_name>-iam-ingress-gateway
    Example:
    $ kubectl delete configmap -n cncc cncc-acore-ingress-gateway cncc-mcore-cmservice
          cncc-mcore-ingress-gateway cncc-iam-ingress-gateway
  • PodDisruptionBudgets
  1. Run the following command to check whether the PodDisruptionBudgets already exist:
    $ kubectl get poddisruptionbudget –n <namespace_name>
    Example:
    $ kubectl get poddisruptionbudget –n cncc
  2. Run the following command to delete the following PodDisruptionBudgets if exists:
    $ kubectl delete poddisruptionbudget -n <namespace_name> <release_name>-acore-ingress-gateway-podDisruptionBudget
                                                             <release_name>-mcore-cmservice-podDisruptionBudget
                                                             <release_name>-mcore-ingress-gateway-podDisruptionBudget
                                                             <release_name>-iam-ingress-gateway-podDisruptionBudget
    Example:
    $ kubectl delete poddisruptionbudget -n cncc  cncc-acore-ingress-gateway-podDisruptionBudget
          cncc-mcore-cmservice-podDisruptionBudget cncc-mcore-ingress-gateway-podDisruptionBudget
          cncc-iam-ingress-gateway-podDisruptionBudget
  • Services
  1. Run the following command to check whether the Services already exist:
    $ kubectl get Services –n <namespace_name>
    Example:
    $ kubectl get Services –n cncc
  2. Run the following command to delete the following Services if exists:
    $ kubectl delete svc -n <namespace_name> <release_name>-acore-igw-cache
                                             <release_name>-acore-ingress-gateway
                                             <release_name>-mcore-cmservice
                                             <release_name>-mcore-igw-cache
                                             <release_name>-mcore-ingress-gateway
                                             <release_name>-iam-igw-cache
                                             <release_name>-iam-ingress-gateway
                                             <release_name>-iam-kc-headless
                                             <release_name>-iam-kc-http
    Example:
    $ kubectl delete svc -n cncc cncc-acore-igw-cache cncc-acore-ingress-gateway
          cncc-mcore-cmservice cncc-mcore-igw-cache cncc-iam-igw-cache cncc-mcore-ingress-gateway
          cncc-iam-ingress-gateway cncc-iam-kc-headless

7.5 CNC Console Helm Test Cleanup

For the information about CNC Console Helm Test Cleanup, see Helm Test Cleanup section.