How to delete a Kubeflow cluster?

12/10/2018

I tried to install KubeFlow but use the wrong region, how to delete it? I tried to do it from Kubernetes clsuter but keep getting the same error when I try to create a new one:

Error 409: 'projects/dpe-cloud-mle/global/deployments/kubeflow' already exists and cannot be created., duplicate
-- gogasca
google-kubernetes-engine
kubeflow
kubernetes

3 Answers

11/25/2019

run the following set of commands to delete all resources associated with the kubeflow deployment:

//Delete the deployment via deployment manager

gcloud deployment-manager --project=${PROJECT} deployments delete ${DEPLOYMENT_NAME}

//Delete your Cloud Storage bucket when you’ve finished with it: gsutil rm -r gs://${BUCKET_NAME}

Delete the container images uploaded to Container Registry: // Find the digest id for each container image:

gcloud container images list-tags gcr.io/${PROJECT}/${DEPLOYMENT_NAME}-train gcloud container images list-tags gcr.io/${PROJECT}/${DEPLOYMENT_NAME}-web-ui

// Delete each image:

gcloud container images delete gcr.io/$PROJECT/${DEPLOYMENT_NAME}- train:$DIGEST_ID gcloud container images delete gcr.io/$PROJECT/${DEPLOYMENT_NAME}-web- ui:$DIGEST_ID

-- Paddy Popeye
Source: StackOverflow

12/10/2018

This is a feature of Deployment Manager, which is used to create the cluster. If you create any resource using DM, but edit or delete it manually (=elsewhere in the console), the record of it remains unchanged in the DM.

To fix your issue, navigate to Deployment Manager in your GCP Console and delete the relevant deployment. Then you will be able to re-install KubeFlow without this error.

-- Robert Lacok
Source: StackOverflow

1/29/2019

Alternatively you can also remove the deployment via the command line as mentioned on the GKE set-up instructions

${KUBEFLOW_SRC}/scripts/kfctl.sh delete all
-- Sven.DG
Source: StackOverflow