Automated snapshots let Stronghold create backups of integrated Raft storage on a schedule and write them either to local disk or to S3-compatible object storage.

Automated snapshots are available only when Stronghold uses integrated Raft storage. For etcd, PostgreSQL, and other external backends, configure backup procedures provided by the storage system itself.

Automated snapshots are designed for recurring backups without manual command execution. They are especially useful for production clusters where backup retention must be predictable and copies should be stored outside the cluster itself.

Consider the following when using automated snapshots:

  • You can create multiple named snapshot configurations.
  • Each configuration defines the schedule, retention policy, and storage type.
  • Supported storage types are local and aws-s3.
  • For production environments, use external object storage instead of local storage: the active node can change over time, and backups must be stored outside the system they protect.

Snapshot names use the format <file_prefix>-<N>.snap, where <N> is the creation time in Unix nanoseconds. Retention cleanup only considers files or objects with this naming format under the configured path or prefix. Two configurations of the same storage type cannot use the same destination (path_prefix and file_prefix; for aws-s3 also the same bucket and region).

Each configuration runs as a separate job. After a configuration is created or changed, its job is restarted: if there is no saved status yet, the first snapshot is taken after one tenth of interval (at most 10 minutes); otherwise it is taken once interval has elapsed since the start of the last snapshot. Subsequent snapshots are taken interval after the previous one finishes. After a failed snapshot, the next attempt is made with an exponential backoff (starting at 1 minute, doubling each time, capped at interval). Changing a configuration resets consecutive_errors.

Create or update a configuration

Use the following endpoint to create or update an automated snapshot configuration:

MethodPath
POST/sys/storage/raft/snapshot-auto/config/:name

The endpoint requires sudo privileges. The request replaces the whole configuration: there is no partial update, so always pass all required parameters, including storage_type.

Core parameters

ParameterTypeRequiredDefaultDescription
nameStringYes—Name of the configuration to create or update
intervalInteger or stringNo1hTime between backups. You can specify seconds or Go duration format such as 24h, 1h30m. A standalone day value such as 1d is also accepted; to combine days with smaller units use equivalent hours (e.g. 25h30m instead of 1d1h30m). The minimum interval is 1s
retainIntegerNo1Number of backups to keep. Retention cleanup runs before and after each snapshot. Older backups are deleted when the limit is exceeded. A value of 0 disables deletion of old snapshots. Negative values are not allowed
storage_typeStringYes—Storage type: local or aws-s3
path_prefixStringYes for local—For local, the directory where snapshots are stored (/ is not allowed). For aws-s3, the object prefix inside the bucket; a leading / is ignored.
file_prefixStringNovault-snapshotPrefix for the file or object name stored in path_prefix. Must not contain /.

Additional parameters for local

ParameterTypeRequiredDefaultDescription
local_max_spaceIntegerYes—Maximum number of bytes backup files with the specified file_prefix may use in the path_prefix directory. A value of 0 disables the check

Additional parameters for aws-s3

ParameterTypeRequiredDefaultDescription
aws_s3_bucketStringYes—Bucket name used for backup storage
aws_s3_regionStringYes—Bucket region
aws_access_key_idStringNo—Access key ID for the bucket
aws_secret_access_keyStringNo—Secret access key for the bucket
aws_session_tokenStringNo—Session token for temporary AWS credentials
aws_s3_endpointStringNo—S3 service endpoint
aws_s3_disable_tlsBooleanNofalseDisables TLS for the S3 endpoint. Use only for testing
aws_s3_ca_certificateStringNo—CA certificate for the S3 endpoint in PEM format
aws_s3_server_side_encryptionBooleanNofalseEncrypts objects in the bucket with AES256 (SSE-S3). Cannot be combined with aws_s3_enable_kms
aws_s3_enable_kmsBooleanNofalseEncrypts objects in the bucket with AWS KMS. Cannot be combined with aws_s3_server_side_encryption
aws_s3_kms_keyStringNo—Name of the KMS key to use. Requires aws_s3_enable_kms=true

Configuration examples

Local disk

The following local-snapshot.json file creates a configuration that saves a snapshot every 5 minutes into /stronghold/data/backups, keeps 4 copies, limits the space used by snapshots to 1 GiB, and uses the main_stronghold file prefix:

{
  "interval": "5m",
  "path_prefix": "/stronghold/data/backups",
  "file_prefix": "main_stronghold",
  "retain": "4",
  "storage_type": "local",
  "local_max_space": 1073741824
}

If the directory from path_prefix does not exist, Stronghold tries to create it (with mode 0700) when taking a snapshot. Make sure the Stronghold process can write to the parent directory; if the directory cannot be created, last_snapshot_error contains a failed to create ... message.

Apply the configuration from local-snapshot.json using the following command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold write sys/storage/raft/snapshot-auto/config/my-local-snapshots @local-snapshot.json
stronghold write sys/storage/raft/snapshot-auto/config/my-local-snapshots @local-snapshot.json

In the example, the path /stronghold/data/ is a path inside the container, and by default it is mounted at /var/lib/deckhouse/stronghold/ on the master nodes of the DP cluster. Created snapshots can be found and downloaded from the master nodes at /var/lib/deckhouse/stronghold/backups/. Snapshots will remain unchanged when pods are restarted.

S3-compatible storage

The following minio-snapshot.json file stores snapshots in S3-compatible object storage:

{
  "interval": "3m",
  "path_prefix": "snapshots",
  "file_prefix": "stronghold_backup",
  "retain": "15",
  "storage_type": "aws-s3",
  "aws_s3_bucket": "my_bucket",
  "aws_s3_endpoint": "minio.domain.ru",
  "aws_s3_region": "us-east-1",
  "aws_access_key_id": "<ACCESS_KEY>",
  "aws_secret_access_key": "<SECRET_ACCESS_KEY>"
}

Before applying the configuration, make sure the bucket already exists and the provided credentials have read and write permissions.

Apply the configuration from minio-snapshot.json using the following command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold write sys/storage/raft/snapshot-auto/config/my-remote-snapshots @minio-snapshot.json
stronghold write sys/storage/raft/snapshot-auto/config/my-remote-snapshots @minio-snapshot.json

Updating an existing configuration

A configuration is replaced as a whole, so to change selected fields pass the full document with the new values (including storage_type and the required parameters of the chosen storage type):

{
  "interval": "3m",
  "path_prefix": "/stronghold/data/backups",
  "file_prefix": "main_stronghold",
  "retain": "10",
  "storage_type": "local",
  "local_max_space": 1073741824
}

Apply the modified configuration from local-snapshot-update.json using the following command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold write sys/storage/raft/snapshot-auto/config/my-local-snapshots @local-snapshot-update.json
stronghold write sys/storage/raft/snapshot-auto/config/my-local-snapshots @local-snapshot-update.json

After any successful update, the job of this configuration is restarted and the schedule is recalculated.

List configurations

Use the following endpoint to list automated snapshot configurations:

MethodPath
LIST/sys/storage/raft/snapshot-auto/config

Example command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold list sys/storage/raft/snapshot-auto/config
stronghold list sys/storage/raft/snapshot-auto/config

Read configuration parameters

Use the following endpoint to read the parameters of an automated snapshot configuration:

MethodPath
GET/sys/storage/raft/snapshot-auto/config/:name

Example command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold read sys/storage/raft/snapshot-auto/config/my-remote-snapshots
stronghold read sys/storage/raft/snapshot-auto/config/my-remote-snapshots

For aws-s3, the response includes aws_access_key_id and aws_secret_access_key in plain text, so restrict access to this endpoint.

Delete a configuration

Use the following endpoint to delete an automated snapshot configuration:

MethodPath
DELETE/sys/storage/raft/snapshot-auto/config/:name

Example command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold delete sys/storage/raft/snapshot-auto/config/my-remote-snapshots
stronghold delete sys/storage/raft/snapshot-auto/config/my-remote-snapshots

Deleting an automated snapshot configuration does not remove existing snapshot files from local or object storage.

Read backup status

Use the following endpoint to read the status of automated snapshots:

MethodPath
GET/sys/storage/raft/snapshot-auto/status/:name

Example command:

  • Stronghold in DP
  • Stronghold in Linux
d8 stronghold read sys/storage/raft/snapshot-auto/status/my-remote-snapshots
stronghold read sys/storage/raft/snapshot-auto/status/my-remote-snapshots

Main status fields:

  • consecutive_errors: Number of backup errors in a row. Resets after a successfully completed snapshot.
  • last_snapshot_end: End time of the last successful snapshot.
  • last_snapshot_error: Text of the most recent error during snapshot.
  • last_snapshot_start: Start time of the last completed snapshot.
  • last_snapshot_url: Location of the last successful snapshot.
  • next_snapshot_start: Next scheduled start time.
  • snapshot_start: Start time of the current backup job.
  • snapshot_url: Location of the currently written snapshot.