Deleting Kubernetes cluster from GCP failed

1/31/2019

I made a small setup of Kubernetes cluster. After few hours I tried to delete it. But, it impossible to delete the cloud resource.

I tried from the GCP UI:

enter image description here

and from with gcloud:

$ gcloud container clusters delete nat-test-cluster
The following clusters will be deleted.
 - [nat-test-cluster] in [europe-west3-c]

Do you want to continue (Y/n)?  Y

ERROR: (gcloud.container.clusters.delete) Some requests did not succeed:
 - args: [u'ResponseError: code=404, message=Not found: projects/proj/zones/europe-west3-c/clusters/nat-test-cluster.\nCould not find [nat-test-cluster] in [europe-west3-c].\nDid you mean [nat-test-cluster] in [us-central1-a]?']
   exit_code: 1
   message: ResponseError: code=404, message=Not found: projects/dotnet-core-cluster/zones/europe-west3-c/clusters/nat-test-cluster.
Could not find [nat-test-cluster] in [europe-west3-c].
Did you mean [nat-test-cluster] in [us-central1-a]?

Those machines are looks like still working, but in accessible. I dont know what else to try. Contact gcp billing support to stop the billing but they said I dont have technial support plan and they can't help me. So annoying that I need to pay for support for problems not in my control.

How to delete this cluster? What to do?

-- No1Lives4Ever
google-cloud-platform
kubernetes

1 Answer

1/31/2019

If we look at the documentation for deleting a cluster found here:

https://cloud.google.com/sdk/gcloud/reference/container/clusters/delete

We find that it has an optional zone parameter. When you create (or delete) a cluster, you MUST supply a zone. If you do NOT supply a zone, your default zone (as believed by the gcloud command) will be used. In your output, we seem to see that your gcloud command thinks its DEFAULT zone is europe-west3-c while it appears that the zone in which the cluster lives is us-central1-a. I believe the solution will be to add the --zone us-central1-a parameter to your gcloud command.

-- Kolban
Source: StackOverflow