Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid overwriting during backup to support object lock enabled buckets #8686

Open
kaovilai opened this issue Feb 14, 2025 · 0 comments
Open
Labels
Enhancement/User End-User Enhancement to Velero Needs triage We need discussion to understand problem and decide the priority

Comments

@kaovilai
Copy link
Member

kaovilai commented Feb 14, 2025

Describe the problem/challenge you have

Object Lock uses a write-once-read-many (WORM) model to store objects.

Synonyms: object retention, object lock, data immutibility

This model breaks velero backup after the introduction of async operations as documented in https://velero.io/docs/v1.12/backup-reference/#limitation under

Cannot support backup data immutability

Starting from 1.11, Velero’s backups may not work as expected when the target object storage has some kind of an “immutability” option configured. These options are known by different names (see links below for some examples). The main reason is that Velero first saves the state of a backup as Finalizing and then checks whether there are any async operations in progress. If there are, it needs to wait for all of them to be finished before moving the backup state to Complete. If there are no async operations, the state is moved to Complete right away. In either case, Velero needs to modify the metadata in object storage and that will not be possible if some kind of immutability is configured on the object storage.

Even with versions prior to 1.11, there was no explicit support in Velero to work with object storage that has “immutability” configuration. As a result, you may see some problems even though backups seem to work (e.g. versions objects not being deleted when backup is deleted).

Note that backups may still work in some cases depending on specific providers and configurations.

For AWS S3 service, backups work because S3’s object lock only applies to versioned buckets, and the object data can still be updated as the new version. But when backups are deleted, old versions of the objects will not be deleted.
Azure Storage Blob supports both versioned-level immutability and container-level immutability. For the versioned-level scenario, data immutability can still work in Velero, but the container-level cannot.
GCP Cloud storage policy only supports bucket-level immutability, so there is no way to make it work in the GCP environment.

Minio is known to break

https://min.io/docs/minio/linux/administration/object-management/object-retention.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html
https://docs.hitachivantara.com/r/en-us/content-platform/9.6.x/mk-99arc024/managing-namespaces/configuring-a-namespace/allowing-object-overwrites

It was previously addressed in #1422 so there is some "regression".

Describe the solution you'd like

The main reason is that Velero first saves the state of a backup as Finalizing and then checks whether there are any async operations in progress.

Why can't we just write once on Completed? Can this be opt-in?

Anything else you would like to add:

Environment:

  • Velero version (use velero version):
  • Kubernetes version (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "The project would be better with this feature added"
  • 👎 for "This feature will not enhance the project in a meaningful way"
@kaovilai kaovilai marked this as a duplicate of #1422 Feb 14, 2025
@kaovilai kaovilai marked this as a duplicate of #6422 Feb 14, 2025
@kaovilai kaovilai added the Enhancement/User End-User Enhancement to Velero label Feb 14, 2025
@reasonerjt reasonerjt added the Needs triage We need discussion to understand problem and decide the priority label Feb 17, 2025
@kaovilai kaovilai changed the title Support object lock enabled buckets Avoid overwriting during backup to support object lock enabled buckets Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement/User End-User Enhancement to Velero Needs triage We need discussion to understand problem and decide the priority
Projects
None yet
Development

No branches or pull requests

2 participants