Delete Profile¶
This section describes how to delete a Kubeflow profile, and clean up all data associated with this profile on Rok.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- A working Rok deployment.
- An existing Kubeflow deployment.
- An existing Kubeflow namespace.
Procedure¶
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-userSwitch to the
kubeflow/manifests/common
directory of your GitOps repository:root@rok-tools:~# cd ~/ops/deployments/kubeflow/manifests/commonDelete the
Profile
object on Kubernetes:root@rok-tools:~/ops/deployments/kubeflow/manifests/common# kubectl delete \ > -f namespace-resources/profiles/${NAMESPACE?}.yamlWarning
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 existit 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?}Wait for the profiles controller to delete the namespace:
root@rok-tools:~/ops/deployments/kubeflow/manifests/common# while \ > kubectl get ns ${NAMESPACE?}; do :; doneExec into the Rok Master Pod:
root@rok-tools:~/ops/deployments/kubeflow/manifests/common# kubectl exec \ > -ti -n rok service/rok -c rok -- /bin/bashSpecify 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-userPurge all data associated with the profile on Rok:
root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# rok account-delete --purgeWarning
This will permanently delete all data and metadata associated with this namespace in Rok, including all snapshots.
Exit the Rok master Pod:
root@rok-pqgsn|rok-node-xyz|rok.rok.svc.cluster.local:/# exitRemove the profile from your GitOps repository:
root@rok-tools:~/ops/deployments/kubeflow/manifests/common# git rm namespace-resources/profiles/${NAMESPACE?}.yamlTroubleshooting
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 filesit 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.
Commit your changes:
root@rok-tools:~/ops/deployments/kubeflow/manifests/common# git commit -m "Remove Profile ${NAMESPACE?}"
Verify¶
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-userCheck that the specified profile no longer exists:
root@rok-tools:~# kubectl get profiles ${NAMESPACE?} Error from server (NotFound): profiles.kubeflow.org "kubeflow-user" not foundCheck that the specified namespace no longer exists:
root@rok-tools:~# kubectl get ns ${NAMESPACE?} Error from server (NotFound): namespaces "kubeflow-user" not foundExec into the Rok Master Pod:
root@rok-tools:~# kubectl exec -ti -n rok service/rok -c rok -- /bin/bashCheck 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.