- Newest
- Most votes
- Most comments
When Security Groups for Pods is enabled in Amazon EKS, there are some important distinctions to understand about how ENIs and IP addresses are allocated.
The statement that "branch interface capacity is additive to existing instance type limits for secondary IP addresses" means that the branch ENIs created for Security Groups for Pods provide additional IP addresses beyond what would normally be available through regular secondary ENIs. This is because the trunk ENI (created when you enable Security Groups for Pods) and its associated branch interfaces operate separately from the regular ENI allocation.
However, Karpenter's documentation is also correct. When Security Groups for Pods is enabled, one of the instance's regular ENIs is designated as a trunk ENI. This trunk ENI is then used to create branch interfaces for Pods that need specific security groups. The trunk ENI itself is not available for regular Pod IP assignment, which is why Karpenter recommends setting RESERVED_ENIS=1.
To clarify:
- When Security Groups for Pods is enabled, one ENI becomes a trunk ENI and is no longer available for regular Pod IP assignment.
- The branch interfaces attached to this trunk ENI provide additional IP capacity that is separate from the regular ENI IP allocation.
- Pods that use security groups are not counted in the standard max-pods calculation.
For proper pod density calculation with Karpenter, you should set aws.reservedENIs=1 in the karpenter-global-settings configmap when using Security Groups for Pods. This ensures Karpenter correctly accounts for the ENI that will be used as the trunk ENI.
Regarding your specific example of an m5.large instance: The instance still supports 3 ENIs as per its EC2 specifications. When Security Groups for Pods is enabled, one of these becomes a trunk ENI. The branch interfaces attached to this trunk ENI provide additional capacity, but they don't increase the number of primary ENIs the instance can have.
If you're using Security Groups for Pods, you may need to consider raising the max-pods value to account for the additional capacity provided by branch interfaces, or be prepared to run fewer regular pods than the node might otherwise support.
Sources
Security Groups Per Pod - Amazon EKS
Configure the Amazon VPC CNI plugin for Kubernetes for security groups for Amazon EKS Pods - Amazon EKS
Troubleshooting Amazon EKS networking issues at scale in an Enterprise scenario | AWS re:Post
Network security - Amazon EKS
Amazon VPC CNI - Amazon EKS
Relevant content
- asked 2 months ago
- AWS OFFICIALUpdated 2 years ago

So what’s the correct way to configure Karpenter to calculate the max pods when using security groups?
I found this configuration spec: template: spec: containers: - resources: limits: vpc.amazonaws.com/pod-eni: "1"