Docs/Container Backup

Container Backup & Recovery

Capture and restore container filesystem state.

This guide covers CLI commands for testing and one-off operations. For automated backups, see Scheduling.


The Problem with Full Backups

A typical container image is hundreds of megabytes: most of it unchanged base layers (OS, runtime, dependencies). Backing up the entire filesystem every time is slow, expensive, and wasteful.

reel solves this by capturing just the filesystem layer: everything that changed since the container started (config files, logs, application data).

What You Can Do

  • Backup - Regular filesystem snapshots in seconds, local or remote
  • Recovery - Restore a known-good state to a new pod
  • Rollback - Revert current deployment pods to previous layer
  • Forensics - Store and preserve evidence of file modifications

Basic Operations

Find Your Workloads

List pods that reel can operate on:

reel get workloads -n <namespace>

Export Layer

Captures the current filesystem state and exports it directly to S3 or a local file. No copy is left on the node.

# S3
reel export layer api-server main -n production --dest s3://bucket/backups/
# Local file
reel export layer api-server main -n production --dest ./backup.tar.zst

See S3 Exports for bucket configuration.

Create a Layer

Captures the current filesystem state and saves it on the node where the pod is running.

reel create layer <pod> -n <namespace>
# Example
reel create layer api-server -n production

You can specify the container name if the pod has multiple containers.

Output:

Layer created: layer-api-server-main-20241220-143022

List Local Layers

reel list layers -n production
reel list layers -A
reel list layers -o json

Recovery

Restore to New Pod

Create a standalone pod from a layer. Use this for debugging or forensic analysis without affecting the live deployment.

reel restore layer <layer-id> <new-pod-name> -n <namespace>
# Example
reel restore layer layer-api-server-main-20241220-143022 recovered-api -n forensics

This creates recovered-api with the filesystem state from the layer.

Rollback Deployment

Revert a live deployment to a previous layer. Use this to recover from bad updates or configuration changes.

reel rollback layer <layer-id> deployment/<name> -n <namespace>
# Example
reel rollback layer layer-api-server-main-20241220-143022 deployment/api-server -n production
Creates new image from saved layer
Updates deployment to use new image
Rollout restores previous state

Automation

Automated Local Backups

Add an annotation for scheduled captures with built-in rotation:

annotations:
reel.io/schedule: |
0 * * * * | create layer
next | delete layer --keep-last 24

See Scheduling for full configuration.

Retention Management

Local layers are stored on each node and consume disk space. Use retention policies to automatically clean up old layers and keep storage under control.

# Keep last 10 layers
reel delete layer -n production api-server --keep-last 10
# Delete layers older than 7 days
reel delete layer -n production api-server --older-than 7d

You can combine retention with scheduled backups using the next keyword, as shown in the automated backups example above.