kubernetes tutorial | ETCD Backup and Restore using "etcdctl" tool | Demo
HTML-код
- Опубликовано: 7 фев 2025
- CERTIFIED KUBERNETES ADMINISTRATOR
-------------------------------------------------------------------------
kubernetes tutorial | ETCD Backup and Restore using "etcdctl" tool | Demo
--------------------------------------------------------------------------------------------------------------------------
In this video, you are going to see a DEMO on "ETCD Backup and Restore"
For suggestions/feedback/doubts contact
email: kvk@vsparkz.com
Happy Learning !!!
===========================================================================================
USEFUL LINKS
----------------------------
Operating ETCD Clusters
kubernetes.io/...
Backup and Restore ETCD
kubernetes.io/...
Install ETCD binaries
etcd.io/docs/v...
github.com/etc...
Kubectl Command Reference
kubernetes.io/...
==========================================================================================
#cka #kubernetes #k8s #containers #vsparkz
DEMO STEPS
****************
Step 1 - Connect to the k8S Cluster and Check ETCD Version
-----------------------------------------------------------------------------------------------------
$ kubectl cluster-info
$ kubectl get nodes
$ kubectl get pods -n kube-system
$ kubectl describe pods pod_name -n kube-system
Step 2 - Download and Install “etcdctl” Tool
---------------------------------------------------------------------------
Reference: etcd.io/docs/v...
$ curl -L storage.google... -o /tmp/etcd-v3.5.10-linux-amd64.tar.gz
$ tar xzvf /tmp/etcd-v3.5.10-linux-amd64.tar.gz -C /tmp
$ cp /tmp/etcd-v3.5.10-linux-amd64/etcdctl /usr/local/bin/
Step 3 - Take a Backup from ETCD database using “etcdctl” Tool
------------------------------------------------------------------------------------------------------------
Reference: kubernetes.io/...
$ ETCDCTL_API=3 etcdctl snapshot save /root/snapshot.db --endpoints=127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key
$ ETCDCTL_API=3 etcdctl --write-out=table snapshot status /root/snapshot.db
Step 4 - Delete the deployments/pods in the cluster
------------------------------------------------------------------------------------------
$ kubectl delete deployment deployment_name
Step 5 - Create a New ETCD volume directory and restore the Snapshot
----------------------------------------------------------------------------------------------------------------------
$ mkdir /var/lib/etcd-bkp
$ ETCDCTL_API=3 etcdctl snapshot restore /root/snapshot.db --endpoints=127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --data-dir=/var/lib/etcd-bkp
Step 6 - Update the ETCD static pod definition to use the New ETCD Volume
--------------------------------------------------------------------------------------------------------------------
$ vim /etc/kubernetes/manifest/etcd.yaml
Step 7 - Inspect the cluster after the ETCD backup restoration
----------------------------------------------------------------------------------------------------------
$ kubectl get all
THE END
Bro thanks for clarifying everything man….earned respect man….clarity given by you about topic is next level man 🙌🏻
Hi, thanks for the great video. Wasn't the status of ETCD pod in pending state ? what was the reason ?