-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Which component are you using?:
/area vertical-pod-autoscaler
Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:
With VPA updateMode: InPlaceOrRecreate, replica groups that have fewer live pods than minReplicas (e.g. a single pod when --min-replicas=2) never get recommendations applied. The updater skips such groups in GetCreatorMaps (if actual < required { continue }), so they are not in the maps and neither in-place nor eviction is considered. Users with single-replica or small replica sets cannot receive VPA updates without lowering minReplicas or increasing replica count, even though in-place resize does not reduce the number of pods and would be safe.
Describe the solution you'd like.:
- When
livePods < minReplicas, still include the replica group in the updater maps and mark it with a flag (e.g.belowMinReplicasin group stats). - Eviction (recreate): keep it blocked for groups below minReplicas — in the eviction path (e.g.
PodsEvictionRestrictionImpl.CanEvict), return false when the group is below minReplicas and log it. - In-place: allow in-place resize for these groups — the in-place restriction logic does not consider the “below minReplicas” flag, so in-place updates can proceed when the node supports it.
- If in-place is not possible (e.g. resize Infeasible), do not fall back to eviction when below minReplicas; only log and skip.
Result: with InPlaceOrRecreate, single-replica and small replica sets can receive VPA recommendations only via in-place resize; eviction/recreate remains forbidden when below minReplicas.
Describe any alternative solutions you've considered.:
- Removing the
actual < requiredcheck entirely: would allow eviction for groups below minReplicas and reduce availability, so rejected. - Per-VPA minReplicas=1 for singletons: users can set
spec.updatePolicy.minReplicas: 1today, but then eviction would also be allowed for that one pod; the goal is to allow only in-place for below-minReplicas groups, not eviction. - New update mode (e.g. “InPlaceOnly”): would add API surface and overlap with “allow in-place below minReplicas for InPlaceOrRecreate”; the proposed change is a small, backward-compatible fix in updater restriction logic.
Additional context.:
- Affected code:
vertical-pod-autoscaler/pkg/updater/restriction/(factory, eviction restriction, in-place restriction). - In-place resize does not change the number of pods, so allowing it below minReplicas does not reduce availability; only eviction/recreate needs to stay blocked.
- Implementation adds a boolean (e.g.
belowMinReplicas) to group stats, set inGetCreatorMapswhenactual < required, and checked only in the eviction path.