Skip to content

eeveebot/backupJob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backupJob

Alpine-based container image with s3cmd for backing up and restoring eevee botModule PVCs to S3-compatible object storage.

What It Does

  • Backup — tars the PVC contents and uploads to S3 with a UUID-based key
  • Restore — downloads a backup from S3 and extracts it into the PVC

Designed to run as a K8s Job container, driven by the eevee operator.

Usage

The operator sets the container command to select which script runs:

# Backup (CronJob)
command: ["/usr/local/bin/backup.sh"]

# Restore (one-shot Job)
command: ["/usr/local/bin/restore.sh"]

Environment Variables

Variable Required Description
S3_ENDPOINT yes S3-compatible endpoint URL
S3_BUCKET yes Bucket name
S3_PREFIX no Key prefix within the bucket
S3_ACCESS_ID yes Access key ID (from Secret)
S3_SECRET_KEY yes Secret access key (from Secret)
S3_PATH_STYLE no Set true for path-style addressing (MinIO, etc.)
S3_SIGNATURE_V2 no Set true to use S3 v2 signatures (Ceph RADOSGW, etc.)
BACKUP_NAMESPACE yes (backup) Bot instance namespace
BACKUP_MODULE yes (backup) Module name
BACKUP_PVC_PATH no PVC mount path (default: /data)
RESTORE_CLEAN no Set true to delete all existing data in the PVC before extracting the backup (default: false)
RESTORE_NAMESPACE yes (restore) Bot instance namespace
RESTORE_MODULE yes (restore) Module name
RESTORE_BACKUP_ID yes (restore) UUID of the backup to restore

S3 Key Format

<prefix>/<namespace>/<moduleName>/<uuid>.tar.gz

Security

  • S3 credentials are written to a temporary .s3cfg file with chmod 600 to prevent other processes from reading them
  • The .s3cfg file is deleted after the backup/restore operation completes
  • Both backup.sh and restore.sh verify the s3cmd upload/download succeeded before continuing (exit with error on failure)

License

CC BY-NC-SA 4.0

About

Container image + scripts to help backup eevee botModule PVCs to s3

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors