Velero Backup Custom Resource
The Backup custom resource enables the Replicated snapshots backup and restore feature. The backend of this feature uses the Velero open source project to back up Kubernetes manifests and persistent volumes.
Add a Backup custom resource (
apiVersion: velero.io/v1) to your release and configure it as needed. A Backup custom resource is required for each application that you deploy.
You must add annotations for each volume that you want to back up. For more information about configuring backups, see Configuring Backups.
The Backup custom resource also supports optional resource installations so that the feature can be dynamically enabled based on a license field or a config option. For more information, see Include Optional and Conditional Resources.
Full backups are recommended because they give the flexibility of restoring full data, the application only, or the Replicated admin console only. For an example of a full backup and a list of the supported fields, see Example and Fields.
Partial backups (application only) are supported but not recommended. For partial backups, you can use all of the fields that Velero supports. For information about the supported fields for partial backups, see Backups in the Velero documentation.
The following example shows the supported fields for a full backup.
annotations field shows that
pvc-volume is the only volume included in the backup.
The following Velero fields are supported for full backups, as shown in the previous example:
|(Optional) Specifies an array of namespaces to include in the backup. If unspecified, all namespaces are included.|
|(Optional) Specifies an array of namespaces to exclude from the backup.|
|(Optional) Specifies the order of the resources to collect during the backup process. This is a map that uses a key as the plural resource. Each resource name has the format NAMESPACE/OBJECTNAME. The object names are a comma delimited list. For cluster resources, use OBJECTNAME only.|
| Specifies the amount of time before this backup is eligible for garbage collection. Default:|
|(Optional) Specifies the actions to perform at different times during a backup. The only supported hook is executing a command in a container in a pod (uses the pod exec API). Supports |
|(Optional) Specifies an array of hooks that are applied to specific resources.|
|Specifies the name of the hook. This value displays in the backup log.|
|(Optional) Specifies an array of namespaces that this hook applies to. If unspecified, the hook is applied to all namespaces.|
|(Optional) Specifies an array of namespaces to which this hook does not apply.|
|Specifies an array of pod resources to which this hook applies.|
|(Optional) Specifies an array of resources to which this hook does not apply.|
|(Optional) Specifies that this hook only applies to objects that match this label selector.|
|Specifies an array of |
|Specifies an array of |
|Specifies the type of the hook. |
|(Optional) Specifies the name of the container where the specified command will be executed. If unspecified, the first container in the pod is used.|
|Specifies the command to execute. The format is an array.|
|(Optional) Specifies how to handle an error that might occur when executing the command. Valid values: |
|(Optional) Specifies how many seconds to wait for the command to finish executing before the action times out. Default: |
The following top-level Velero fields, or children of
spec, are not supported in full backups. Therefore, these fields are not shown in the preceding example specification. See Example.
Note that some of these fields are supported for hook arrays, as described in the previous field definition table. See Fields.
All resources are included in the backup by default. However, resources can be excluded by adding
velero.io/exclude-from-backup=trueto the manifest files that you want to exclude. For more information, see Configuring Backups.