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, local storage is usually less suitable than external object storage: the active node can change over time, and backups are safer when stored outside the system they protect.

Snapshot names use the format <file_prefix>_<RFC3339_timestamp>.tar.gz. Retention cleanup only considers files or objects with this naming format under the configured path or prefix.

The snapshot manager checks configurations once a minute. After creating or updating a configuration, the next snapshot is scheduled immediately; subsequent snapshots are scheduled from the start time of the previous snapshot plus the configured interval.

Server configuration (S3 upload pool)

Optional top-level keys in the Stronghold server HCL configuration tune background S3 uploads for automated snapshots of Raft storage. These are set in the server configuration file used to start a specific node: stronghold server -config config.hcl.

KeyTypeDefaultDescription
snapshot_auto_s3_upload_workersInteger3Maximum concurrent background S3 uploads. Parallelism applies only across different snapshot configurations. When the limit is reached, new uploads wait in the queue. Allowed range: 132.
snapshot_auto_upload_pool_shutdownDuration string60sTime from the start of the automated snapshot loop shutdown on a specific node (due to process termination or loss of leadership) until background upload processes are forcibly terminated. Allowed range: 1s15m.

Example:

snapshot_auto_s3_upload_workers = 4
snapshot_auto_upload_pool_shutdown = "90s"

Increase the number of background upload processes if you have many S3 snapshot configurations and sufficient network and CPU capacity; decrease it if you hit S3 rate limits or have limited bandwidth.

Create or update a configuration

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

The endpoint requires sudo privileges.

Core parameters

ParameterTypeRequiredDefaultDescription
nameStringYesName of the configuration to create or update
intervalInteger or stringYesTime 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 3m
retainIntegerNo3Number of backups to keep. Retention cleanup runs only after a snapshot has been successfully saved or uploaded. Older backups are deleted when the limit is exceeded. A value of 0 disables deletion of old snapshots
storage_typeImmutable stringYesStorage type: local or aws-s3
path_prefixStringYesFor local, the directory where snapshots are stored. For aws-s3, the object prefix inside the bucket; a leading / is ignored. For local storage, path_prefix cannot be changed after creation.
file_prefixStringNostronghold-snapshotPrefix for the file or object name stored in path_prefix. For local storage, file_prefix cannot be changed after creation.

Additional parameters for local

ParameterTypeRequiredDefaultDescription
local_max_spaceIntegerNo0Maximum 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_bucketStringYesBucket name used for backup storage
aws_s3_regionStringNoBucket region
aws_access_key_idStringNoAccess key ID for the bucket
aws_secret_access_keyStringNoSecret access key for the bucket
aws_s3_endpointStringNoS3 service endpoint
aws_s3_disable_tlsBooleanNofalseDisables TLS for the S3 endpoint. Use only for testing
aws_s3_ca_certificateStringNoCA certificate for the S3 endpoint in PEM format
retry_enabledBooleanNofalseEnables retry attempts if uploading a snapshot to S3 fails
retry_max_attemptsIntegerNo5Maximum number of retry upload attempts after the initial upload failure. Backoff schedule: 1 minute, 5 minutes, 15 minutes, then every 30 minutes. A value of 0 disables the retry limit (unlimited retries)

Retries reuse the temporary copy from the failed upload. They stop when the configured maximum is reached, when retries are disabled, when the temporary file is no longer available, or when the next scheduled snapshot time is reached. A retry attempt must also finish at least one minute before the next scheduled snapshot; otherwise the attempt is considered failed and the next one is scheduled according to the backoff schedule. Retry failures update last_snapshot_error in the status, but do not increment consecutive_errors beyond the original failed scheduled snapshot.

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, and uses the main_stronghold file prefix:

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

Before applying the configuration, make sure the directory from path_prefix exists and is writable. The failed to create snapshot directory at destination error usually means the directory is missing or unavailable.

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

  • Stronghold in DKP
  • 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 DKP 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_access_key_id": "<ACCESS_KEY>",
  "aws_secret_access_key": "<SECRET_ACCESS_KEY>",
  "retry_enabled": true,
  "retry_max_attempts": 5
}

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 DKP
  • 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

To modify only selected fields, provide a partial JSON document:

{
  "interval": "3m",
  "retain": "10"
}

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

  • Stronghold in DKP
  • 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 next snapshot is scheduled immediately.

List configurations

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

Example command:

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

Read configuration parameters

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

Example command:

  • Stronghold in DKP
  • 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 does not expose aws_access_key_id or aws_secret_access_key.

Delete a configuration

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

Example command:

  • Stronghold in DKP
  • 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

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

Example command:

  • Stronghold in DKP
  • 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.
  • last_rotation_error: Text of the last error during retention cleanup, or n/a if cleanup succeeded. A cleanup error does not mark the snapshot itself as failed.
  • next_snapshot_start: Next scheduled start time.
  • snapshot_start: Start time of the current backup job.
  • snapshot_url: Location of the currently written snapshot.

Additional fields for aws-s3

  • retry_in_progress: Flag indicating that a retry of a failed S3 upload is in progress.
  • retry_attempt: Number of the current retry attempt. 0 if retries are not active.