Clarify "update" policy in restore. (#6399)

Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
pull/6359/head
Raghuram Devarakonda 2023-06-22 16:33:24 -04:00 committed by GitHub
parent ef443fece0
commit 433daa18bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -255,11 +255,13 @@ For example, A Persistent Volume object has a reference to the Persistent Volume
## Restore existing resource policy
By default, Velero is configured to be non-destructive during a restore. This means that it will never overwrite data that already exists in your cluster. When Velero attempts to create a resource during a restore, the resource being restored is compared to the existing resources on the target cluster by the Kubernetes API Server. If the resource already exists in the target cluster, Velero skips restoring the current resource and moves onto the next resource to restore, without making any changes to the target cluster.
By default, Velero is configured to be non-destructive during a restore. This means that it will never overwrite data that already exists in your cluster. When Velero attempts to create a resource during a restore, the resource being restored is compared to the existing resources on the target cluster. If the resource already exists in the target cluster, Velero skips restoring the current resource and moves onto the next resource to restore, without making any changes to the target cluster.
An exception to the default restore policy is ServiceAccounts. When restoring a ServiceAccount that already exists on the target cluster, Velero will attempt to merge the fields of the ServiceAccount from the backup into the existing ServiceAccount. Secrets and ImagePullSecrets are appended from the backed-up ServiceAccount. Velero adds any non-existing labels and annotations from the backed-up ServiceAccount to the existing resource, leaving the existing labels and annotations in place.
You can change this policy for a restore by using the `--existing-resource-policy` restore flag. The available options are `none` (default) and `update`. If you choose to `update` existing resources during a restore (`--existing-resource-policy=update`), Velero will attempt to update an existing resource to match the resource being restored:
You can change this policy for a restore by using the `--existing-resource-policy` restore flag. The available options
are `none` (default) and `update`. If you choose to update existing resources during a restore
(`--existing-resource-policy=update`), Velero will attempt to update an existing resource to match the resource from the backup:
* If the existing resource in the target cluster is the same as the resource Velero is attempting to restore, Velero will add a `velero.io/backup-name` label with the backup name and a `velero.io/restore-name` label with the restore name to the existing resource. If patching the labels fails, Velero adds a restore error and continues restoring the next resource.
@ -267,6 +269,8 @@ You can change this policy for a restore by using the `--existing-resource-polic
You can also configure the existing resource policy in a [Restore](api-types/restore.md) object.
**NOTE:** Update of a resource only applies to the Kubernetes resource data such as its spec. It may not work as expected for certain resource types such as PVCs and Pods. In case of PVCs for example, data in the PV is not restored or overwritten in any way.
## Removing a Restore object
There are two ways to delete a Restore object:

View File

@ -267,6 +267,8 @@ You can change this policy for a restore by using the `--existing-resource-polic
You can also configure the existing resource policy in a [Restore](api-types/restore.md) object.
**NOTE:** Update of a resource only applies to the Kubernetes resource data such as its spec. It may not work as expected for certain resource types such as PVCs and Pods. In case of PVCs for example, data in the PV is not restored or overwritten in any way.
## Removing a Restore object
There are two ways to delete a Restore object: