Skip to content

Protection

A Protection object represent a backup SLA assigned to a namespace (in other words, a namespace is protected with a backup SLA).

An example Protection YAML is shown below:

apiVersion: k8sbackup.afi.ai/v1alpha1
kind: Protection
metadata:
  name: gold
  namespace: postgresql
spec:
  policyRef: gold
  • name field in metadata section should be set to a backup policy name (gold in this example).
  • namespace field in metadata section should be set to a namespace that you want to protect.
  • policyRef field in spec section points to a backup policy gold. Please note that the name of a protection must match the name of a backup policy that it selects.

You can protect a namespace with a backup policy as follows:

kubectl create -f afi-protection.yaml

You can remove a protection from a namespace as follows (this command removes a backup policy gold from a namespace postgresql):

kubectl -n postgresql delete protection/gold

You can list protections for a namespace as follows:

kubectl -n postgresql get protection