EKS Cluster Autoscaler Guide
Cluster Autoscaler and Karpenter.
EKS Node Autoscaling
Cluster Autoscaler and Karpenter are two approaches to automatically scaling your EKS worker nodes. The right choice depends on your workload patterns, cost optimization goals, and operational complexity tolerance.
Cluster Autoscaler: The Standard Approach
Cluster Autoscaler adjusts the number of nodes in your Auto Scaling Groups (ASGs) based on pending pod scheduling:
helm install cluster-autoscaler autoscaler/cluster-autoscaler \
--namespace kube-system \
--set autoDiscovery.clusterName=my-cluster \
--set awsRegion=us-east-1 \
--set extraArgs.balance-similar-node-groups=true \
--set extraArgs.skip-nodes-with-local-storage=false \
--set extraArgs.expander=least-wasteHow Cluster Autoscaler Works
- Scale up — Detects unschedulable pods (Pending state), finds an ASG that could accommodate them, and increases the desired count
- Scale down — Identifies underutilized nodes (below 50% utilization), checks if pods can be rescheduled elsewhere, and cordons + drains the node
ASG Configuration for Autoscaler
# Tag your ASGs for auto-discovery
aws autoscaling create-or-update-tags --tags \
"ResourceId=my-asg,ResourceType=auto-scaling-group,Key=k8s.io/cluster-autoscaler/enabled,Value=true,PropagateAtLaunch=true" \
"ResourceId=my-asg,ResourceType=auto-scaling-group,Key=k8s.io/cluster-autoscaler/my-cluster,Value=owned,PropagateAtLaunch=true"Karpenter: The Modern Alternative
Karpenter is AWS's purpose-built Kubernetes node provisioner that offers faster scaling and better cost optimization:
apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
requirements:
- key: kubernetes.io/arch
operator: In
values: ["amd64", "arm64"]
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand", "spot"]
- key: karpenter.k8s.aws/instance-category
operator: In
values: ["c", "m", "r"]
- key: karpenter.k8s.aws/instance-generation
operator: Gt
values: ["5"]
limits:
cpu: "100"
memory: 400Gi
disruption:
consolidationPolicy: WhenUnderutilized
expireAfter: 720hCluster Autoscaler vs Karpenter
| Feature | Cluster Autoscaler | Karpenter |
|---|---|---|
| Scale-up time | 2-5 minutes | 30-90 seconds |
| Instance selection | Fixed ASG instance type | Dynamic, best-fit selection |
| Spot support | Via mixed instance ASGs | Native, automatic fallback |
| Cost optimization | Limited (least-waste expander) | Automatic consolidation |
| Complexity | Low | Medium |
| Multi-AZ | Via ASG configuration | Automatic |
Cost Optimization with Spot Nodes
Both solutions support Spot instances for significant cost savings:
- Use Spot for stateless workloads — Web servers, API servers, workers
- Use On-Demand for stateful workloads — Databases, message brokers
- Diversify instance types — Use 10+ instance types to reduce interruption risk
- Implement graceful shutdown — Handle SIGTERM with connection draining
Monitoring Autoscaling
# Check Cluster Autoscaler status
kubectl -n kube-system logs -l app.kubernetes.io/name=cluster-autoscaler --tail=50
# Check Karpenter status
kubectl -n karpenter logs -l app.kubernetes.io/name=karpenter --tail=50
# View node provisioning events
kubectl get events --field-selector reason=ScaleUp
kubectl get nodeclaims # KarpenterEazy SaaS Tip: We recommend Karpenter for new EKS deployments due to its superior scaling speed and cost optimization. For existing clusters using Cluster Autoscaler, we help migrate to Karpenter with zero downtime, typically achieving 20-30% cost reduction from better instance selection and consolidation.