Delete Profile

This section describes how to delete a Kubeflow profile, and clean up all data associated with this profile on Rok.

Procedure

  1. Specify the namespace that corresponds to the profile you want to delete:

    root@rok-tools:~# export NAMESPACE=<NAMESPACE>

    Replace <NAMESPACE> with the name of the Kubeflow namespace that you want to delete, for example:

    root@rok-tools:~# export NAMESPACE=kubeflow-user
  2. Switch to the kubeflow/manifests/common directory of your GitOps repository:

    root@rok-tools:~# cd ~/ops/deployments/kubeflow/manifests/common
  3. Delete the Profile object on Kubernetes:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# kubectl delete \ > -f namespace-resources/profiles/${NAMESPACE?}.yaml

    Warning

    This will permanently delete all Kubernetes resources in that namespace, including all notebooks and all PVCs.

    Troubleshooting

    the path does not exist

    If you get an error message similar to the following:

    error: the path "namespace-resources/profiles/kubeflow-user.yaml" does not exist

    it means you have created the profile by logging in instead of following the Create Profile guide.

    In this case, run the following command to delete the Profile object on Kubernetes:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# kubectl \ > delete profile ${NAMESPACE?}
  4. Wait for the profiles controller to delete the namespace:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# while \ > kubectl get ns ${NAMESPACE?}; do :; done
  5. Exec into the Rok Master Pod:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# kubectl exec \ > -ti -n rok service/rok -c rok -- /bin/bash
  6. Specify the namespace that corresponds to the profile you just deleted:

    root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# export ROK_ACCOUNT=<NAMESPACE>

    Replace <NAMESPACE> with the name of the Kubeflow namespace that you specified in step 1 above, for example:

    root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# export ROK_ACCOUNT=kubeflow-user
  7. Purge all data associated with the profile on Rok:

    root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# rok account-delete --purge

    Warning

    This will permanently delete all data and metadata associated with this namespace in Rok, including all snapshots.

  8. Exit the Rok master Pod:

    root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# exit
  9. Remove the profile from your GitOps repository:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# git rm namespace-resources/profiles/${NAMESPACE?}.yaml

    Troubleshooting

    pathspec did not match any files

    If you see a message similar to the following:

    fatal: pathspec 'namespace-resources/profiles/kubeflow-klolos.yaml' did not match any files

    it means you have created the profile by logging in instead of following the Create Profile guide

    In this case, skip this step and proceed to the Summary section.

  10. Commit your changes:

    root@rok-tools:~/ops/deployments/kubeflow/manifests/common# git commit -m "Remove Profile ${NAMESPACE?}"

Verify

  1. Specify the namespace that you want to verify:

    root@rok-tools:~# export NAMESPACE=<NAMESPACE>

    Replace NAMESPACE with the name of the namespace that you wish to verify, for example:

    root@rok-tools:~# export NAMESPACE=kubeflow-user
  2. Check that the specified profile no longer exists:

    root@rok-tools:~# kubectl get profiles ${NAMESPACE?} Error from server (NotFound): profiles.kubeflow.org "kubeflow-user" not found
  3. Check that the specified namespace no longer exists:

    root@rok-tools:~# kubectl get ns ${NAMESPACE?} Error from server (NotFound): namespaces "kubeflow-user" not found
  4. Exec into the Rok Master Pod:

    root@rok-tools:~# kubectl exec -ti -n rok service/rok -c rok -- /bin/bash
  5. Check that all data associated with the specified profile is purged from Rok:

    root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# rok-gw-manage account-list | grep ${NAMESPACE?} 2022-03-31T08:37:48.251370+0000 api pid=10095/tid=10095/pytid=140690753562048 cache:178 [INFO] Initialized authentication backends: AuthService, KubernetesToken

Summary

You have successfully deleted a Kubeflow profile and all data associated with it from your Kubernetes cluster.

What’s Next

Check out the rest of the operations you can perform on your Kubeflow deployment.