I need to run VPA for CronJob. I refer to this doc. I think i followed it properly but it doesn't work for me.
- using GKE, 1.17
- VPA version is
vpa-release-0.8
- I created CronJob and VPA with this file.
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
metadata:
labels:
app: hello
spec:
containers:
- name: hello
image: busybox
imagePullPolicy: IfNotPresent
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: my-vpa
spec:
targetRef:
apiVersion: "batch/v1beta1"
kind: CronJob
name: hello
updatePolicy:
updateMode: "Auto"
When I type this command:
kubectl describe vpa
I got this result:
Name: my-vpa
Namespace: default
Labels: <none>
Annotations: <none>
API Version: autoscaling.k8s.io/v1
Kind: VerticalPodAutoscaler
Metadata:
Creation Timestamp: 2021-02-08T07:38:23Z
Generation: 2
Resource Version: 3762
Self Link: /apis/autoscaling.k8s.io/v1/namespaces/default/verticalpodautoscalers/my-vpa
UID: 07803254-c549-4568-a062-144c570a8d41
Spec:
Target Ref:
API Version: batch/v1beta1
Kind: CronJob
Name: hello
Update Policy:
Update Mode: Auto
Status:
Conditions:
Last Transition Time: 2021-02-08T07:39:14Z
Status: False
Type: RecommendationProvided
Recommendation:
Events: <none>