Course contentsShow
← Cloud and Infrastructure
Lesson 1470 of 2,98930. Managed Kubernetes ServicesFree lesson

Amazon VPC CNI Plugin

How the VPC CNI assigns VPC IPs to pods, SNAT behavior, and IP address planning.

Amazon VPC CNI Plugin

What you'll learn: How Amazon's VPC CNI plugin assigns real VPC IP addresses to your EKS pods, manages network address translation, and why IP planning matters.

What Is the VPC CNI Plugin?

The Amazon VPC CNI (Container Network Interface) plugin is EKS's default networking solution that gives each pod a full VPC IP address. Unlike other CNI plugins that use overlay networks with pod-specific subnets, AWS's approach treats pods as first-class citizens in your VPC—they get IPs from the same subnet as the worker nodes.

Think of it like giving every apartment in a building its own street address, rather than routing everything through the building's main entrance.

How IP Assignment Works

When a node joins your cluster, the VPC CNI:

  1. Pre-allocates a pool of Elastic Network Interfaces (ENIs) to the node
  2. Attaches multiple secondary IPs to those ENIs
  3. Assigns these secondary IPs to pods as they're scheduled
  4. Maintains a "warm pool" of ready-to-use IPs for fast pod launches

The number of pods per node depends on the instance type—larger instances support more ENIs and IPs per ENI.

SNAT Behavior

By default, when pods communicate outside the VPC, the CNI performs Source Network Address Translation (SNAT)—replacing the pod's IP with the node's primary IP. This conserves IPs but obscures the pod's identity externally.

You can disable SNAT (AWS_VPC_K8S_CNI_EXTERNALSNAT=false) if your VPC routing can handle pod IPs directly, preserving source identity for auditing.

IP Address Planning Matters

Since pods consume real VPC IPs, you must plan subnet sizing carefully. A subnet with /24 CIDR (256 addresses) might seem sufficient, but with overhead and multiple nodes requesting IP pools, you can exhaust addresses faster than expected. Always allocate larger subnets for pod-dense workloads.

Key Takeaway: The VPC CNI gives pods native VPC IPs from your subnets, enabling seamless VPC integration but requiring careful IP capacity planning and understanding of SNAT behavior for external traffic.