Skip to content

RunBackup

A RunBackup object can be created to manually trigger a namespace backup via kubectl. Each RunBackup corresponds to a single backup task.

Please note that periodic backups launched by the service according to a backup policy schedule don't create the corresponding RunBackup objects, instead, a RunBackup object is created only via kubectl and should have a unique name.

An example RunBackup YAML is shown below:

apiVersion: k8sbackup.afi.ai/v1alpha1
kind: RunBackup
metadata:
  namespace: postgresql
  generateName: postgresql-
spec:
  protectionRef: gold
  • namespace field in metadata section points to a namespace that should be backed up.
  • generateName field is used to generate a unique name for a new RunBackup object.
  • protectionRef field in spec section represents a backup policy for which a backup will be launched (please note that a namespace being backed up should already be protected by this policy).

You can trigger a backup via RunBackup object creation as follows:

kubectl create -f afi-runbackup.yaml

You can use the following commands to list RunBackup objects for a specific namespace (postgresql in the example):

kubectl get runbackup -n postgresql