Skills / Community / Karpenter K8s Autoscaling

Karpenter K8s Autoscaling

Replace Cluster Autoscaler with Karpenter on EKS. Generates NodePool and EC2NodeClass manifests, spot/on-demand mixes, consolidation policies, instance-type weights, and disruption budgets.

This skill covers Karpenter v1+: bootstrapping on EKS or self-managed K8s, writing NodePool CRDs with requirements (instance family, arch, capacity-type, AZ), EC2NodeClass for AMI/IAM/userdata, consolidation (WhenUnderutilized + WhenEmpty) for bin-packing, expireAfter and disruption budgets for safe churn, and mixing spot/on-demand with fallback. Includes cost-optimization patterns, GPU workloads, and migration off Cluster Autoscaler.

karpenter kubernetes eks autoscaling spot

When to use

Use when migrating from Cluster Autoscaler to Karpenter, optimizing EKS costs with spot, configuring GPU node pools, or right-sizing consolidation policies.

Examples

Spot-first NodePool

Cost-optimized batch workloads

Create a Karpenter NodePool that prefers spot c6i/c7i instances across 3 AZs, falls back to on-demand if spot is unavailable, and aggressively consolidates underutilized nodes after 30 seconds

GPU node pool

Isolated pool for ML inference

Write a Karpenter NodePool and EC2NodeClass for g5.xlarge GPU nodes tainted nvidia.com/gpu=true, with the EKS GPU AMI and capped at 8 nodes max
Added to wishlist