-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
When checking out the following PR: #8458
and applying this VPA and Deployment manifest:
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: example-vpa
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: nginx-deployment
updatePolicy:
updateMode: "Auto"
startupBoost:
cpu:
factor: 3
duration: 10s
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
resources:
requests:
memory: "100Mi"
cpu: "250m" # 250 millicores, or 0.25 CPU cores
limits:
memory: "200Mi"
cpu: "500m"
The following error occurs:
ubuntu:~/autoscaler(pr-8458)$ k apply -f vpa-startup.yaml
deployment.apps/nginx-deployment unchanged
Error from server: error when creating "vpa-startup.yaml": admission webhook "vpa.k8s.io" denied the request: invalid startupBoost: unexpected StartupBoost.CPU.Type value
This example was taken from the official docs:
https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/enhancements/7862-cpu-startup-boost#startup-cpu-boost-enabled--vpa-enabled
The error originates from this section of code:
https://github.com/kubernetes/autoscaler/blob/experimental-cpu-boost/vertical-pod-autoscaler/pkg/admission-controller/resource/vpa/handler.go#L218
The type field under startupBoost.cpu is required but missing in the example.
The correct manifest should be:
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: example-vpa
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: nginx-deployment
updatePolicy:
updateMode: "Auto"
startupBoost:
cpu:
type: "Factor" # This line was missing
factor: 3
duration: 10s
We need:
1/ Documentation fix - Update the example in the docs to include the type
field (PR should be tomaster
branch).
2/ Error message improvement - Make the webhook error message more descriptive (PR should be toexperimental-cpu-boost
branch).
/good-first-issue
/triage accepted
/cc @kamarabbas99 @adrianmoisey