Cluster Backups
Learn about backing up a Kubernetes cluster using the CLI.
Adopting a back up strategy to protect a Kubernetes cluster against control plane node failures is important, especially for clusters with only one control plane node. High availability clusters with many control plane nodes also need a fallback plan if the resilience provided by the replication and fail over functionality has been exceeded.
The state for Kubernetes clusters is maintained in an etcd
database. Access
to the database is shared between all Kubernetes API Server instances. Taking regular backups
of the etcd
database is a critical part of a Kubernetes disaster recovery
plan.
Typically, the backup contains sensitive data, such as Kubernetes Secret objects, so care must be taken to store the backups in a secure location.
If restoring from an etcd
backup is part of a disaster recovery strategy,
the integrity of the backup file is important. Backups must therefore be stored in a location
with integrity safeguards.
Important:
Only the key containers required for the Kubernetes control plane node are backed up. No application containers are backed up.
You don't need to bring down the cluster to perform a back up as part of a disaster recovery
plan. Use the ocne cluster backup
command to back up the key containers and
manifests for all the control plane nodes in the cluster (the etcd
database).
Important:
The CLI doesn't provide a command to restore a cluster from an etcd
database backup. For information on restoring a cluster using the etcd
backup, see the upstream Kubernetes documentation.
Backing Up a Cluster
Back up the etcd
database for a Kubernetes cluster using the
ocne cluster backup
command.
Use the ocne cluster backup
command to back up the
etcd
database for a Kubernetes cluster. The syntax is:
ocne cluster backup
{-o|--out} path
For more information on the syntax options, see Oracle Cloud Native Environment: CLI.
Example 10-1 Back up the etcd
database for a cluster
To back up the etcd
database for a cluster to the current
directory:
ocne cluster backup --out mybackup.db