Skip to content

ResourceQuotas should be restored before Pods (and related objects) #8100

Open
@jacksgt

Description

@jacksgt

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.

High priorities:

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 and Deployments 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions