Closed Rajpratik71 closed 2 months ago
/area vertical-pod-autoscaler
As discussed on the sig-autoscaling call, can you provide the spec of the vpa-common-web-ui
VPA?
As discussed on the sig-autoscaling call, can you provide the spec of the
vpa-common-web-ui
VPA?
Describe of VPA Object :
pratikraj@Pratiks-MacBook-Pro vertical-pod-autoscaler % oc describe vpa -n gi-perf vpa-common-web-ui
Name: vpa-common-web-ui
Namespace: gi-perf
Labels: <none>
Annotations: <none>
API Version: autoscaling.k8s.io/v1
Kind: VerticalPodAutoscaler
Metadata:
Creation Timestamp: 2024-09-02T14:48:01Z
Generation: 1
Resource Version: 45668866
UID: 1b1e8184-df12-445b-8fe8-255717e7b724
Spec:
Target Ref:
API Version: apps/v1
Kind: Deployment
Name: common-web-ui
Update Policy:
Update Mode: Auto
Events: <none>
VPA Object :
pratikraj@Pratiks-MacBook-Pro vertical-pod-autoscaler % oc get vpa -n gi-perf vpa-common-web-ui -o yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"autoscaling.k8s.io/v1","kind":"VerticalPodAutoscaler","metadata":{"annotations":{},"name":"vpa-common-web-ui","namespace":"gi-perf"},"spec":{"targetRef":{"apiVersion":"apps/v1","kind":"Deployment","name":"common-web-ui"},"updatePolicy":{"updateMode":"Auto"}}}
creationTimestamp: "2024-09-02T14:48:01Z"
generation: 1
name: vpa-common-web-ui
namespace: gi-perf
resourceVersion: "45668866"
uid: 1b1e8184-df12-445b-8fe8-255717e7b724
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: common-web-ui
updatePolicy:
updateMode: Auto
Can you try setting spec.recommenders
to the following:
spec:
recommenders:
- name: performance
The performance VPA has a name set, so it isn't the default: https://github.com/kubernetes/autoscaler/blob/d3cbc10c6b021afcefee36b1a98a75a913852065/vertical-pod-autoscaler/deploy/recommender-deployment-high.yaml#L32
Can you try setting
spec.recommenders
to the following:spec: recommenders: - name: performance
The performance VPA has a name set, so it isn't the default:
Ok got it. Looks like after adding the spec, it is working and recommendation is being provided.
pratikraj@Pratiks-MacBook-Pro vertical-pod-autoscaler % oc get vpa -n gi-perf vpa-common-web-ui -o yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"autoscaling.k8s.io/v1","kind":"VerticalPodAutoscaler","metadata":{"annotations":{},"name":"vpa-common-web-ui","namespace":"gi-perf"},"spec":{"recommenders":[{"name":"performance"}],"targetRef":{"apiVersion":"apps/v1","kind":"Deployment","name":"common-web-ui"},"updatePolicy":{"updateMode":"Auto"}}}
creationTimestamp: "2024-09-02T14:48:01Z"
generation: 2
name: vpa-common-web-ui
namespace: gi-perf
resourceVersion: "45784458"
uid: 1b1e8184-df12-445b-8fe8-255717e7b724
spec:
recommenders:
- name: performance
targetRef:
apiVersion: apps/v1
kind: Deployment
name: common-web-ui
updatePolicy:
updateMode: Auto
status:
conditions:
- lastTransitionTime: "2024-09-02T15:16:29Z"
status: "True"
type: RecommendationProvided
recommendation:
containerRecommendations:
- containerName: common-web-ui
lowerBound:
cpu: 25m
memory: "280439064"
target:
cpu: 25m
memory: "297164212"
uncappedTarget:
cpu: 25m
memory: "297164212"
upperBound:
cpu: 334m
memory: "9030153299"
pratikraj@Pratiks-MacBook-Pro vertical-pod-autoscaler % oc get vpa -n gi-perf vpa-common-web-ui
NAME MODE CPU MEM PROVIDED AGE
vpa-common-web-ui Auto 25m 297164212 True 45m
But one other issue i see that , even after recommendation is provided, original object spec is not being updated and also it is not matching or near the original resource usages.
pratikraj@Pratiks-MacBook-Pro vertical-pod-autoscaler % oc adm top po -A | grep common-web-ui
gi-perf common-web-ui-d494596c5-5jsj2 0m 139Mi
Resource Spec from Deployment
Containers:
common-web-ui:
Image: xxxxxxxxxxxxxxxxxxxx
Port: <none>
Host Port: <none>
Limits:
cpu: 1
memory: 440Mi
Requests:
cpu: 130m
ephemeral-storage: 256Mi
memory: 256Mi
Also, below log is observed in "vpa-updater" pod log, which is complaining about "Global Replica"
I0902 14:49:40.106221 1 pods_eviction_restriction.go:226] too few replicas for ReplicaSet gi-perf/common-web-ui-d494596c5. Found 1 live pods, needs 2 (global 2)
where we do define this and any flag to ignore this ?
As, i thinking that this can be the reason why "Resource Spec" is not being updated.
where we do define this and any flag to ignore this ?
Yup, it's possible that you're hitting this: https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/FAQ.md#i-get-recommendations-for-my-single-pod-replicaset-but-they-are-not-applied
Do note that by setting this to 1, it's possible that when the recommendation is applied, you may not have any pods serving this workload.
Thanks for reference and support @adrianmoisey . suggested config works.
Which component are you using?:
What version of the component are you using?:
Component version: 1.2.1
What k8s version are you using (
kubectl version
)?:kubectl version
OutputWhat environment is this in?:
Openshift on Baremetal
What did you expect to happen?:
In "vpa-recommender-performance" of deployment, "VPA" Objects should get "CPU", "MEM", "PROVIDED" after reconciliation.
What happened instead?:
"VPA" object doesn't got "CPU", "MEM", "PROVIDED" after reconciliation.
How to reproduce it (as minimally and precisely as possible):
Updated recommender-deployment to recommender-deployment-performance and executed ./hack/vpa-process-yamls.sh create
Install goes fine, and all pods were running fine.
Anything else we need to know?:
Getting below in "vpa-recommender-performance" pod log when deployed in "performance" mode