Why your EKS node shows 110 Pods when the formula says 234
You add an m5.4xlarge to a managed node group, run kubectl describe node , and see pods: 110 . The AWS documentation for the VPC CNI says the same instance supports 234. Both numbers are right; they come from two different rules. Rule 1: Pods need IP addresses With the Amazon VPC CNI, every Pod gets a real VPC address from one of the node's network interfaces (ENIs). The limit per node is…
When adding an m5.4xlarge instance to a managed node group in Amazon EKS, the kubelet reports "pods: 110" in the output of "kubectl describe node". However, the AWS documentation for the VPC CNI states that the same instance can support 234 pods. This discrepancy arises from two distinct rules.
The first rule dictates that each pod requires a unique IP address from one of the node's network interfaces (ENIs). The max pods limit is determined by the formula: max Pods = ENIs × (IPs per ENI − 1) + 2. Each ENI reserves one address for itself, necessitating the subtraction of 1. Additionally, the + 2 accounts for the pods utilizing the node's own IP (hosted by VPC CNI and kube-proxy).
For instance, an m5.4xlarge instance, with 8 ENIs supporting 30 IPs each, would theoretically allow for 234 pods. However, the second rule comes into play when managing node groups. If the node group launches instances without a custom AMI, AWS sets maxPods itself, capping it at 110 for nodes with fewer than 30 vCPUs. The larger m5.4xlarge instance, with 16 vCPUs, falls under this cap, reducing the pod count to 110, despite the theoretical maximum of 234.
Consequently, increasing CPU does not directly correspond to an increase in pod capacity. All instances within the same generation typically maintain the same pod limit. For example, all m5 instances, m6i, and m7i share the same limit regardless of their specific size.
Moreover, managed node groups cap the pod count at 110 for instances with fewer than 30 vCPUs and 250 for those with 30 or more. Thus, an m5.16xlarge instance, despite its 64 vCPUs, can only support 250 pods due to this cap.
If more pods are required, a launch template with a custom AMI or self-managed nodes should be employed, allowing for the direct setting of maxPods. However, it's essential to verify whether the enhanced pod count is truly necessary. For an m5.4xlarge instance, 110 pods translates to roughly 145 million CPU units per pod, which may be excessive.
Furthermore, the VPC CNI offers an option called "prefix delegation" (available in VPC CNI 1.9.0 or later, on Nitro instances). This feature allows each IP slot on an ENI to encompass a /28 prefix of 16 addresses, effectively increasing the pod count. For example, an m5.large instance would transition from 29 to 110 pods. However, this setup necessitates contiguous /28 blocks in the subnet; fragmented subnets result in an "InsufficientCidrBlocks" error.
The managed node group cap still applies, even with prefix delegation. To determine the actual pod count a node received, the command "kubectl get nodes -o custom-columns=NAME:.metadata.name,TYPE:.metadata.labels.node.kubernetes.io/instance-type,PODS:.status.capacity.pods" can be used. If this differs from the calculated value, the cap or explicit maxPods setting is likely the cause.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to