8 Uninstalling CNC Console

This section explains uninstallation procedure of CNC Console and its details in MySQL.

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.

Deleting CNC Console Deployment

Perform the following procedure to uninstall the CNC Console.The steps needs to be run from a server that has access to Kubectl and helm commands.

Run the following command to uninstall CNC Console:
$ helm uninstall <release_name> --namespace <namespace_name>
Example:

$ helm uninstall cncc --namespace cncc

Cleaning CNC Console Deployment

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

Deleting the CNC Console MySQL details

This section explains the complete removal procedure of 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;
      $ DROP DATABASE if exists acncccommonconfig;
      
  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.

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. This procedure needs to performed before running helm upgrade again.

Following resources require cleanup

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

Note:

While upgrading from older CNCC version to CNCC 22.3.0, 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-iam-acore-ingressgateway-role
          cncc-iam-mcore-ingressgateway-role cncc-iam-iam-ingressgateway-role
          cncc-iam-helmtest-role

  • RoleBindings
  1. Run the following command to check whether the RoleBindings are 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-iam-acore-ingressgateway-rolebinding-v1
            cncc-iam-mcore-ingressgateway-rolebinding-v1 cncc-iam-iam-ingressgateway-rolebinding-v1
            cncc-iam-helmtest-rolebinding                                        
  • ServiceAccounts
  1. Run the following command to check whether the ServiceAccounts are 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-iam-acore-ingress-gateway cncc-iam-helmtest-serviceaccount
          cncc-iam-mcore-ingress-gateway
  • ConfigMaps
  1. Run the following command to check whether the ConfigMaps are 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-cmservice
                                                   <release_name>-acore-ingress-gateway
                                                   <release_name>-mcore-cmservice
                                                   <release_name>-mcore-ingress-gateway
    Example:
    $ kubectl delete configmap -n cncc cncc-iam-acore-cmservice cncc-iam-acore-ingress-gateway
          cncc-iam-mcore-cmservice cncc-iam-mcore-ingress-gateway
  • PodDisruptionBudgets
  1. Run the following command to check whether the PodDisruptionBudgets are 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-cmservice-podDisruptionBudget
                                                             <release_name>-acore-ingress-gateway-podDisruptionBudget
                                                             <release_name>-mcore-cmservice-podDisruptionBudget
                                                             <release_name>-mcore-ingress-gateway-podDisruptionBudget
    Example:
    $ $ kubectl delete poddisruptionbudget -n cncc cncc-iam-acore-cmservice-podDisruptionBudget
          cncc-iam-acore-ingress-gateway-podDisruptionBudget
          cncc-iam-mcore-cmservice-podDisruptionBudget
          cncc-iam-mcore-ingress-gateway-podDisruptionBudget
  • Services
  1. Run the following command to check whether the Services are 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-cmservice
                                             <release_name>-acore-igw-cache
                                             <release_name>-acore-ingress-gateway
                                             <release_name>-mcore-cmservice
                                             <release_name>-mcore-igw-cache
    
    Example:
    $ kubectl delete svc -n cncc cncc-iam-acore-cmservice cncc-iam-acore-igw-cache
          cncc-iam-acore-ingress-gateway cncc-iam-mcore-cmservice cncc-iam-mcore-igw-cache
          cncc-iam-iam-igw-cache

CNC Console Helm Test Cleanup

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