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

Ability to identify conflicts in backed-up resources #8583

Open
GowthamShanmugam opened this issue Jan 6, 2025 · 4 comments
Open

Ability to identify conflicts in backed-up resources #8583

GowthamShanmugam opened this issue Jan 6, 2025 · 4 comments
Labels
env/openshift Needs Product Blocked needing input or feedback from Product

Comments

@GowthamShanmugam
Copy link

GowthamShanmugam commented Jan 6, 2025

Describe the problem/challenge you have

As a disaster recovery team, it is crucial to back up application workload resources using label selectors. Our scenario involves deploying multiple application workloads within the same namespace. The main challenge arises from the risk of resource conflicts due to overlapping labels, where a single resource might be selected by multiple application label selectors for backup.

This behavior needs to be avoided because, during relocation of an application workload, the original resource is removed from the primary cluster. If other application workloads depend on the same resource, their functionality could be disrupted, potentially leading to crashes.

For instance:

ConfigMap: C1(key1: V1), C2(key1: V1, key2: V2)
Creating backup1 with label key1 = V1
Creating backup2 with label key2 = V2
In this case, C2 is selected by both backups, leading to a conflict.
We must implement a mechanism to detect such conflicts and alert users accordingly.

Note:
We are using --include-resources, exclude is too much when there are more workloads under the same namespace.

Describe the solution you'd like

  1. Is it possible to provide any Velero API to provide information about the conflicts?
  2. (Or) A new API that accepts the backup name as input and returns a list of resource types and resource names in the response would be highly beneficial.
  3. (Or) Is possible to access the Velero backup using any API? so we can access the collected resources and check for the conflicts from our plugin?

Or any other suggested way?

Anything else you would like to add:

Environment:

oadp-velero-rhel 1.4.1

@blackpiglet
Copy link
Contributor

Could you give more information about why resources selected by multiple label selectors are an issue?
If a k8s resource is selected by multiple labels, IMO, it's included in multiple backups in your scenario, and it can be restored by all of the backups.
It's not an obvious conflict scenario in data restores per my understanding.

@kaovilai
Copy link
Member

kaovilai commented Jan 7, 2025

It was said that the conflicting resources have large volumes which is not ideal. I think the user wants ability to define two different backups where

  • backupA covers labelA
  • backupB covers labelB and excluding any labelB items that also has labelA.

@kaovilai
Copy link
Member

kaovilai commented Jan 7, 2025

I had suggested that a velero plugin could be used perhaps where it would

  • detect during Execute if an item was already in backupA
  • call WithoutBackup() to skip including this item from backupB.
    • note that WithoutBackup function isn't yet in a BackupItemAction plugin, but should be similar to existing WithoutRestore for RestoreItemAction.

@blackpiglet blackpiglet added the Needs Product Blocked needing input or feedback from Product label Jan 7, 2025
@sseago
Copy link
Collaborator

sseago commented Jan 7, 2025

@kaovilai "detect during Execute if an item was already in backupA"
That would be pretty complicated. The plugin would need to download the resource list from backupA and parse it -- it would also mean that reordering backupA and backupB would change what was in each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/openshift Needs Product Blocked needing input or feedback from Product
Projects
None yet
Development

No branches or pull requests

4 participants