- Home
- Configuration
- Backup
- Temporary directory and disk space
Temporary directory and disk space#
Before the mkectl backup command streams the etcd snapshot to the machine that
runs the command, k0s stages the snapshot in a temporary directory on a
manager node. By default, this directory is /tmp. The directory must have free
space at least equal to the size of the etcd database file,
<data-dir>/etcd/member/snap/db.
On hosts where /tmp is a small tmpfs, set the staging directory to a path on
a larger filesystem:
-
To change the staging directory for all backups, set
spec.backup.tempDirin the MKE 4 configuration file:spec: backup: tempDir: /var/lib/mke/tmp -
To change the staging directory for a single run, pass the
--temp-dirflag. The flag overridesspec.backup.tempDir.mkectl backup -f <config_file_path> --temp-dir /var/lib/mke/tmp --passphrase -
The staging directory setting also applies to:
- The backup that
mkectl upgradetakes before it upgrades the cluster - The backups that
mkectl node addandmkectl node removetake mkectl restore, which unpacks the backup archive in the staging directory
Scheduled backups run on the manager nodes. If spec.backup.tempDir is not set,
scheduled backups stage the snapshot in spec.backup.schedule.path, the
directory that stores the archive.