In-Place Updates of Pod Resources
This is a short guide covering the enablement of in-place resource updates in the Vertical Pod Autoscaler.
Compatibility
In-place resource updates got introduced as an alpha feature in Kubernetes 1.27. In Kubernetes 1.33, it got promoted to beta and enabled by default. On the Vertical Pod Autoscaler side, with Release 1.4.0, in-place resources updates are available as an alpha feature for vpa-admission-controller and vpa-updater.
Kubernetes
With Kubernetes 1.33, the InPlacePodVerticalScaling feature gate, which enables in-place resource updates, is enabled by default and does not require additional instrumentation. Prior versions, from Kubernetes 1.27 onwards require the InPlacePodVerticalScaling feature gate to be enabled for both kube-apiserver and kubelet.
Vertical Pod Autoscaling
With 1.4.0, the InPlaceOrRecreate feature gate, which enables in-place resource updates for vpa-admission-controller and vpa-updater, got introduced as an alpha feature. To explicitly enable the feature for Shoot, Seed or Garden clusters, the Vertical Pod Autoscaling configurations, for the respective cluster types need to include an additional InPlaceOrRecreate: true entry in the featureGates map. Refer to the usage guide for details about instrumenting a VerticalPodAutoscaler resource with in-place updates.
Configuration
As described in the Compatibility section, alpha versions of the InPlacePodVerticalScaling Kubernetes feature require additional configuration to get the in-place updates enabled. This section covers the components that need to be configured both on Kubernetes and Vertical Pod Autoscaler sides.
Shoot
Since Vertical Pod Autoscaler has its InPlaceOrRecreate feature gate still in alpha, and Kubernetes promoted InPlacePodVerticalScaling to beta in 1.33, it is allowed to configure in-place resource updates only for Shoot(s) with Kubernetes version 1.33+.
Enable the
InPlaceOrRecreatefeature gate forVertical Por Autoscalerin the Shoot spec:yamlspec: kubernetes: verticalPodAutoscaler: featureGates: InPlaceOrRecreate: trueMake sure that the
InPlacePodVerticalScalingKubernetes feature gate is not explicitly disabled in the Shoot spec for:- kube-apiserver:
.spec.kubernetes.kubeAPIServer.featureGates - kubelet:
.spec.kubernetes.kubelet.featureGatesor.spec.provider.workers[].kubernetes.kubelet.featureGates
- kube-apiserver:
Seed
Disclaimer: The following configurations are relevant for Gardener
Operatorsthat have access toSeedcluster(s).
For Seed clusters, Vertical Pod Autoscaler features gates can be managed in seed.spec.settings.verticalPodAutoscaler.featureGates. There are no additional Kubernetes versions validation when configuring Seed clusters.
Garden
Disclaimer: The following configurations are relevant for Gardener
Operatorsthat have access toGardencluster(s).
For Garden clusters, Vertical Pod Autoscaler feature gates can be managed in garden.spec.runtimeCluster.settings.verticalPodAutoscaler.featureGates. There are no additional Kubernetes versions validation when configuring Garden clusters.