diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index f748c39d768b..83c0c8a6efca 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -311,24 +311,19 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ ### VerticalPodAutoscaler -The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically. -The following example snippet can be used to install a [`autoscaling.k8s.io/v1` VPA](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go). +The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically or remediate containers that are being OOMKilled. + +The following example snippet can be used to install VPA that allows scaling down from the default recommendations of the deployment template: ```yaml vpa: enabled: true - apiVersion: v1 containerPolicy: minAllowed: - cpu: 50m - memory: 150Mi - maxAllowed: - cpu: 100m - memory: 300Mi + cpu: 20m + memory: 50Mi ``` -Supported VPA versions are `v1` and `v1beta2`. - ## Values | Key | Type | Default | Description | @@ -423,7 +418,7 @@ Supported VPA versions are `v1` and `v1beta2`. | tolerations | list | `[]` | List of node taints to tolerate (requires Kubernetes >= 1.6). | | topologySpreadConstraints | list | `[]` | You can use topology spread constraints to control how Pods are spread across your cluster among failure-domains such as regions, zones, nodes, and other user-defined topology domains. (requires Kubernetes >= 1.19). | | updateStrategy | object | `{}` | [Deployment update strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) | -| vpa | object | `{"apiVersion":"v1","containerPolicy":{},"enabled":false}` | Configure a VerticalPodAutoscaler for the cluster-autoscaler Deployment. | -| vpa.apiVersion | string | `"v1"` | APIVersion of the VerticalPodAutoscaler. The template only supports v1 and v1beta2. | -| vpa.containerPolicy | object | `{}` | Configure the containerPolicy of the cluster-autoscaler container. Content is rendered as YAML. | +| vpa | object | `{"containerPolicy":{},"enabled":false,"updateMode":"Auto"}` | Configure a VerticalPodAutoscaler for the cluster-autoscaler Deployment. | +| vpa.containerPolicy | object | `{}` | [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. | | vpa.enabled | bool | `false` | If true, creates a VerticalPodAutoscaler. | +| vpa.updateMode | string | `"Auto"` | [UpdateMode](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L124) | diff --git a/charts/cluster-autoscaler/README.md.gotmpl b/charts/cluster-autoscaler/README.md.gotmpl index 4afcc2f4821d..c467f5c09746 100644 --- a/charts/cluster-autoscaler/README.md.gotmpl +++ b/charts/cluster-autoscaler/README.md.gotmpl @@ -312,22 +312,17 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ ### VerticalPodAutoscaler -The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically. -The following example snippet can be used to install a [`autoscaling.k8s.io/v1` VPA](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go). +The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically or remediate containers that are being OOMKilled. + +The following example snippet can be used to install VPA that allows scaling down from the default recommendations of the deployment template: ```yaml vpa: enabled: true - apiVersion: v1 containerPolicy: minAllowed: - cpu: 50m - memory: 150Mi - maxAllowed: - cpu: 100m - memory: 300Mi + cpu: 20m + memory: 50Mi ``` -Supported VPA versions are `v1` and `v1beta2`. - {{ template "chart.valuesSection" . }} diff --git a/charts/cluster-autoscaler/templates/vpa.yaml b/charts/cluster-autoscaler/templates/vpa.yaml index a303f6f49eda..b889beac9c9a 100644 --- a/charts/cluster-autoscaler/templates/vpa.yaml +++ b/charts/cluster-autoscaler/templates/vpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.vpa.enabled -}} -apiVersion: "autoscaling.k8s.io/{{ .Values.vpa.apiVersion }}" +apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: labels: @@ -12,7 +12,7 @@ spec: kind: Deployment name: {{ template "cluster-autoscaler.fullname" . }} updatePolicy: - updateMode: "Auto" + updateMode: {{ .Values.vpa.updateMode | quote }} resourcePolicy: containerPolicies: - containerName: {{ template "cluster-autoscaler.name" . }} diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 406e5b2a7e74..e2f78745bdf6 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -389,17 +389,7 @@ updateStrategy: {} vpa: # vpa.enabled -- If true, creates a VerticalPodAutoscaler. enabled: false - # vpa.apiVersion -- APIVersion of the VerticalPodAutoscaler. The template only supports v1 and v1beta2. - apiVersion: v1 - # vpa.containerPolicy -- Configure the containerPolicy of the cluster-autoscaler container. Content is rendered as YAML. + # vpa.updateMode -- [UpdateMode](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L124) + updateMode: "Auto" + # vpa.containerPolicy -- [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. containerPolicy: {} - # minAllowed: - # cpu: 50m - # memory: 150Mi - # maxAllowed: - # cpu: 100m - # memory: 300Mi - # controlledResources: - # - cpu - # - memory - # controlledValues: RequestsAndLimits