fix(vertical-pod-autoscaler): run two admission controllers spread over nodes

With one admission controller and failurePolicy Ignore, a pod created
while that controller is being rescheduled is admitted without its VPA
recommendation, and with updateMode Initial it keeps the defaults for
the rest of its life. On a v1.6.5 cluster a vmstorage pod created during
a node drain got the operator defaults, a 1500Mi limit against a 3.4Gi
recommendation, and was OOMKilled weeks later.

A second replica on another node and a PodDisruptionBudget keep one
controller serving through a drain. The controller still deletes and
recreates its webhook configuration on start, so a restart leaves only
that short gap instead of the whole reschedule.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
This commit is contained in:
Yan Bondarenko committed 2026-10-25 17:06:52 +03:00
1 parent 55aad6f914
commit 34766ff0b5
2 files changed
+41

No files matched your search

@@ -242,3 +242,32 @@ tests:
count: 0
- it: runs two admission controllers spread over nodes
template: charts/vertical-pod-autoscaler/templates/admission-controller/deployment.yaml
asserts:
- equal:
path: spec.replicas
value: 2
- equal:
path: spec.template.spec.topologySpreadConstraints[0].topologyKey
value: kubernetes.io/hostname
- equal:
path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels
value:
app.kubernetes.io/name: vertical-pod-autoscaler
app.kubernetes.io/instance: vpa
app.kubernetes.io/component: admission-controller
- it: keeps one admission controller up through a voluntary disruption
template: charts/vertical-pod-autoscaler/templates/admission-controller/pdb.yaml
asserts:
- equal:
path: spec.minAvailable
value: 1
- equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/name: vertical-pod-autoscaler
app.kubernetes.io/instance: vpa
app.kubernetes.io/component: admission-controller
@@ -37,6 +37,18 @@ vertical-pod-autoscaler:
prometheus-cadvisor-job-name: cadvisor
admissionController:
replicaCount: 2
pdb:
create: true
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: vertical-pod-autoscaler
app.kubernetes.io/instance: "{{ .Release.Name }}"
app.kubernetes.io/component: admission-controller
resources:
limits:
memory: 256Mi