I’m trying to test VPA autoscaler with PXC cluster by following the instruction given in the blog “Kubernetes Scaling Capabilities with Percona XtraDB Cluster”.
The test cluster is running on minikube. PXC created successfully , metrics server and and VPA also deployed without issue.
But a problem happened when I tried to create VPA resource to monitor the cluster.
~% kubectl apply -f vpa.yaml
error: error validating "vpa.yaml": error validating data: [ValidationError(VerticalPodAutoscaler): unknown field "\u00a0\u00a0name" in io.k8s.autoscaling.v1.VerticalPodAutoscaler, ValidationError(VerticalPodAutoscaler): unknown field "\u00a0\u00a0\u00a0\u00a0apiVersion" in io.k8s.autoscaling.v1.VerticalPodAutoscaler, ValidationError(VerticalPodAutoscaler): unknown field "\u00a0\u00a0\u00a0\u00a0kind" in io.k8s.autoscaling.v1.VerticalPodAutoscaler, ValidationError(VerticalPodAutoscaler): unknown field "\u00a0\u00a0\u00a0\u00a0name" in io.k8s.autoscaling.v1.VerticalPodAutoscaler, ValidationError(VerticalPodAutoscaler): unknown field "\u00a0\u00a0\u00a0\u00a0updateMode" in io.k8s.autoscaling.v1.VerticalPodAutoscaler, ValidationError(VerticalPodAutoscaler): missing required field "spec" in io.k8s.autoscaling.v1.VerticalPodAutoscaler]; if you choose to ignore these errors, turn validation off with --validate=false
I use vpa.yaml file posted in the blog, only removed the key “namespace” since the cluster is deployed in the default namespace. Below is the content of vpa.yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: pxc-vpa
spec:
targetRef:
apiVersion: “apps/v1”
kind: StatefulSet
name: cluster1-pxc
updatePolicy:
updateMode: “Off”
What did I miss? Any suggestion to fix the problem?