Skip to main content

EKS Prefix Delegation - IP Planning Guide

kubectl get nodes -o custom-columns=NAME:.metadata.name,CAPACITY:.status.capacity.pods,ALLOCATABLE:.status.allocatable.pods,AGE:.metadata.creationTimestamp

πŸ“Š Your Subnet Configuration

SubnetCIDRAvailable IPsAvailability Zone
Subnet 110.50.64.0/204,096 IPsAZ-1
Subnet 210.50.112.0/204,096 IPsAZ-2
Subnet 310.50.16.0/204,096 IPsAZ-3
Total Available: ~12,288 IPs across all subnets

πŸ”„ How Prefix Delegation Works

Traditional Secondary IP Mode (Before)

Node ENI β†’ Requests individual IPs
β”œβ”€ Primary IP: 1 IP (for node)
β”œβ”€ Secondary IP: 1 IP (for pod 1)
β”œβ”€ Secondary IP: 1 IP (for pod 2)
└─ Secondary IP: 1 IP (for pod 3)

Prefix Delegation Mode (Now)

Node ENI β†’ Requests /28 prefix (16 IPs at once)
β”œβ”€ Primary IP: 1 IP (for node)
β”œβ”€ Prefix 1: /28 = 16 IPs (for 16 pods)
β”œβ”€ Prefix 2: /28 = 16 IPs (for 16 pods)
└─ Prefix 3: /28 = 16 IPs (for 16 pods)

πŸ–₯️ Your Node Configuration (m6g.large)

Network Interface Limits:

  • ENIs per node: 3 ENIs maximum
  • Prefixes per ENI: 16 prefixes (with prefix delegation)
  • IPs per prefix: 16 IPs (/28 CIDR block)

IP Allocation per Node:

m6g.large Node
β”œβ”€ ENI 0 (Primary)
β”‚   β”œβ”€ 1 Primary IP (node itself)
β”‚   └─ Up to 16 prefixes Γ— 16 IPs = 256 IPs
β”‚
β”œβ”€ ENI 1 (Secondary)
β”‚   └─ Up to 16 prefixes Γ— 16 IPs = 256 IPs
β”‚
└─ ENI 2 (Secondary)
    └─ Up to 16 prefixes Γ— 16 IPs = 256 IPs

Total theoretical: 1 + (3 ENIs Γ— 16 prefixes Γ— 16 IPs) = 769 IPs
But Kubernetes limits it to ~110 pods per node (kubelet default)

πŸ’‘ How Your Configuration Works

With WARM_PREFIX_TARGET = β€œ1”

When a node starts:
  1. Initial allocation: Requests 1 prefix (/28 = 16 IPs) per ENI
    • 3 ENIs Γ— 1 prefix Γ— 16 IPs = 48 IPs reserved initially
    • Plus 1 primary IP for node = 49 IPs per node
  2. As pods are scheduled:
    • When 15 out of 16 IPs in a prefix are used
    • VPC CNI requests another /28 prefix (16 more IPs)
    • Keeps 1 β€œwarm” prefix ready at all times
  3. Maximum allocation per node:
    • Up to 110 pods (Kubernetes limit)
    • Each pod = 1 IP
    • Actual IPs requested = ~7-8 prefixes Γ— 16 = 112-128 IPs per node

πŸ“ˆ Your Capacity Calculation

Current Node Group (1-2 nodes):

NodesIPs Used (Initial)IPs Used (Full)Subnet Impact
2 nodes2 Γ— 49 = 98 IPs2 Γ— 128 = 256 IPsMinimal

Scaled Node Group (Max capacity scenarios):

Let’s calculate different scenarios:

Scenario 1: 10 Nodes

  • Initial: 10 Γ— 49 = 490 IPs
  • Full capacity: 10 Γ— 128 = 1,280 IPs
  • Pods: 10 Γ— 110 = 1,100 pods

Scenario 2: 50 Nodes

  • Initial: 50 Γ— 49 = 2,450 IPs
  • Full capacity: 50 Γ— 128 = 6,400 IPs
  • Pods: 50 Γ— 110 = 5,500 pods

Scenario 3: 100 Nodes

  • Initial: 100 Γ— 49 = 4,900 IPs
  • Full capacity: 100 Γ— 128 = 12,800 IPs
  • Pods: 100 Γ— 110 = 11,000 pods

βœ… Your Subnet Capacity Assessment

Per Subnet (each /20):

Available IPs per subnet: 4,096
Maximum nodes per subnet (at full capacity): ~32 nodes
Maximum pods per subnet: 32 Γ— 110 = ~3,520 pods

Total Capacity (all 3 subnets):

Total Available IPs: 12,288
Maximum nodes (distributed): ~96 nodes
Maximum pods: 96 Γ— 110 = ~10,560 pods

🎯 Your Configuration is EXCELLENT! βœ…

Why Your Setup Works Well:

  1. βœ… Large Subnets: /20 subnets are very generous
  2. βœ… Multiple AZs: Distributes load across 3 availability zones
  3. βœ… Room to Grow: Can support ~30 nodes per subnet
  4. βœ… Prefix Efficiency: /28 prefixes align well with your subnet size

πŸ” Real-World Example

Let’s say you have 2 nodes (current config):

Node 1 in Subnet 1 (10.50.64.0/20):

- Node IP: 10.50.64.10
- Prefix 1 (ENI 0): 10.50.64.16/28 β†’ 10.50.64.16 - 10.50.64.31 (16 IPs)
- Prefix 2 (ENI 1): 10.50.64.32/28 β†’ 10.50.64.32 - 10.50.64.47 (16 IPs)
- Prefix 3 (ENI 2): 10.50.64.48/28 β†’ 10.50.64.48 - 10.50.64.63 (16 IPs)

Node 2 in Subnet 2 (10.50.112.0/20):

- Node IP: 10.50.112.10
- Prefix 1 (ENI 0): 10.50.112.16/28 β†’ 10.50.112.16 - 10.50.112.31 (16 IPs)
- Prefix 2 (ENI 1): 10.50.112.32/28 β†’ 10.50.112.32 - 10.50.112.47 (16 IPs)
- Prefix 3 (ENI 2): 10.50.112.48/28 β†’ 10.50.112.48 - 10.50.112.63 (16 IPs)
Each pod gets one IP from these prefixes automatically!

πŸ“‹ Recommendations

βœ… You’re Good to Go!

Your current setup can comfortably support:
  • Short term: 2-10 nodes (your current plan)
  • Medium term: 20-30 nodes per subnet
  • Long term: Up to ~90 nodes total

Optional Optimizations:

If you want to be even more efficient, you could adjust WARM_PREFIX_TARGET:
# More aggressive (saves IPs)
WARM_PREFIX_TARGET = "0"  # Request prefixes only when needed

# Current (balanced)
WARM_PREFIX_TARGET = "1"  # Keep 1 warm prefix ready

# More prefixes (faster pod startup)
WARM_PREFIX_TARGET = "2"  # Keep 2 warm prefixes ready

πŸš€ Summary

You have PLENTY of IP space! Your /20 subnets are well-sized for prefix delegation. With your current 2-node setup, you’re using less than 0.5% of your subnet capacity. Even scaling to 50+ nodes would still be comfortable.

πŸ“š Additional Resources