AKS icon indicating copy to clipboard operation
AKS copied to clipboard

VPA with "in-place" patch of resource allocation for pods

Open aevlogiev opened this issue 3 years ago • 19 comments

With kubernetes 1.27 they introduces In-place Resource Resize for Kubernetes Pods (alpha) and released feature: InPlacePodVerticalScaling - https://kubernetes.io/blog/2023/05/12/in-place-pod-resize-alpha/

Is there work already done/started on VPA addon for aks ? - https://learn.microsoft.com/en-us/azure/aks/vertical-pod-autoscaler

Currently, Auto is equivalent to Recreate, and also is the default mode. Once restart free ("in-place") update of pod requests is available, it may be used as the preferred update mechanism by the Auto mode.

This feature will drastically improve the overall capability if VPA is able to use the in-place feature that was introduced in 1.27 and maintain 0 downtime as pods are no longer restarted to apply.

aevlogiev avatar Oct 13 '23 10:10 aevlogiev

Any update on this? Would be nice to have enabled the InPlacePodVerticalScaling feature gate in AKS v1.27+. Thanks!

carlosbustillordguez avatar Nov 15 '23 10:11 carlosbustillordguez

Any update? Very interesting feature

andreyolv avatar Dec 15 '23 12:12 andreyolv

Hi, any update on this? Is InPlacePodVerticalScaling available in aks?

michal-poliwka avatar Dec 21 '23 16:12 michal-poliwka

We should have InPlacePodVerticalScaling on Linux and Windows workloads.

https://github.com/kubernetes/enhancements/issues/1287 The New In-Place Kubernetes Pod Resource Resizing Feature: A Deep Dive

cc: @palma21 / @justindavies

bplasmeijer avatar Mar 19 '24 20:03 bplasmeijer

We will, as it turns Beta and enabled by default, which right now IIRC is slated for 1.30 (?) it should be alpha before that.

palma21 avatar Mar 20 '24 01:03 palma21

This would be a huge benefit for us; in cost savings and in resiliency. Our application is bursty.

iamandycohen avatar Mar 20 '24 12:03 iamandycohen

We will, as it turns Beta and enabled by default, which right now IIRC is slated for 1.30 (?) it should be alpha before that.

Could Microsoft provide assistance in this regard @palma21 @justindavies?

bplasmeijer avatar Jun 03 '24 13:06 bplasmeijer

Hi, do you have any update?.

Is it available now?

satrox28 avatar Jul 11 '24 09:07 satrox28

Any updates? Status?

gerbil avatar Dec 04 '24 07:12 gerbil

I will give an update: Current state of InPlacePodVerticalScaling is alpha enabled:false With Kubernetes 1.32 they did some tweaks for: Version skew strategy update for InPlacePodVerticalScaling for beta graduation. Here you can read the state of the feature still its in 1.27 release alpha: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/ The feature haven't yet met Aks requirements = Beta enabled:true In Kubernetes prerelease Kubernetes v1.32.0-rc.1 is announced tor graduation. Therefore this feature won't be available at least by 1.33 GA version or a patch of 1.32 when it comes to GA version. Those versions are for Kubernetes not aks. Aks version 1.32 becomes GA march 2025. So you do the math.

IMPORTANT: They dropped InPlacePodVerticalScaling for windows

Hope that helps see you in few months. :)

aevlogiev avatar Dec 04 '24 14:12 aevlogiev

Hi @aevlogiev ! FEATURE STATE: Kubernetes v1.33 [beta] (enabled by default: true)

When do you think it will become available for AKS? Any premonition? 😄

AndreiDoroftei avatar Apr 29 '25 15:04 AndreiDoroftei

Hi @aevlogiev ! FEATURE STATE: Kubernetes v1.33 [beta] (enabled by default: true)

When do you think it will become available for AKS? Any premonition? 😄

Well we are at upstream release on aks for 1.33 from last month. It should go preview this month, so Live will be although stated in their article that preview and GA will be this month, I assume that within couple of weeks we need to have 1.33 aks. So hold tight :).

aevlogiev avatar May 30 '25 10:05 aevlogiev

It is available. We already use it in our clusters.

AndreiDoroftei avatar Jul 03 '25 12:07 AndreiDoroftei

@AndreiDoroftei I tested last week. Pod spec is still not supporting the value and there are no other Microsoft documents which confirms the in place upgrade is rolled out. And here is an AKS Roadmap: https://github.com/Azure/AKS/issues/5072 which says they are not doing it. How are you saying it that it is available without any relevant reference links?

AAFAYZ avatar Aug 13 '25 09:08 AAFAYZ

@AAFAYZ You can use this document to test on AKS 1.33.1. The command for patch is bit different for in place patch

kubectl patch pod resize-demo --subresource resize --patch \
  '{"spec":{"containers":[{"name":"pause", "resources":{"requests":{"cpu":"800m"}, "limits":{"cpu":"800m"}}}]}}'

I have tested this in AKS 1.33.1 and I can confirm that it works

dtiwari3011 avatar Aug 13 '25 10:08 dtiwari3011

@dtiwari3011 The one you have pasted is manual patching of the new resource request and limits and Kubernetes is restarting the container without an user restarting the pod, but that's not the use case. VPA will be restarting the containers instead of recreating the pods which is not mentioned right now for AKS. Hope you can understand now

AAFAYZ avatar Aug 13 '25 11:08 AAFAYZ

@AAFAYZ You are correct. VPA project is still in progress and it doesn't support yet. However, you can create your in place controller by yourself using the same feature of AKS.

dtiwari3011 avatar Aug 13 '25 11:08 dtiwari3011

As for our clusters, we are using Kube Startup CPU Boost and it does work.

AndreiDoroftei avatar Aug 13 '25 12:08 AndreiDoroftei

Thanks for the confirmation @dtiwari3011, @AndreiDoroftei thats wonderful

AAFAYZ avatar Aug 13 '25 13:08 AAFAYZ