Skip to content

Life of a packet in Amazon EKS

0

I want to understand how Pods and external resource requests are forwarded and also what are some of the nuances when requests are forwarded to an Amazon EKS cluster. Are there any deep dive packet walks on this topic ?

2 Answers
1
Accepted Answer

Below session explains how Amazon VPC CNI establishes Kubernetes Pod connectivity to the VPC network and how packets are forwarded. There are many packet walks that dives deep into the details.

AWS
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

1

In Amazon EKS, Pod communication with external resources involves several key components and processes:

  1. Pod IP Assignment: When a Pod is created, it receives an IP address from the Amazon VPC CNI (Container Network Interface) plugin. This IP address is from the same VPC subnet as the node the Pod is running on.

  2. Network Namespace: All containers within a Pod share the same network namespace, allowing them to communicate with each other using localhost.

  3. Outbound Communication:

    • For outbound traffic, when a Pod communicates with an IPv4 address outside of the VPC, the Amazon VPC CNI plugin translates the Pod's IPv4 address to the primary private IPv4 address of the node's primary elastic network interface (ENI).
    • This means that for internet-bound traffic, Pods can only communicate if the node they're running on has a public or elastic IP address and is in a public subnet with a route to an internet gateway.
  4. Inbound Communication:

    • For inbound traffic from external sources, typically a load balancer (like an Application Load Balancer or Network Load Balancer) is used to route traffic to the appropriate Pods.
    • The load balancer can be configured to work with IPv4 or IPv6 addresses, allowing internet-based endpoints to connect to the Pods.
  5. Inter-Pod Communication:

    • Within the cluster, Pod-to-Pod communication is direct and uses the Pod IP addresses assigned by the VPC CNI.
    • This communication is IPv6 native in IPv6-enabled clusters.
  6. Pod to Kubernetes Service Communication:

    • When a Pod communicates with a Kubernetes Service (ClusterIP), this is also IPv6 native in IPv6-enabled clusters.
    • The ClusterIP is assigned from a unique local IPv6 unicast address range allocated by the Amazon EKS control plane.
  7. Communication with VPC-Peered Resources:

    • For resources in VPCs connected via VPC peering, transit VPC, or AWS Direct Connect, communication may be limited in older versions of the CNI plugin (before 1.8.0).
    • In these older versions, Pods could initiate communication to these resources and receive responses, but the external resources couldn't initiate communication to the Pods behind secondary ENIs.
  8. IPv6 to IPv4 Interoperability:

    • In IPv6-enabled clusters, the Amazon VPC CNI plugin includes a built-in egress-only interoperability layer.
    • This allows IPv6 Pods to connect to IPv4 endpoints without requiring any additional user configuration.

Understanding these communication patterns is crucial for effectively managing network traffic and security in an Amazon EKS cluster. It's important to consider the networking requirements when designing your cluster architecture, especially when dealing with public and private subnets, and when integrating with other AWS services or external resources.
Sources
Amazon VPC CNI - Amazon EKS
Enable outbound internet access for Pods - Amazon EKS
Best Practices for Networking - Amazon EKS
The journey to IPv6 on Amazon EKS: Implementation patterns (Part 2) | Containers

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.