Skip to main content

Kubernetes Networking

Updated Apr 07, 2022 ·

Overview​

Key rules in Kubernetes networking:

  1. All Pods can communicate with each other across nodes.
  2. Nodes can communicate with all Pods.
  3. No Network Address Translation (NAT) is needed.

Inside a Pod​

In a multi-container Pod, containers communicate via localhost within the Pod's namespace.

Pod to Pod within a Node​

With multiple Pods on a single node, they communicate over real IP addresses through the node's Layer-2 software bridge.

Pod to Pod on Another Node​

When Pods on different nodes need to communicate, they use their IP addresses and connect over the underlying network.

Overlay Network​

In cases where developers don’t manage the underlying network, an overlay network enables Pods to be connected within a virtualized network.

  • Enables Pod communication across nodes
  • Isolates Kubernetes traffic from infrastructure
  • Abstracts physical network for easier scaling

External Services​

To expose a cluster application to the internet, Kubernetes uses External Services, such as an HTTP service.

Cluster Network Ports​

On the Master node:

ComponentsPorts (TCP)Used By
API6443All
etcd2379-2380API server and other instances of etcd
Scheduler10251Itself, not exposed to outside world
Controller Manager10252Itself, not exposed to outside world
Kubelet10250Control Plane

On the Worker nodes:

ComponentsPorts (TCP)Used By
Kubelet10250Control Plane
NodePort30000-32767All