Clean Up Applications Using Rok¶
This section will guide you through cleaning up all applications using Rok PVCs in your Kubernetes cluster.
If you have already cleaned up all applications using Rok, you may proceed to the Verify section.
What You’ll Need¶
- A configured management environment.
- An existing Kubernetes cluster.
- An existing Rok deployment.
Check Your Environment¶
Before you clean up applications using Rok, ensure your management environment has access to your Kubernetes cluster. Verify that you can list the nodes of your cluster:
Delete your Kubeflow deployment:
Go to your GitOps repository, inside your
rok-toolsmanagement environment:root@rok-tools:~# cd ~/ops/deployments/
Purge your Kubeflow installation:root@rok-tools:~/ops/deployments# rok-deploy --delete install/kubeflow
This will delete all Kubeflow-related resources including the
kubeflownamespace and all user namespaces, i.e.,
The command reported a NotFound error
If you come across the following error about a resource
X, ingore it:Error from server (NotFound): error when deleting "STDIN": ...
This occurs when the deletion of some other resource triggers the deletion of
Xprior to the
A user namespace is stuck in a “Terminating” phase
If a user namespace, e.g.,
kubeflow-useris stuck in a
Terminatingphase, please take a look at the Kubeflow FAQ section.
List all PVCs in your cluster and see whether they are in use. The following command, displays the PVC name, namespace and storage class, and the Pod using the PVC:$ kubectl describe pvc -A | \ > grep -e ^Name: -e ^StorageClass: -e ^Mounted.By: -e Namespace: | \ > cut -d: -f2 | paste - - - - | sort -k 3 | column -t data-rok-etcd-0 rok gp2 rok-etcd-0 redis-data-rok-redis-0 rok gp2 rok-redis-0 data-test-postgresql-master-0 default rok <none> data-test-postgresql-slave-0 default rok <none> data-test-postgresql-slave-1 default rok <none>
Delete all pods that use PVCs of storage class
Delete all PVCs of storage class
Ensure that there are no Rok PVCs in your cluster by verifying that the following command produces no output:
You have successfully removed all applications using Rok PVCs from your Kubernetes cluster.
The next step is to clean up the Rok Scheduler and the Rok Scheduler Webhook from your cluster.