6 Uninstalling BSF
This chapter provides information about uninstalling Oracle Communications Cloud Native Core, Binding Support Function (BSF).
When you uninstall a Helm chart from BSF deployment, it removes only the Kubernetes objects that were created during the installation.
6.1 Uninstalling CNC BSF using Helm
This chapter describes how to uninstall BSF using Helm.
To uninstall BSF, run the following command:
helm delete -n <release_name>
release-namespace is a name provided by the user to identify the namespace of BSF deployment.
Helm keeps a record of its releases, so you can still reactivate the release after uninstalling it.
--purge
parameter to Helm 2 uninstall command:
helm delete --purge release_name
helm delete --purge ocbsf
Note:
- When you uninstall both BSF and cnDBtier network functions, it is recommended to delete PVC (PersistentVolumeClaims) volumes of cnDBTier that were created at the time of installing cnDBtier. For more information on how to delete PVC volumes, see Deleting PVC Volumes.
- If you are uninstalling only BSF network function, do not delete PVC volumes.
6.2 Deleting Kubernetes Namespace
This chapter describes how to delete Kubernetes namespace where BSF is deployed.
kubectl delete namespace <release-namespace>
where
release_namespace is the
deployment namespace used by the helm command.
kubectl delete namespace ocbsf
6.3 Removing MySQL Users
This chapter describes how to remove MySQL users.
SELECT user FROM mysql.user;
DROP USER 'bsfprivilegedusr'@'%';
DROP USER 'bsfusr'@'%';
6.4 Deleting PVC Volumes
This section describes how to delete a PVC volume.
Following is the procedure for to delete a PVC volume:
- Get a list of the PVC volumes for the required cnDBTier namespace by
running the following command:
kubectl get pvc -n <namespace>
where,
<namespace> is the namespace of Policy deployment.
For example:
kubectl get pvc -n occnp
Sample Output
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE pvc-backup-ndbmtd-ndbmtd-0 Bound pvc-56420da4-f70c-46fd-8f0a-c33ff50ddd98 3Gi RWO standard 26d pvc-backup-ndbmtd-ndbmtd-1 Bound pvc-d7e3ef21-4161-40cc-abc9-756dfd3c0674 3Gi RWO standard 26d pvc-ndbappmysqld-ndbappmysqld-0 Bound pvc-d76f0cbd-c0e5-48f1-9a83-1353dbee6c41 2Gi RWO standard 26d pvc-ndbappmysqld-ndbappmysqld-1 Bound pvc-c31749df-ae98-48c1-a8a7-449535d0f60a 2Gi RWO standard 26d pvc-ndbmgmd-ndbmgmd-0 Bound pvc-765a9a4b-726d-43fe-af91-a3a6c85ab321 1Gi RWO standard 26d pvc-ndbmgmd-ndbmgmd-1 Bound pvc-71b5877e-a753-4fac-b995-5fdf2d465af8 1Gi RWO standard 26d pvc-ndbmtd-ndbmtd-0 Bound pvc-e0c5f263-d5d3-4f18-bb11-44ceaa6a2305 3Gi RWO standard 26d pvc-ndbmtd-ndbmtd-1 Bound pvc-d03f799d-abe2-4b71-96c4-c98cacdbeaba 3Gi RWO standard 26d pvc-ndbmysqld-ndbmysqld-0 Bound pvc-d80321a9-5239-4e34-9bcf-11053c9de5ef 2Gi RWO standard 26d pvc-ndbmysqld-ndbmysqld-1 Bound pvc-545e0f35-ad20-4c24-927a-6f1e49b06cc9 2Gi RWO standard 26d
- Delete all the PVC volumes in the cnDBTier namespace by running the
following command:
kubectl -n <namespace> delete pvc <pvc_name>
Example:kubectl -n p1 delete pvc pvc-backup-ndbmtd-ndbmtd-0 kubectl -n p1 delete pvc pvc-backup-ndbmtd-ndbmtd-1 kubectl -n p1 delete pvc pvc-ndbappmysqld-ndbappmysqld-0 kubectl -n p1 delete pvc pvc-ndbappmysqld-ndbappmysqld-1 kubectl -n p1 delete pvc pvc-ndbmgmd-ndbmgmd-0 kubectl -n p1 delete pvc pvc-ndbmgmd-ndbmgmd-1 kubectl -n p1 delete pvc pvc-ndbmtd-ndbmtd-0 kubectl -n p1 delete pvc pvc-ndbmtd-ndbmtd-1 kubectl -n p1 delete pvc pvc-ndbmysqld-ndbmysqld-0 kubectl -n p1 delete pvc pvc-ndbmysqld-ndbmysqld-1
6.5 Uninstalling Site in Georedundant Deployment
This chapter describes how to uninstall a site (except the last site) when BSF is deployed in georedundant setup.
For
georedundant deployment, run the following command to delete entries of unique
databases from the occnp_release
database:
delete from ReleaseConfig where SiteId='7c4f7f05-ffdd-408f-ba78-b2c4dc83b1fd' AND CfgKey='public.hook.auditservice';
delete from ReleaseConfig where SiteId='7c4f7f05-ffdd-408f-ba78-b2c4dc83b1fd' AND CfgKey='public.hook.cmservice';
delete from ReleaseConfig where SiteId='7c4f7f05-ffdd-408f-ba78-b2c4dc83b1fd' AND CfgKey='public.hook.configserver';
- Select cast(db as char), cast(table_name as char), cast(conflict_fn as char)
from
mysql.ndb_replication:
mysql> select cast(db as char), cast(table_name as char), cast(conflict_fn as char) from mysql.ndb_replication;
Sample Output
+------------------+--------------------------+-------------------------------------------+ | cast(db as char) | cast(table_name as char) | cast(conflict_fn as char) | +------------------+--------------------------+-------------------------------------------+ | ocpm_bsf | pcf_binding | NDB$MAX_DELETE_WIN(last_access_timestamp) | +------------------+--------------------------+-------------------------------------------+ 1 rows in set (0.01 sec)
If the output for this command shows BSF databases as shown in the sample output, then perform Step 2.
- Delete from
mysql.ndb_replication:
delete from mysql.ndb_replication where cast(db as char)="<database_name>";
Example
delete from mysql.ndb_replication where cast(db as char)="ocpm_bsf";
6.6 Uninstalling Last Site in Georedundant Deployment
This chapter describes how to uninstall the last site when BSF is deployed in georedundant setup. The same steps can be performed to uninstall BSF in standalone deployment.
6.6.1 Cleaning up NDB Replication Table
This chapter describes how to cleanup NDB replication table while uninstalling BSF.
- Select cast(db as char), cast(table_name as char), cast(conflict_fn as char)
from
mysql.ndb_replication:
mysql> select cast(db as char), cast(table_name as char), cast(conflict_fn as char) from mysql.ndb_replication;
Sample Output
+------------------+--------------------------+-------------------------------------------+ | cast(db as char) | cast(table_name as char) | cast(conflict_fn as char) | +------------------+--------------------------+-------------------------------------------+ | ocpm_bsf | pcf_binding | NDB$MAX_DELETE_WIN(last_access_timestamp) | +------------------+--------------------------+-------------------------------------------+ 1 rows in set (0.01 sec)
If the output for this command shows BSF databases as shown in the sample output, then perform Step 2.
- Delete from
mysql.ndb_replication:
delete from mysql.ndb_replication where cast(db as char)="<database_name>";
Example
delete from mysql.ndb_replication where cast(db as char)="ocpm_bsf";
6.6.2 Cleaning up Databases
This chapter describes how to clean up databases when uninstalling BSF.
Note:
For georedundant deployment, run the commands provided in this section only if the site being uninstalled is the last site in the complete georedundant group.DROP DATABASE IF EXISTS ocbsf_release;
DROP DATABASE IF EXISTS ocbsf_commonconfig;
DROP DATABASE IF EXISTS ocbsf_config_server;
DROP DATABASE IF EXISTS ocpm_bsf;
DROP DATABASE IF EXISTS ocbsf_audit_service;
DROP DATABASE IF EXISTS ocbsf_cmservice;
DROP DATABASE IF EXISTS ocbsf_nrf_client;
DROP DATABASE IF EXISTS ocbsf_leaderPodDb;