Clean Up Applications Using Rok

This section will guide you through cleaning up all applications using Rok PVCs in your Kubernetes cluster.

Note

If you have already cleaned up all applications using Rok, you may proceed to the Verify section.

What You’ll Need

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:

root@rok-tools:~# kubectl get nodes NAME STATUS ROLES AGE VERSION aks-agentpool-42574219-vmss000000 Ready agent 47h v1.23.8 aks-agentpool-42574219-vmss000001 Ready agent 47h v1.23.8 aks-workers-42574219-vmss000000 Ready agent 46h v1.23.8 aks-workers-42574219-vmss000001 Ready agent 46h v1.23.8 aks-workers-42574219-vmss000002 Ready agent 46h v1.23.8

Procedure

  1. Delete your Kubeflow deployment:

    1. Go to your GitOps repository, inside your rok-tools management environment:

      root@rok-tools:~# cd ~/ops/deployments/
    2. Purge your Kubeflow installation:

      root@rok-tools:~/ops/deployments# rok-deploy --delete install/kubeflow

      Caution

      This will delete all Kubeflow-related resources including the kubeflow namespace and all user namespaces, i.e., kubeflow-XXX.

      Troubleshooting

      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 X prior to the kubectl delete.

      A user namespace is stuck in a “Terminating” phase

      If a user namespace, e.g., kubeflow-user is stuck in a Terminating phase, please take a look at the Kubeflow FAQ section.

  2. 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>
  3. Delete all pods that use PVCs of storage class rok.

  4. Delete all PVCs of storage class rok.

Verify

Ensure that there are no Rok PVCs in your cluster by verifying that the following command produces no output:

root@rok-tools:~# kubectl describe pvc -A | grep -e "^StorageClass:\s*rok$"

Summary

You have successfully removed all applications using Rok PVCs from your Kubernetes cluster.

What’s Next

The next step is to clean up the Rok Scheduler and the Rok Scheduler Webhook from your cluster.