Kubernetes Pod Annotations

This feature allows you to define what volumes (PVC Data) to back up, where and what commands to execute, and how to react to some failures to achieve the best results from data volume backup functionality. You can select which volumes mounted at the Pod you want to backup, the preferred backup mode for the Pod, and what commands you want to execute.

The Pod Annotation feature allows administrators of a Kubernetes Cluster, or any Kubernetes cluster user with enough permissions, to configure a persistent volume to be included in the backup.

The supported annotations are:

bacula/backup.mode:[snapshot|clone|standard]

defines how to handle PVC Data backups. If not defined, the default is snapshot.

Note

This type of backup follows the flow described here.

bacula/backup.volumes:<pvcname[,pvcname2…]>

defines what volumes will be backed up from this Pod. Multiple PVC names may be selected as a comma separated list. This annotation is required if you want to backup volumes on this Pod. Any other annotations are optional.

bacula/run.before.job.container.command:<container>/<command>

defines what command to execute on which container of the Pod before the volume cloning (or snapshot) and data backup of this Pod occurs. An asterisk (*) as <container> name means to execute <command> on all containers.

bacula/run.before.job.failjobonerror:[yes|no]

defines whether or not to fail the job when the exit code of the executed command is not zero. The default is yes.

bacula/run.after.job.container.command:<container>/<command>

defines what command to execute on which container of the Pod after volume cloning(or snapshot) and data backup of this Pod. An asterisk (*) as <container> name means to execute <command> on all containers.

bacula/run.after.job.failjobonerror:[yes|no]

defines whether or not to fail the job when exit code of the executed command is not zero. The default is no.

bacula/run.after.snapshot.container.command:<container>/<command>

defines what command to execute on which container of the Pod after volume cloning (or snapshot) and just before any data backup. An asterisk (*) as <container> name means to execute <command> on all containers. Note that the snapshot mode will not perform a volume snapshot but rather a volume clone.

bacula/run.after.snapshot.failjobonerror:[yes|no]

defines to fail the job when exit code of the executed command is not zero. The default is no.

Pod annotations is an extension to the current PVC Data backup feature available with the pvcdata=… plugin parameter as described in Estimate and Backup Plugin Parameters. This is an independent function which may be used together with the functionality described above, especially since both use the same data archive stream handling with Bacula Backup Pod.

All you need to use a new feature is to configure selected Pod annotations and make sure that the backup for a required Kubernetes namespace is properly configured. There is no need for any plugin configuration modifications.

Note

Even if the PVC is not listed in the parameter pvcdata, the backup will always be performed if the pod has pod annotations for PVC backup.

Read more:

See also

Go back to:

Go back to the Persistent Volume Claim Backup page.

Go back to the Kubernetes Backup page.

Go back to the Kubernetes Operations page.

Go back to the main Kubernetes Plugin page.