Rancher Disaster Recovery: Best Practices and Procedures
82%
What is a Snapshot?
In Rancher, snapshots are backups of your Kubernetes cluster that include three key components:
- The etcd data, which stores the cluster's state.
- The Kubernetes version.
- The cluster configuration (settings and changes you’ve made).
These snapshots allow you to restore your cluster if something goes wrong. For example:
- If only the data in etcd is affected, you can restore just the etcd data.
- If a Kubernetes upgrade caused issues, you can restore both etcd and the Kubernetes version to return to the previous, stable state.
- If both the Kubernetes version and cluster configuration caused problems, you can restore everything (etcd, Kubernetes version, and configuration).
To take a snapshot, you can use the Rancher UI and follow these steps:
- Click on
Global>Cluster Management - Next to the cluster you want to take a snapshot of, click on the three dots and select
Take Snapshot
When the snapshot is complete, it will be saved in the /var/lib/rancher/rke2/server/db/snapshots/ directory on the etcd nodes. The snapshot files are named based on the cluster name, the timestamp, and a unique identifier. For example:
# SSH to an etcd node and run the following command
ls -l /var/lib/rancher/rke2/server/db/snapshots/
End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector
The full journey from nothing to productionEnroll now to unlock all content and receive all future updates for free.
