no matches for kind "VerticalPodAutoscaler" in version "autoscaling.k8s.io/v1beta2"

10/26/2019

I want to deploy a VerticalPodAutoscaler but i get this error:

error: unable to recognize "scaleCPUVertical.yaml": no matches for kind "VerticalPodAutoscaler" in version "autoscaling.k8s.io/v1beta2"

apiVersion: autoscaling.k8s.io/v1beta2
kind: VerticalPodAutoscaler
metadata:
  name: test1
  namespace: default
spec:
  targetRef:
    apiVersion: "extensions/v1beta1"
    kind:       Deployment
    name:       test1
  updatePolicy:
    updateMode: "Off"
-- Java
kubernetes

1 Answer

10/28/2019

If you are using GCP as your cloud platform you can follow the guide Configuring vertical pod autoscaling, which describes how to create a Kubernetes cluster with Vertical Pod Autoscaling enabled.

You should set the desired zone and region, once this is done you can use following command:

gcloud beta container clusters create [CLUSTER_NAME] --enable-vertical-pod-autoscaling

This will create a new Kubernetes cluster with Vertical Pod Autoscaling enabled and ready to use.

You can also enable it on already running cluster by using the following command:

gcloud beta container clusters update [CLUSTER-NAME] --enable-vertical-pod-autoscaling

If you are using AWS as your cloud provide or Kubernetes on-premise you can follow Deploy the Vertical Pod Autoscaler. Which describes how to clone the Vertical Pod Autoscaler repository and how to deploy it.

-- Crou
Source: StackOverflow