Asking for help? Comment out what you need so we can get more information to help you!
Cluster information:
Kubernetes version: 1.23.1
Cloud being used: (put bare-metal if not on a public cloud) bare-metal
Host OS: Ubuntu 18.04
Hello folks, I was having a bug in a sample kubernetes application which was using the VPA (vertical autoscaler). It would be great if I could get some help in debugging it (do let me know if this is not the right place to be asking this query).
The sample application is a simple nginx workload with 2 replicas (yaml file at the end). The request limit is set to 100m for CPU .
The CPU usage (monitored using kubectl top pods
) shows 0m utilization at the start (which makes sense as there is no load on the ngnix server).
The VPA recommendation at the start is 25m for the CPU. Now, I start load testing my nginx server by using a benchmarking tool like hey and sending a lot of load on the server for 1 hour. The CPU utilization now goes up to 250m (more than the request limit set at 100m). But even in this case the VPA recommendation does not change and is still at 25m .
The problem is that the VPA recommendation is constant (at 25m) regardless of the load I put on the server . I wanted to know why issue is happening and how to fix it. Is 25m a default value of some kind? (Note: there are no other pods/deployments running on my VM)
Thanks!
Manifest YAML file:
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: nginx-vpa
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: nginx
updatePolicy:
updateMode: "Off"
resourcePolicy:
containerPolicies:
- containerName: '*'
minAllowed:
cpu: 20m
memory: 50Mi
maxAllowed:
cpu: 1
memory: 500Mi
controlledResources: ["cpu", "memory"]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.8
ports:
- containerPort: 80
resources:
requests:
cpu: 100m
memory: 250Mi