-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Vertical Pod Auto scaler
Version:1.2.1
K8s Version: 1.31.0
CRIO Version: 1.32.0
RHEL 9 Bare metal cluster. I have enabled feature gate InPlacePodVerticalScaling in API Server as well.
Trying use hamster example and test k8s InPlacePodVerticalScaling feature. Even though the cpu values are within the limits the pod is getting terminated and new pod is getting started. When values are within the threshold limits the pod should have latest vaules without getting restarted. I can below message in the event.
Event:
Normal EvictedByVPA pod/hamster-7d67d5c79f-qvgck Pod was evicted by VPA Updater to apply resource recommendation.
Modified VPA:
---
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: hamster-vpa
spec:
# recommenders field can be unset when using the default recommender.
# When using an alternative recommender, the alternative recommender's name
# can be specified as the following in a list.
# recommenders:
# - name: 'alternative'
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: hamster
resourcePolicy:
containerPolicies:
- containerName: '*'
minAllowed:
cpu: 100m
#memory: 50Mi
maxAllowed:
cpu: 105m
#memory: 500Mi
#controlledResources: ["cpu", "memory"]
controlledResources: ["cpu"]
I have added below also resize policy for restart not required.
containers: - name: hamster image: registry.k8s.io/ubuntu-slim:0.1 resizePolicy: - resourceName: cpu restartPolicy: NotRequired - resourceName: memory restartPolicy: NotRequired
Both in VPA Recommender 15% and VPA Updater 10% documentation its mentioned that if the values are in within threshold then pods will not be restarted. Unfortunately the pods are getting terminated and new pods are getting started.
Kindly help in resolving the issue