Skip to content

VPA does not perform in-place pod updates despite InPlaceOrRecreate policy #8609

Description

@robertbotez

What happened?

I deployed Vertical Pod Autoscaler with updateMode: InPlaceOrRecreate, but the pods are never updated in place. Instead, the VPA updater logs show:

I1004 13:14:39.847429 1 pods_inplace_restriction.go:97] "Can't in-place update pod, but not falling back to eviction. Waiting for next loop" pod="default/app-569758fbc5-jzzjc"

  • In-place scaling does work manually (kubectl patch with CPU change updates the pod without restart).
  • VPA recommends higher CPU values, but it never applies them in-place.
  • No eviction happens either — the pod just stays unchanged.

What did you expect to happen?

With updateMode: InPlaceOrRecreate and resizePolicy.restartPolicy: NotRequired, I expect VPA to patch the running Pod’s CPU requests in-place when the recommendation is above the current request.

How to reproduce it

  1. Enable feature gates on API server + kubelet:
    --feature-gates=InPlacePodVerticalScaling=true
  2. Run VPA with feature gate:
    FEATURE_GATES="InPlaceOrRecreate=true" ./hack/vpa-up.sh
  3. Create deployment:
apiVersion: apps/v1  
kind: Deployment  
metadata:  
  name: app  
spec:  
  replicas: 1  
  selector:  
    matchLabels:  
      app: app  
  template:  
    metadata:  
      labels:  
        app: app  
    spec:  
      containers:  
      - name: nginx  
        image: nginx  
        resources:  
          limits:  
            cpu: 200m 
          requests:  
            cpu: 100m
        resizePolicy:  
        - resourceName: cpu  
          restartPolicy: NotRequired
  1. Create VPA:
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: nginx-vpa
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind:       Deployment
    name:       app
  updatePolicy:
    updateMode: "InPlaceOrRecreate"
  resourcePolicy:
    containerPolicies:
      - containerName: "nginx"
        minAllowed:
          cpu: "200m"
        maxAllowed:
          cpu: "700m"
        controlledResources: ["cpu"]
  1. Apply CPU load in pod (e.g. with stress-ng) until recommendation > current requests.
  2. Check VPA updater logs → see error above.

Environment

  • Kubernetes version: 1.33.5
  • VPA version: 1.5.0
  • Feature gates: InPlacePodVerticalScaling=true (API server, scheduler, controller-manager, kubelet)
  • Pod resizePolicy: restartPolicy: NotRequired
  • Verified that manual kubectl patch can update pod CPU in-place

Additional info

  • VPA gives recommendations (visible in status), so recommender is working.
  • Updater log confirms it attempted in-place update but refused with:
    Can't in-place update pod, but not falling back to eviction. Waiting for next loop
  • No events are created on the pod.
  • It seems the restriction logic in pods_inplace_restriction.go prevents updates even when they are possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/vertical-pod-autoscalerIssues or PRs related to the Vertical Pod Autoscaler componentkind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions