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

Adjust Velero to custom needs #2

Merged
merged 14 commits into from
Apr 28, 2021
Merged

Adjust Velero to custom needs #2

merged 14 commits into from
Apr 28, 2021

Conversation

johannesfrey
Copy link

@johannesfrey johannesfrey commented Apr 14, 2021

Please add a summary of your change

This PR disables certain features and plugins (restic, hooks) as well as enables the possibilty to backup and restore remote clusters. More precisely, velero server may run on a different cluster than the one where the backups and restores are performed. Furthermore, with this PR, Velero-specific CRs are allowed to reside in a different namespace than the Velero server.
Even though it already works, the adjustments are pretty hacky. Those should be cleaned up in a separate PR.

PR is planned to be merged on monday April 26th 🙂

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

Johannes Frey added 3 commits April 14, 2021 15:04
With this being enabled Velero won't backup CRs with version v1beta1
Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.
@johannesfrey johannesfrey changed the title Adjust Velero to custom needs [WIP] Adjust Velero to custom needs Apr 14, 2021
pkg/backup/backup.go Show resolved Hide resolved
pkg/backup/backup.go Outdated Show resolved Hide resolved
pkg/backup/item_backupper.go Outdated Show resolved Hide resolved
pkg/client/factory.go Outdated Show resolved Hide resolved
pkg/cmd/server/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/cmd/server/server.go Show resolved Hide resolved
pkg/controller/backup_controller.go Outdated Show resolved Hide resolved
pkg/controller/backup_sync_controller.go Show resolved Hide resolved
pkg/controller/restore_controller.go Outdated Show resolved Hide resolved
pkg/restore/restore.go Show resolved Hide resolved
@johannesfrey johannesfrey changed the title [WIP] Adjust Velero to custom needs Adjust Velero to custom needs Apr 20, 2021
@johannesfrey johannesfrey changed the base branch from main to c445 April 20, 2021 11:40
pkg/restore/restore.go Outdated Show resolved Hide resolved
pkg/restore/restore.go Outdated Show resolved Hide resolved
Copy link

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

RegisterBackupItemAction("velero.io/crd-remap-version", newRemapCRDVersionAction(f)).
// We disable the crd-remap-version plugin because otherwise CRDs with version v1beta1 won't get backed
// up properly.
//RegisterBackupItemAction("velero.io/crd-remap-version", newRemapCRDVersionAction(f)).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: This will be reverted with an upcoming commit.

Copy link
Author

@johannesfrey johannesfrey Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: b3f2aa6

pkg/backup/backup.go Show resolved Hide resolved
pkg/cmd/server/server.go Show resolved Hide resolved
pkg/controller/restore_controller_test.go Show resolved Hide resolved
pkg/util/kube/cluster.go Show resolved Hide resolved
Copy link

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

pkg/backup/backup.go Show resolved Hide resolved
pkg/controller/restore_controller.go Show resolved Hide resolved
Copy link

@tobiasgiese tobiasgiese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

A few nits discussed via direct message, f.e. opt-in/out parameter for hooks and s.initRestic().
But these features are out-of-scope, as we want to have less diff to upstream

@johannesfrey johannesfrey merged commit bb7aea8 into c445 Apr 28, 2021
@johannesfrey johannesfrey deleted the caas branch June 24, 2021 09:07
johannesfrey added a commit that referenced this pull request Jun 24, 2021
* Disable CRD remap version plugin

With this being enabled Velero won't backup CRs with version v1beta1

* Disable restic plugin

Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.

* Disable hooks

* Adjust server to cope with CRs residing in other namespaces

* Add util func to obtain clients for a remote clusters

* Dynamically obtain clients in backup and restore

* Reenable crd-remap plugin and use correct client to fetch the CRDs

* Do not hardcode velero namespace

Co-authored-by: Stefan Bueringer <sbueringer@gmail.com>
johannesfrey added a commit that referenced this pull request Aug 3, 2021
* Disable CRD remap version plugin

With this being enabled Velero won't backup CRs with version v1beta1

* Disable restic plugin

Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.

* Disable hooks

* Adjust server to cope with CRs residing in other namespaces

* Add util func to obtain clients for a remote clusters

* Dynamically obtain clients in backup and restore

* Reenable crd-remap plugin and use correct client to fetch the CRDs

* Do not hardcode velero namespace

Co-authored-by: Stefan Bueringer <sbueringer@gmail.com>
tobiasgiese pushed a commit that referenced this pull request Oct 18, 2021
* Disable CRD remap version plugin

With this being enabled Velero won't backup CRs with version v1beta1

* Disable restic plugin

Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.

* Disable hooks

* Adjust server to cope with CRs residing in other namespaces

* Add util func to obtain clients for a remote clusters

* Dynamically obtain clients in backup and restore

* Reenable crd-remap plugin and use correct client to fetch the CRDs

* Do not hardcode velero namespace

Co-authored-by: Stefan Bueringer <sbueringer@gmail.com>
tobiasgiese pushed a commit that referenced this pull request Oct 18, 2021
* Disable CRD remap version plugin

With this being enabled Velero won't backup CRs with version v1beta1

* Disable restic plugin

Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.

* Disable hooks

* Adjust server to cope with CRs residing in other namespaces

* Add util func to obtain clients for a remote clusters

* Dynamically obtain clients in backup and restore

* Reenable crd-remap plugin and use correct client to fetch the CRDs

* Do not hardcode velero namespace

Co-authored-by: Stefan Bueringer <sbueringer@gmail.com>
tobiasgiese pushed a commit that referenced this pull request Oct 18, 2021
* Disable CRD remap version plugin

With this being enabled Velero won't backup CRs with version v1beta1

* Disable restic plugin

Otherwise a Restore will try to restore PodVolumeBackup CRDs, which do
not exist for Pods in customer clusters.

* Disable hooks

* Adjust server to cope with CRs residing in other namespaces

* Add util func to obtain clients for a remote clusters

* Dynamically obtain clients in backup and restore

* Reenable crd-remap plugin and use correct client to fetch the CRDs

* Do not hardcode velero namespace

Co-authored-by: Stefan Bueringer <sbueringer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants