Networking on Kubernetes
Kubernetes operates a flat private network among all the resources in a Kubernetes cluster. Within a cluster, all Pods can communicate with each other cluster-wide without an network address translation (NAT). Kubernetes gives each Pod its own cluster private IP address, and the IP is the same IP seen by the Pod itself and what others see it as. All containers inside a single Pod can reach each container's port on the localhost. All nodes in a cluster have their individually assigned IPs as well and can communicate with all Pods without an NAT. The following figure (Figure 6.6) shows the different IP assignments for Pods and nodes, and communication flows from different resources:
Sometimes you might need a set of Pods running the same application container (the container for an Nginx application) for high availability and load balancing, for example. Instead of calling...