There are a number of forms of communication in Amazon EKS environments. Strains of communication embody the next:
- Interpod communication between containers
- Communication between pods on the identical node or pods on totally different nodes
- Ingress connections from exterior the cluster
In some circumstances, the default Kubernetes strategies are used. In different circumstances, particularly inter-node communication and ingress strategies particular to Amazon EKS are used.
Containers in a pod share a Linux namespace and may talk with one another utilizing localhost. In Kubernetes networking, the IP tackle with which a container identifies is similar IP tackle for all entities within the community. All containers can talk with all different containers in a pod with out NAT.
Along with every pod having a Linux namespace, the host node additionally has a Linux namespace. Every namespace has its personal routing desk. The pod namespace and host namespace are linked by a Linux digital Ethernet (veth) system. A pair of veths creates a tunnel between the default host namespace and the pod namespace.
Pod-to-pod communication within the host occurs by way of this veth tunnel. Every node is allotted a community vary for containers and every pod will get an IP tackle in that vary permitting containers on the identical host to speak.
To simplify internode communication, Amazon EKS integrates Amazon VPC networking into Kubernetes by way of the Amazon VPC CNI plugin for Kubernetes. CNI permits Kubernetes pods to have the identical IP tackle contained in the pod as they do on the Amazon VPC community.
This CNI plugin is an open-source venture maintained within the amazon-vpc-cni-k8s repository on GitHub. CNI makes use of the Amazon EC2 skill to provision a number of community interfaces to a number occasion—every with a number of secondary IP addresses—to get a number of IP addresses assigned from the Amazon VPC pool. It then distributes these IP addresses to pods on the host and connects the community interface to the veth port created on the pod. The Linux kernel manages the remainder. Due to this fact, each pod has an actual, routable IP tackle from the Amazon VPC and may simply talk with different pods, nodes, or AWS companies.
On the host, CNI modifies each the default routing desk and the community interface routing desk. The default routing desk is used to route site visitors to pods. Every community interface has its personal routing desk that’s used to route outgoing pod site visitors. Every pod is assigned one of many community interface’s secondary IP addresses. For instance, if a pod sends community site visitors out of the occasion, the VPC-CNI plugin ensures that the site visitors routes by way of the right community interface.