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

AKS Networking Models: kubenet vs Azure CNI

Comparing networking plugins and their impact on IP allocation and network integration.

AKS Networking Models: kubenet vs Azure CNI

You'll learn: How AKS's two networking plugins differ in IP address allocation and how they integrate with Azure virtual networks.

Understanding the Two Models

When you create an AKS cluster, you must choose between kubenet (basic networking) and Azure CNI (advanced networking). This choice fundamentally affects how pods receive IP addresses and communicate with resources outside the cluster.

kubenet: NAT-Based Networking

With kubenet, pods receive IP addresses from a private IP range that's separate from your Azure VNet. Think of it like an apartment complex with its own internal address system—residents use those addresses inside, but mail goes to a single building address outside.

  • Pods get IPs from a cluster-internal CIDR (e.g., 10.244.0.0/16)
  • Traffic leaving the node is NAT'd to the node's IP address
  • Smaller VNet footprint: only nodes consume VNet IPs
  • Route tables required for pod-to-pod communication across nodes
  • Limitation: Pods aren't directly addressable from outside the cluster

Azure CNI: Direct Integration

With Azure CNI, every pod gets an IP address directly from your Azure VNet subnet. This is like giving each apartment its own street address—everyone is directly reachable.

  • Pods consume VNet IP addresses (requires larger subnet planning)
  • No NAT: pods have first-class network citizens status
  • Direct connectivity from VNet resources to pods
  • Simpler network policies and firewall rules
  • Cost: Faster IP exhaustion; careful subnet sizing needed

Choosing Between Them

Use kubenet for dev/test clusters or when VNet IP space is limited. Choose Azure CNI when you need direct pod connectivity, tighter Azure integration, or enterprise network policy enforcement.

Key Takeaway: Kubenet conserves VNet IPs through NAT but adds routing complexity, while Azure CNI provides direct VNet integration at the cost of consuming more IP addresses per pod.