Skip to main content

Overview

The RedisBackup custom resource defines an on-demand backup of a RedisCluster to object storage. API Group: redis.io/v1
Kind: RedisBackup
Short Name: rb

Spec Fields

clusterName
string
required
Name of the RedisCluster to back up
target
BackupTarget
default:"prefer-replica"
Specifies which pod to run the backup onEnum values:
  • primary - Always run backup on the primary instance
  • prefer-replica - Run on a replica if available, otherwise on the primary
method
BackupMethod
default:"rdb"
Backup method to useEnum values:
  • rdb - Redis Database file (point-in-time snapshot via BGSAVE)
  • aof - Append-only file (via BGREWRITEAOF, archived as .tar.gz)
destination
BackupDestination
Defines where to store the backup

Status Fields

phase
BackupPhase
Current backup phasePossible values:
  • Pending - Backup scheduled but not started
  • Running - Backup in progress
  • Completed - Backup completed successfully
  • Failed - Backup failed (see error field)
targetPod
string
Pod name that is running or ran the backupExample: my-redis-1
startedAt
metav1.Time
When the backup started
completedAt
metav1.Time
When the backup completed (success or failure)
backupSize
int64
Size of the backup in bytes
backupPath
string
Object storage path/key where the backup is writtenExample: s3://my-bucket/backups/my-backup.rdb
artifactType
BackupArtifactType
Format of the backup artifact in object storageEnum values:
  • rdb - Redis Database file (.rdb)
  • aof-archive - AOF directory archived as .aof.tar.gz
error
string
Error message if the backup failed
conditions
[]metav1.Condition
Latest available observations

Backup Workflow

RDB Backups

  1. Operator selects target pod based on spec.target
  2. Operator POSTs to /v1/backup on target pod’s IP
  3. Instance manager issues BGSAVE to Redis
  4. Instance manager polls INFO persistence until rdb_bgsave_in_progress=0
  5. Instance manager reads /data/dump.rdb
  6. Instance manager uploads to S3 with SHA256 checksum
  7. Operator updates status with backupPath, backupSize, checksumSHA256

AOF Backups

  1. Operator selects target pod based on spec.target
  2. Operator POSTs to /v1/backup on target pod’s IP
  3. Instance manager issues BGREWRITEAOF to Redis
  4. Instance manager polls INFO persistence until aof_rewrite_in_progress=0
  5. Instance manager creates .tar.gz archive of /data/appendonlydir/
  6. Instance manager uploads to S3 with SHA256 checksum
  7. Instance manager deletes temporary archive file
  8. Operator updates status with backupPath, backupSize, checksumSHA256

Credentials

Backup credentials are mounted from the Secret referenced in spec.backupCredentialsSecret at /backup-credentials. The instance manager supports multiple key names for AWS credentials:
CredentialSupported Keys
Access Key IDAWS_ACCESS_KEY_ID, aws_access_key_id, accessKeyId, access_key_id
Secret Access KeyAWS_SECRET_ACCESS_KEY, aws_secret_access_key, secretAccessKey, secret_access_key
Session TokenAWS_SESSION_TOKEN, aws_session_token, sessionToken, session_token
Example Secret:
apiVersion: v1
kind: Secret
metadata:
  name: s3-backup-creds
type: Opaque
stringData:
  AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE
  AWS_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Example

apiVersion: redis.io/v1
kind: RedisBackup
metadata:
  name: my-backup
  namespace: default
spec:
  clusterName: my-redis
  target: prefer-replica
  method: rdb
  destination:
    s3:
      bucket: my-backup-bucket
      path: redis-backups
      region: us-west-2
Status after completion:
status:
  phase: Completed
  targetPod: my-redis-1
  startedAt: "2026-02-28T10:00:00Z"
  completedAt: "2026-02-28T10:01:23Z"
  backupSize: 1073741824
  backupPath: s3://my-backup-bucket/redis-backups/my-backup.rdb
  artifactType: rdb

Build docs developers (and LLMs) love