Sub topic 4
Node groups and the cloud capacity behind them
This chapter assumes you know Pods, Deployments and Nodes, how resource requests work, and what an AWS Auto Scaling group (ASG) is. It explains what a node group is, because the Cluster Autoscaler can only resize groups that already exist.
What a node group is
A node group is a set of nodes that share one configuration: instance type, image, labels, taints, disk and subnets. The cloud provider keeps the group at a chosen size. On AWS, a node group is usually an Auto Scaling group, either one you create yourself or one that a managed node group creates for you.
Each group has three numbers:
- Minimum size: the autoscaler never shrinks the group below this.
- Maximum size: the autoscaler never grows the group above this.
- Desired size: the current target. The autoscaler changes this number, and the cloud then adds or removes instances to match it.
The Cluster Autoscaler does not launch instances itself. It raises or lowers the desired size, and the ASG does the launching. This has two consequences. First, the autoscaler can only choose among groups you defined in advance. Second, every node in a group looks the same, so the autoscaler assumes a new node will match the existing ones.
Why group design matters
Groups are the unit of choice. If a pending Pod needs 12 CPUs and your largest group uses 4-CPU instances, no group can ever fit it, and scaling up will not help.
Typical designs use several groups:
| Group | Purpose | Example setting |
|---|---|---|
| general | Most stateless workloads | 4 vCPU, on-demand |
| memory | Caches and databases | 8 vCPU, high memory |
| gpu | Machine learning jobs | GPU instance, tainted |
| spot | Interruptible batch work | Spot, several instance types |
Taints and labels on a group steer Pods to it. A GPU group with a taint keeps ordinary Pods off expensive nodes.
Cloud capacity limits
A group's maximum size is not a guarantee. The cloud must still have capacity. Scale-up can stall for several reasons:
- The instance type is unavailable in that zone, so the ASG cannot launch it.
- An account quota, such as a vCPU limit, is reached.
- The subnet has run out of IP addresses.
In these cases the desired size rises, but nodes never join. The Pod stays Pending. Checking the ASG activity history in the AWS console or CLI usually shows the real error.
Zones and group layout
An ASG that spans several zones can launch nodes in a zone you did not want, which breaks Pods that need a specific zone. This is why many teams create one group per zone, then use the --balance-similar-node-groups option you will meet later to keep them evenly sized.
Exercise
A Pod requests 16 CPUs. Your node groups use instances with 4, 8 and 8 CPUs, and each has plenty of room before its maximum size. Will the Cluster Autoscaler fix the Pending Pod? Why or why not?
Show answer
No. The autoscaler can only grow existing groups, and a new node from any group has too few CPUs for the Pod. No amount of scaling makes the Pod fit. You need a group with larger instances or a smaller request.