Restic Configuration Reference

For users, k8up restic can only be configured through the respective Custom Resources Schedule, Backup, Check, Prune, Archive and Restore and through the global properties of the k8up operator.

The k8up restic module used to be a component called wrestic. Their repositories were merged in 2021.

Arguments and Environment Variables

The required arguments depend on the actions that should be performed.

  • The environment variable RESTIC_PASSWORD must always be defined. It is not used by k8up restic directly, but it is used when the actual restic binary is invoked.

  • The argument --resticRepository must always be defined.

  • If --prune is set, then all the --keepWithin* arguments need to be valid and positive durations, see the respective Go documentation.

  • If --prune is set, then all the other --keep* arguments (except --keepTags) need to be positive numbers (integers).

  • If --restore is set, then --restoreType must be defined as well.

  • If --restore is set and --restoreType is set to s3, then all the --restoreS3* arguments have to be defined as well.

See k8up restic --help for all the options:

NAME:
   k8up restic

USAGE:
   k8up restic [command options] [arguments...]

DESCRIPTION:
   Start k8up in restic mode

OPTIONS:
   --check                                    Set, if the container should do a check (default: false)
   --prune                                    Set, if the container should do a prune (default: false)
   --restore                                  Set, if the container should attempt a restore (default: false)
   --archive                                  Set, if the container should do an archive (default: false)
   --tag value [ --tag value ]                List of tags to consider for given operation
   --backupCommandAnnotation value            Defines the command to invoke when doing a backup via STDOUT. [$BACKUPCOMMAND_ANNOTATION]
   --fileExtensionAnnotation value            Defines the file extension to use for STDOUT backups. [$FILEEXTENSION_ANNOTATION]
   --backucontainerannotation value           set the annotation name that specify the backup container inside the Pod (default: "k8up.io/backupcommand-container") [$BACKUP_CONTAINERANNOTATION]
   --skipPreBackup                            If the job should skip the backup command and only backup volumes. (default: false) [$SKIP_PREBACKUP]
   --promURL value                            Sets the URL of a prometheus push gateway to report metrics. [$PROM_URL]
   --webhookURL value, --statsURL value       Sets the URL of a server which will retrieve a webhook after the action completes. [$STATS_URL]
   --backupDir value                          Set from which directory the backup should be performed. (default: "/data") [$BACKUP_DIR]
   --restoreDir value                         Set to which directory the restore should be performed. (default: "/data") [$RESTORE_DIR]
   --restoreFilter value                      Simple filter to define what should get restored. For example the PVC name
   --restoreSnap value                        Snapshot ID, if empty takes the latest snapshot
   --restoreType value                        Type of this restore, 'folder' or 's3'
   --restoreS3AccessKey value                 S3 access key used to connect to the S3 endpoint when restoring [$RESTORE_ACCESSKEYID]
   --restoreS3SecretKey value                 S3 secret key used to connect to the S3 endpoint when restoring [$RESTORE_SECRETACCESSKEY]
   --restoreS3Endpoint value                  S3 endpoint to connect to when restoring, e.g. 'https://minio.svc:9000/backup [$RESTORE_S3ENDPOINT]
   --verifyRestore                            If the restore should get verified, only for PVCs restore (default: false)
   --trimRestorePath                          If set, strips the value of --restoreDir from the lefts side of the remote restore path value (default: enabled) [$TRIM_RESTOREPATH]
   --resticBin value                          The path to the restic binary. (default: "/usr/local/bin/restic") [$RESTIC_BINARY]
   --resticRepository value                   The restic repository to perform the action with [$RESTIC_REPOSITORY]
   --resticOptions value                      Additional options to pass to restic in the format 'key=value,key2=value2' [$RESTIC_OPTIONS]
   --keepLatest value                         While pruning, keep at the latest snapshot (default: 0) [$KEEP_LAST, $KEEP_LATEST]
   --keepHourly value                         While pruning, keep hourly snapshots (default: 0) [$KEEP_HOURLY]
   --keepDaily value                          While pruning, keep daily snapshots (default: 0) [$KEEP_DAILY]
   --keepWeekly value                         While pruning, keep weekly snapshots (default: 0) [$KEEP_WEEKLY]
   --keepMonthly value                        While pruning, keep monthly snapshots (default: 0) [$KEEP_MONTHLY]
   --keepYearly value                         While pruning, keep yearly snapshots (default: 0) [$KEEP_YEARLY]
   --keepTags                                 While pruning, keep tagged snapshots (default: false) [$KEEP_TAG, $KEEP_TAGS]
   --keepWithinHourly value                   While pruning, keep hourly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_HOURLY]
   --keepWithinDaily value                    While pruning, keep daily snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_DAILY]
   --keepWithinWeekly value                   While pruning, keep weekly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_WEEKLY]
   --keepWithinMonthly value                  While pruning, keep monthly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_MONTHLY]
   --keepWithinYearly value                   While pruning, keep yearly snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN_YEARLY]
   --keepWithin value                         While pruning, keep tagged snapshots within the given duration, e.g. '2y5m7d3h' [$KEEP_WITHIN]
   --targetPods value [ --targetPods value ]  Filter list of pods by TARGET_PODS names [$TARGET_PODS]
   --sleepDuration value                      Sleep for specified amount until init starts (default: 0s) [$SLEEP_DURATION]
   --help, -h                                 show help (default: false)