How Do You Delete VM Instances from GCP That Pertain to GKE?

Problem Scenario
You have some GKE standard clusters that you want deleted.  What should you do?

Possible Solution #1 (from the Cloud Shell or with a gcloud command)
1.  Delete the instance group of the instance for the cluster you want to delete.  To do this in the web UI, go to Compute Engine -> Instance Groups.  Check the box on the left-hand side and click on "Delete".
2.  Go to the ">_" icon in the upper right-hand corner.  When you hover over it, it should say "Activate Cloud Shell".  Click on it.
3.  Run this command (but replace "gke-standard-cluster-1-default-pool-abcd1234-56ef" with the name of the instance and replace "us-central1-a" with its regional name):

gcloud compute instances delete gke-standard-cluster-1-default-pool-abcd1234-56ef --zone us-central1-a

4.  Respond with a "Y" to the next prompt.

Possible Solution #2 (from the console or web UI)
1. Go here:
2. Click on the cluster you want to delete.
3. Click the "Delete" button.

Leave a comment

Your email address will not be published. Required fields are marked *