openshift / openshift-velero-plugin

General Velero plugin for backup and restore of openshift workloads.
Apache License 2.0
48 stars 38 forks source link

Openshift plugin being executed on each item in namespace caused timeout #115

Closed phuongatemc closed 2 years ago

phuongatemc commented 2 years ago

When there are many thousands of custom resources in the target namespace, OpenShift-velero plugin would be executed on each item. This causes the total time of Velero backup increase significantly which is more than 10 minutes for around 5000-1000 custom resources in the namespace. Compare to back up similar namespace in normal Kubernetes cluster (without OpenShift Velero plugin) which only takes a few seconds.

OpenShift Velero plugin is necessary for many resources such as Pod etc. but it should not have no effect on custom resources and therefore must not be executed for them.

openshift-bot commented 2 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 2 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

phuongatemc commented 2 years ago

We still need this.

kaovilai commented 2 years ago

Hey @phuongatemc can you check if https://github.com/openshift/openshift-velero-plugin/pull/133 resolves this issue?

phuongatemc commented 2 years ago

@kaovilai Could you elaborate more on how to use #133 ? Is there any setting I need to do or it should work with latest OADP as default behavior?

sseago commented 2 years ago

@phuongatemc There's no configuration needed. This essentially refactors the plugin code to 1) do some things less often (actions needed only for imagestreams aren't done in the common plugin anymore) 2) cache some data in the plugin golang struct so that it only has to be looked up once rather than for every resource.

kaovilai commented 2 years ago

This behavior will be enabled in release 1.0.3 but there's a slight regression for multiple BSL. https://github.com/openshift/openshift-velero-plugin/pull/144 should be included in 1.0.4.

You can try latest by plugin change by specifying image override like so.

apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: dpa-sample
spec:
  unsupportedOverrides:
    openshiftPluginImageFqin: quay.io/konveyor/openshift-velero-plugin:latest

Verify your override has applied by checking for quay.io/konveyor/openshift-velero-plugin:latest when running this command.

oc get deployment velero -n openshift-adp -ojsonpath="{.spec.template.spec.initContainers[?(@.name=='openshift-velero-plugin')].image}"
openshift-bot commented 2 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci[bot] commented 2 years ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/openshift/openshift-velero-plugin/issues/115#issuecomment-1163805552): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.