Remove an OpenStack cluster¶
This section instructs you on how to remove an OpenStack cluster, deployed on
top of Kubernetes, by deleting the openstackdeployments.lcm.mirantis.com
(OsDpl) CR.
To remove an OpenStack cluster:
Verify that the OsDpl object is present:
kubectl get osdpl -n openstack
Delete the OsDpl object:
kubectl delete osdpl osh-dev -n openstack
The deletion may take a certain amount of time.
Verify that all pods and jobs have been deleted and no objects are present in the command output:
kubectl get pods,jobs -n openstack
Delete Persistent Volume Claims (PVCs) using the following snippet. Deletion of PVCs causes data deletion on Persistent Volumes. The volumes themselves will become available for further operations.
Caution
Before deleting PVCs, save valuable data in a safe place.
#!/bin/bash PVCS=$(kubectl get pvc --all-namespaces |egrep "openstack|openstack-redis" | egrep "redis|etcd|mariadb" | awk '{print $1" "$2" "$4}'| column -t ) echo "$PVCS" | while read line; do PVC_NAMESPACE=$(echo "$line" | awk '{print $1}') PVC_NAME=$(echo "$line" | awk '{print $2}') echo "Deleting PVC ${PVC_NAME}" kubectl delete pvc ${PVC_NAME} -n ${PVC_NAMESPACE} done
Note
Deletion of PVCs may get stuck if a resource that uses the PVC is still running. Once the resource is deleted, the PVC deletion process will proceed.
Delete the MariaDB state ConfigMap:
kubectl delete configmap openstack-mariadb-mariadb-state -n openstack
Delete secrets using the following snippet:
#!/bin/bash SECRETS=$(kubectl get secret -n openstack | awk '{print $1}'| column -t | awk 'NR>1') echo "$SECRETS" | while read line; do echo "Deleting Secret ${line}" kubectl delete secret ${line} -n openstack done
Verify that OpenStack ConfigMaps and secrets have been deleted:
kubectl get configmaps,secrets -n openstack