I need to delete a GKE cluster. When I try to delete using the gcloud command, it mentions that it is trying to upgrade somthing on the cluster. Before running this command, I tried to enable Filestore CSI driver on the cluster which was hanging. How can I forcefully delete the whole cluster ?
gcloud container clusters delete demo-gke-cluster-1 --region asia-east1
The following clusters will be deleted.
- [demo-gke-cluster-1] in [asia-east1]
Do you want to continue (Y/n)? Y
ERROR: (gcloud.container.clusters.delete) Some requests did not succeed:
- ResponseError: code=400, message=Operation operation-1737536133718-793b68ca-9cb7-4168-8a42-fe1bcd384d2d is currently upgrading cluster demo-gke-cluster-1. Please wait and try again once it is done.
As per this official GKE document :
You can cancel an upgrade at any time. To learn more about what happens when you cancel a surge upgrade, see Cancel a surge upgrade. To learn more about what happens when you cancel a blue-green upgrade, see Cancel a blue-green upgrade.
Get the upgrade's operation ID:
$ gcloud container operations list
Cancel the upgrade:
$ gcloud container operations cancel OPERATION_ID
Refer to the gcloud container operations cancel documentation.
So, after cancelling the upgrade you can delete the cluster that you want to delete. Check this official GCP document for Deleting a cluster for more details.