---
# System prepended metadata

title: Kubernetes Backup & Restore

---

# Kubernetes Backup & Restore

## Only *etcd* backup
- Official etcd Github readme - https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md
    - Etcd 2
    - Etcd 3
        - Snapshot backup & recovery
            - Recovering a cluster first needs a snapshot of the keyspace from an etcd member. A snapshot may either be taken from a live member with the etcdctl snapshot save command or by copying the member/snap/db file from an etcd data directory
            - To restore a cluster, all that is needed is a single snapshot "db" file. A cluster restore with etcdctl snapshot restore creates new etcd data directories; all members should restore using the same snapshot. Restoring overwrites some snapshot metadata (specifically, the member ID and cluster ID); the member loses its former identity. This metadata overwrite prevents the new member from inadvertently joining an existing cluster. Therefore in order to start a cluster from a snapshot, the restore must start a new logical cluster.

### *kops* *etcd* backup
- https://github.com/kubernetes/kops/issues/1896
- *kops* *etcd* backup docs, includes tool (etcd-manager-ctl) to restore during disastor scenarios https://github.com/kubernetes/kops/blob/b550db283c39766a7276e98fe02360f80c9c969b/docs/operations/etcd_backup_restore_encryption.md#backing-up-etcd
## Full cluster backup

- Valero (previously Heptio Ark) https://github.com/vmware-tanzu/velero
    - https://github.com/vmware-tanzu/velero/blob/master/site/docs/master/faq.md
    - https://blog.kubernauts.io/backup-and-restore-of-kubernetes-applications-using-heptios-velero-with-restic-and-rook-ceph-as-2e8df15b1487

> Little bit about Ark / Velero
> Heptio’s Ark , now known as Velero, has become the de-facto number one backup tool for Kubernetes clusters. It also takes snapshots of your cluster’s Persistent Volumes using your cloud provider’s block storage snapshot features, and can then restore your cluster’s objects and Persistent Volumes to a previous state.
> You can use Velero to perform full backups, only backups of some namespaces or resource types or you can schedule backups to execute them periodically.


# Misc

- *kops* Operations -> https://github.com/kubernetes/kops/tree/b550db283c39766a7276e98fe02360f80c9c969b/docs/operations
-  Restoring failed *kops* cluster -> https://www.hindenes.com/2019-08-09-Kops-Restore/
-  ETCD Consensus -> https://blog.containership.io/etcd/