EKS Vertical Scaling With Karpenter

1/26/2022

I'm evaluating Karpenter (https://karpenter.sh/) and I wanted to know if there's a way to vertically scale down a large node with few pods. The only scaling actions seem to be triggered by either unschedulable pods or empty nodes.

Scenario: I scheduled 5 pods and the scheduler gave me one c5d.2xlarge instance, and that resulted in a 65% utilization (not bad). I killed 3 pods and utilization dropped as expected to 25%. I waited for a few hours to see if an optimization process would kick in but .. nothing (over 20 hours). The feature is not well documented, in fact the only reference of it is in this independent article: https://blog.sivamuthukumar.com/karpenter-scaling-nodes-seamlessly-in-aws-eks

How does it work?

  1. Observes the pod resource requests of unscheduled pods
  2. Direct provision of Just-in-time capacity of the node. (Groupless Node Autoscaling)
  3. Terminating nodes if outdated
  4. Reallocating the pods in nodes for better resource utilization

Am I missing something? Is there a way to do this, using Karpenter or another solution? TIA

-- peter n
amazon-eks
amazon-web-services
autoscaling
kubernetes

1 Answer

1/26/2022

So there's a feature request on Karpenter's Github project addressing this specific issue: https://github.com/aws/karpenter/issues/1091. I'll update this answer once a solution is available.

The workaround suggested by the project team, was to set a short TTL on the nodes (like 1 day), forcing Karpenter to evaluate optimization daily.

-- peter n
Source: StackOverflow