Skip to content

Configuration snapshot fallback#

Each backup archive includes a snapshot of the cluster configuration, and a restore rebuilds the cluster from that snapshot. Normally, the snapshot is the configuration you last applied. If the MKE operator has not finished reconciling that configuration when the backup runs, no current configuration exists to include. The configuration snapshot fallback setting determines what the backup does in that case.

To set the fallback, pass --config-snapshot-fallback to mkectl backup, or set spec.backup.schedule.configSnapshotFallback for scheduled backups.

Behavior mkectl backup Scheduled backups
Use the current operator snapshot;
if reconciliation is pending, wait up to
--config-sync-timeout (default: 2 minutes).
Fail if no current snapshot becomes available.
auto (default) Not available
Refuse to create the backup. none None (default)
Include the last configuration the operator fully applied. last-known-good LastKnownGood
Include the configuration file on your local machine. local Not available

For scheduled backups, the two values behave as follows:

  • With None, MKE 4 skips the run, produces no archive, and retries at the next scheduled time.
  • With LastKnownGood, MKE 4 creates the archive with the last fully applied configuration, if a usable snapshot exists, and marks the backup record as containing a non-current configuration. If no usable snapshot exists, MKE 4 skips the run and retries at the next scheduled time.

LastKnownGood trades freshness for availability

With LastKnownGood, scheduled backups continue while the operator is stuck, but each archive can contain an increasingly stale configuration. For this reason, the setting is opt-in: the default refuses the run rather than include a configuration you did not request.

Before it bootstraps the cluster, the mkectl restore command prompts for confirmation. If the archive contains a configuration that was not current at backup time, the command also displays the configuration provenance and prompts you to accept that configuration.

These prompts read from standard input, so they cannot run during an unattended restore or when you pipe the passphrase with --passphrase -. In these cases, pass both of the following flags:

  • --force skips the bootstrap confirmation.
  • --accept-noncurrent-config accepts the noncurrent configuration.
mkectl restore --hosts-path <hosts-file> --name <backup-tar-file> \
  --passphrase - --force --accept-noncurrent-config \
  < /path/to/passphrase-file

To restore an archive from an earlier MKE 4 release, use the mkectl version that created the archive.