Skip to content

VolumeBackup

volumebackups.backups.k8s.bnerd.com/v1

Scheduled PVC backup via Restic CronJobs. Creates up to four CronJobs per resource: backup, check, restore-test, and unlock.

Short name: vbkp

Spec

spec.volumeClaimRef (required)

Field Type Required Description
name string Yes Name of the PVC to back up
namespace string No PVC namespace (defaults to resource namespace)

spec.schedule

Type Default Description
string "0 3 * * *" Cron schedule for backup (5-field format)

spec.repository (required)

Field Type Required Description
type string Yes s3, gcs, azure, local, sftp, rest
url string Yes Repository URL
secretRef.name string Yes Secret with credentials
secretRef.namespace string No Secret namespace (defaults to resource namespace)

spec.paths

Type Default Description
string[] ["/"] Paths within the volume to back up

spec.exclude

Type Default Description
string[] -- Glob patterns to exclude from backup

spec.host

Type Default Description
string {namespace}-{volumename} Restic host tag for snapshots

spec.retention

Field Type Default Validation Description
keepLast integer 15 min: 1 Keep the N most recent snapshots
keepDaily integer 7 min: 0 Keep one snapshot per day for N days
keepWeekly integer 4 min: 0 Keep one snapshot per week for N weeks
keepMonthly integer 6 min: 0 Keep one snapshot per month for N months

spec.cache

Field Type Default Description
enabled boolean true Enable persistent cache PVC
size string "5Gi" Cache volume size
storageClass string (cluster default) Storage class
accessMode string "ReadWriteOnce" PVC access mode

spec.resources

Field Type Default Description
requests.memory string "256Mi" Memory request
requests.cpu string "200m" CPU request
limits.memory string "1Gi" Memory limit
limits.cpu string "1000m" CPU limit

spec.image

Field Type Default Description
repository string "registry.bnerd.com/public/restic" Image repository
tag string "0.18.1" Image tag
pullPolicy string "Always" Always, IfNotPresent, Never

spec.kubeconfig

Field Type Default Description
inCluster boolean true Use in-cluster credentials
secretRef.name string -- Secret with kubeconfig (required when inCluster=false)
secretRef.namespace string -- Secret namespace
secretRef.key string "kubeconfig" Key in Secret

spec.suspended

Type Default Description
boolean false Suspend all CronJobs

spec.check

Field Type Default Description
enabled boolean false Enable periodic repository integrity checks
schedule string "0 4 * * *" Cron schedule for checks
readDataSubset string "10%" Percentage of data to verify (e.g., "10%", "5GB")
resources.requests.memory string "256Mi" Memory request
resources.requests.cpu string "200m" CPU request
resources.limits.memory string "1Gi" Memory limit
resources.limits.cpu string "1000m" CPU limit

spec.restoreTest

Field Type Default Description
enabled boolean false Enable periodic random restore testing
schedule string "0 5 * * *" Cron schedule
storage.type string "emptyDir" emptyDir or pvc
storage.size string "5Gi" Size limit (emptyDir) or PVC size
storage.storageClass string -- Storage class (only for pvc type)
fileCount integer 50 Random files to restore (1--500)
verifyChecksums boolean true Verify SHA-256 checksums
resources.requests.memory string "512Mi" Memory request
resources.requests.cpu string "500m" CPU request
resources.limits.memory string "6Gi" Memory limit
resources.limits.cpu string "2000m" CPU limit

Deprecated fields

restoreTest.storageClass and restoreTest.pvcSize are deprecated. Use restoreTest.storage.storageClass and restoreTest.storage.size instead.

spec.webhooks

Field Type Description
success string URL to POST on successful backup
failure string URL to POST on backup failure

spec.nodeSelector

Type Description
map[string]string Node labels for pod assignment

spec.tolerations

Array of Kubernetes tolerations. Each entry:

Field Type Description
key string Toleration key
operator string Exists or Equal
value string Toleration value
effect string NoSchedule, PreferNoSchedule, NoExecute
tolerationSeconds integer Seconds for NoExecute

spec.affinity

Standard Kubernetes affinity object (free-form).

spec.jobConfig

Field Type Default Validation Description
keepSuccessfulJobs integer 3 0--10 Successful Jobs to retain
keepFailedJobs integer 3 0--10 Failed Jobs to retain

Status

Field Type Description
phase string Pending, Running, Succeeded, Failed
lastBackup date-time Timestamp of last backup
lastSnapshot string ID of last Restic snapshot
message string Human-readable status message
volumeSize string Size of backed-up volume
conditions[] array Status conditions

Conditions

Field Type Description
type string Condition type (e.g., Ready)
status string True, False, Unknown
lastTransitionTime date-time Last status change
reason string Machine-readable reason (e.g., CronJobCreated, Suspended, Reconciled)
message string Human-readable message

Printer Columns

kubectl get volumebackup displays:

Column Source
Volume spec.volumeClaimRef.name
Repository spec.repository.url
Schedule spec.schedule
Last Backup status.lastBackup
Phase status.phase
Age metadata.creationTimestamp