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

While backing up custom resource, auto include the CRD in the backup #2673

Closed
1 task done
ashish-amarnath opened this issue Jun 26, 2020 · 6 comments
Closed
1 task done
Assignees

Comments

@ashish-amarnath
Copy link
Contributor

ashish-amarnath commented Jun 26, 2020

context dump: https://kubernetes.slack.com/archives/C6VCGP4MT/p1593205549061900

What steps did you take and what happened:
While backing up custom resources, the corresponding CRD are not included in the backup without the --include-cluster-resources flag.
Further, even if the backup does included CRDs, they are not restored if the restore did use the --include-cluster-resources
flag.

What did you expect to happen:
Backing up and restore of custom resources should auto include the corresponding CRDs in their respective operations.

TODOs:

  • Verify behavior mentioned above is true. It is expected that a fix for this is already available.

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 "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"

cc @ncdc

@ashish-amarnath ashish-amarnath self-assigned this Jun 26, 2020
@ashish-amarnath
Copy link
Contributor Author

Quick update on this.
So the CRDs are included as part of the backup even without the --include-cluster-resources flag as reported in this issue.
The code that does this is https://github.com/vmware-tanzu/velero/blob/master/pkg/backup/backup.go#L421-L428
Further more the restore flow also attempts to restore the CRDs.

However, the custom resources were not being restored because the restoring of the CRDs would fail because of #2682 which in turn would result in failure of the restoration of the custom resources with a discovery failure error.

I am putting up a fix to #2682 which should also address this issue.

@ashish-amarnath
Copy link
Contributor Author

ashish-amarnath commented Jul 7, 2020

PR #2683 has been merged and that should have solved this issue.
This fix will be included in the patch release 1.4.1.
Closing this issue.

@JohnnyCrazy
Copy link

JohnnyCrazy commented Jul 10, 2020

So just to be sure about if I hit this issue currently:

Is it true that backing up and restoring CRDs with 1.4.0 is not working? I'm currently experimenting backing up/restoring and one of my cluster components is cert-manager, which is using CRDs to save LE certificates. After a backup and restore, I was not able to find any certificates.

@nrb
Copy link
Contributor

nrb commented Jul 16, 2020

@JohnnyCrazy It was an issue in v1.4.0, yes. v1.4.2 should have fixed it.

@rahul-mereddy
Copy link

should I need to include flag --include-cluster-resources during the backup and restore in velero version 1.8.0?

During the recent velero backup and restore on GKE cluster we are seeing CRD's are missing during the restore.

how do I know if the velero backup or restore did the crd's restored?

@sseago
Copy link
Collaborator

sseago commented Apr 7, 2022

@rahul-mereddy You should create a separate issue for this. See my answer on the closed PR I replied to, but really this should be a separate question/issue, since closed issues/PRs will generally not be monitored for new responses. I'm not sure whether you're asking a question about how things should work or providing a bug report saying that they're not working as promised, but repeating my other reply on how things should be working here. If this isn't what you're seeing, feel free to open a new issue/bug report describing the problem:

if include-cluster-resources is true, then all cluster-scoped resources will be backed up, regardless of whether they're relevant to the namespaces being backed up, which means all CRDs should be included. If it's set to false then no cluster-scoped resources will be included, including CRDs. If it's nil (the default value), then only relevant cluster-scoped resources will be included. For CRDs, this means that if a CR for mytype.myorg.org is backed up, then the mytype.myorg.org CRD will be backed up as well, but irrelevanttype.myorg.org will not be backed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants