Open
Description
Hello,
thank you for maintaining this excellent tool.
I would like to propose adding ResourceQuotas to the list of high-priority resources during a restore operation.
velero/pkg/cmd/server/server.go
Line 583 in cc32375
The reason is that otherwise we can end up in a situation where the ResourceQuota is violated. Consider the following scenario for example:
- a namespace has a resource quota of pods=10
- the namespace has a deployment which sets replicas=15
- only 10 pods will exist in the namespace (limited by the ResourceQuota)
- take a backup of the namespace with velero
- delete the namespace
- restore the namespace with velero
- we end up in a situation with more than 10 pods because
Pods
,ReplicaSets
andDeployments
are restored BEFORE the resource quota
(I have verified this behavior with velero v1.13.1 & Kubernetes 1.28.2)
I know that I can control this behavior with:
--restore-resource-priorities=namespaces,resourcequotas,persistentvolumeclaims,secrets,configmaps,serviceaccounts,limitranges
https://velero.io/docs/v1.13/restore-reference/#restore-order
However given that ResourceQuotas are a core Kubernetes resource, I think it makes sense that all velero users benefit from this enhancement.
I'm happy to submit a PR for it.