Is it possible to undo kubernetes cluster delete command?

6/19/2019

Is it possible to undo "gcloud container clusters delete" command?

-- João Pedro Assis Bittencourt
devops
google-cloud-platform
kubernetes

2 Answers

7/3/2019

Unfortunately if you will delete cluster it is impossible to undo this.

In the GCP documentation you can check what will be deleted after gcloud container clusters delete and what will remain after this command.
One of the things which will remain is Persistent disk volumes. It means that if your ClaimPolicy was set to Retain and your PV status is Released you will be able to get data from PersistentVolume. To do that you will have to create PersistentVolumeClain. More info about ReclaimPolicyhere.

Run $ kubectl get pv to check if it is still bound and check ReclaimPolicy. Similar case can be found in this github thread.

In this documentation you can find step by stop how to connect pod to specific PV.

In addition, please note that you can backup your cluster. To do this you can use for example Ark.

-- PjoterS
Source: StackOverflow

6/19/2019

Unfortunately not: Deleting a Cluster

All the source volumes and data (that are not persistent) are removed, and unless you made a conscious choice to take a backup of the cluster, it would be a permanent operation.

If a backup does exist, it would be a restore from backup rather than a revert on the delete command.

I suggest reading a bit more into the Administration of a cluster on Gcloud for more info: Administration of Clusters Overview

-- pypalms
Source: StackOverflow