Docs/How do I scale an EKS dev cluster to zero nodes at night?

How do I scale an EKS dev cluster to zero nodes at night?

Scale the managed node groups of a dev/test EKS cluster to zero on a schedule and restore their exact sizes in the morning, without Kubernetes access.

Check eligibility first

  • The cluster is ACTIVE, has at least one managed node group, and is in Managed resources.
  • Workers run in managed node groups. Clusters with Fargate, EKS Auto Mode, Karpenter, or other unmanaged nodes are refused.
  • No Environment=production style tag (env, environment, snoozedb:env, snoozedb:environment, snoozedb:tag:env, or snoozedb:tag:environment set to prod or production) and no snoozedb:enabled=false.
  • A paid plan or valid trial, and an owner or admin (with MFA when the organization requires it).

Verify a node group from the AWS CLI

aws eks describe-nodegroup \
  --cluster-name dev-cluster \
  --nodegroup-name default \
  --query 'nodegroup.scalingConfig'
# During hibernation: {"minSize": 0, "maxSize": <unchanged>, "desiredSize": 0}

What keeps billing

The EKS control plane, load balancers, NAT gateways, EBS volumes, and public IPv4 addresses continue to cost money. Measure wake-up time before relying on a morning schedule.