vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.4k stars 1.37k forks source link

IncludedNamespaces in restore skips restore of cluster scoped resources included by backup IncludedNamespaces #7808

Open kaovilai opened 1 month ago

kaovilai commented 1 month ago

And yes ! My issue is resolved. User error.

Because I created the Backup CR using

includedNamespaces:
  - myns

I automatically used that in the Restore CR too.. which caused the clusterscoped resources not to be restored. Removing the 'includedNamespaces' directive from the Restore CR caused everything to restore fine !

Thanks Kaovilai and Blackpiglet for your help !

Originally posted by @PieterVoet in https://github.com/vmware-tanzu/velero/discussions/7797#discussioncomment-9456798

ywk253100 commented 1 month ago

@kaovilai Seems the issue has already been resolved?

kaovilai commented 1 month ago

User resolved their immediate issue but @sseago and I think there may be some usability enhancements to make include/exclude behave the same on restore as backup.

ywk253100 commented 1 month ago

@kaovilai Could you change the description of this issue to clarify why the include/exclude behaviour is inconsistent for backup and restore and which part needs to improve?

sseago commented 1 month ago

@ywk253100 based on the linked issue above, I think what's going on is this: For namespaced backups, related cluster-scoped resources are pulled in -- in the above case, clusterroles and clusterrolebindings For namespaced restores, though, those related cluster-scoped resources are excluded.

Consider these 2 cases. First case:

Second case:

It may be that all we need here is corresponding RIAs that pull in related cluster-scoped resources as we do in BIAs.