Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recover a Kubernetes Cluster

Tags:

At the moment I have a Kubernetes cluster distributed on AWS via kops. I have a doubt: is it possible to make a sort of snapshot of the Kubernetes cluster and recreate the same environment (master and pod nodes), for example to be resilient or to migrate the cluster in an easy way? I know that the Heptio Ark exists, it is very beautiful. But I'm curious to know if there is an easy way to do it. For example, is it enough to back up Etcd (or in my case the snapshot of EBS volumes)?

Thanks a lot. All suggestions are welcome

like image 442
falberto89 Avatar asked Oct 12 '18 18:10

falberto89


People also ask

Can Kubernetes recover from failure?

Applications running in the Kubernetes cluster will still be usable. However, it is not possible to create new deployments or to recover from node failures without the master node.

What happens if a node dies in Kubernetes?

When a worker node dies, the Pods running on the Node are also lost. You might think them and their data are lost but not so. The whole point with Kubernetes is to not let that happen. We normally deploy something like a ReplicaSet .

How do I restore nodes in Kubernetes?

back up /etc/kubernetes/pki. identify certs in /etc/kubernetes/pki that have the old IP address as an alt name - 1st step. delete both the cert and key for each of them (for me it was just apiserver and etcd/peer) regenerate the certs using kubeadm alpha phase certs - 2nd step.


1 Answers

kops stores its state in an S3 bucket identified by the KOPS_STATE_STORE. So yes, if your cluster has been removed you can restore it by running kops create cluster.

Keep in mind that it doesn't restore your etcd state so for that you are going to set up etcd backups. You could also make use of Heptio Ark.

Similar answers to this topic:

Recover kops Kubernetes cluster

How to restore kubernetes cluster using kops?

like image 71
Rico Avatar answered Oct 11 '22 13:10

Rico