KUBERNETES · KCNA · CHAPTER 5

Orchestration Networking

How nodes connect, how pods talk to each other, and how outside traffic reaches your applications.

14 min readKCNA domain: Container Orchestration (28%)Level: beginner

From point A to point B

Point A: you know how to create pods and Services, and how to protect them, but the network that connects them is still a black box. Point B: by the end of this chapter you'll understand the three network layers in Kubernetes: the node network, the pod network and the one that brings outside traffic to your applications.

Networking is part of the Container Orchestration domain (28% of the KCNA exam). If you come from a networking background, you'll recognize a lot here: interfaces, routes, bridges, DNS and load balancers, only automated.

What you'll cover
  1. The node network and each component's ports
  2. The pod network model
  3. CNI plugins: Calico, Cilium, Flannel
  4. Cluster DNS with CoreDNS
  5. Ingress and Gateway API

The cluster network

The foundation is a regular network, physical or virtual, local or wide area, that all the nodes connect to. This is the underlay network. Each node needs at least one interface on it, with a unique IP address, hostname and MAC address.

On top of that network, each component listens on a well-known port. If there's a firewall or a cloud security group between the nodes, these ports have to be open:

NodeTCP portComponentUsed by
Control plane6443kube-apiserverEveryone
Control plane2379-2380etcdkube-apiserver, etcd
Control plane10259kube-schedulerThe node itself
Control plane10257kube-controller-managerThe node itself
All10250kubeletThe node itself and the control plane
Workers30000-32767NodePort ServicesEveryone
Cluster network and ports Three nodes share a physical network, 192.168.1.0/24. The control plane node exposes the API server on port 6443, etcd on 2379-2380, the kubelet on 10250, the scheduler on 10259 and the controller manager on 10257. Each worker node exposes the kubelet on 10250 and NodePort services on 30000-32767. NODE NETWORK · 192.168.1.0/24 CONTROL PLANE · .10 kube-apiserver :6443 etcd :2379-2380 kubelet :10250 kube-scheduler :10259 controller-manager :10257 WORKER 1 · .11 kubelet :10250 NodePort :30000-32767 kube-proxy container runtime WORKER 2 · .12 kubelet :10250 NodePort :30000-32767 kube-proxy container runtime

All the nodes share one network, and each component listens on its own port. Diagram: The House of Routing.

The commands to inspect a node's network are the same as on any Linux machine:

ip link                      # network interfaces of the node
ip addr show eth0            # the node's IP address
ip route                     # routing table and default gateway
ss -tlnp | grep kube         # ports the Kubernetes components listen on
kubectl get nodes -o wide    # INTERNAL-IP of every node
Useful fact. etcd can live outside the control plane nodes, in its own cluster and with other ports. That's why the port table is a reference, not a fixed rule.

The pod network

The node network isn't enough: pods need their own network, and Kubernetes doesn't implement it. What it does is set a model with three rules that any solution has to follow:

  1. Every pod has its own IP address.
  2. All the pods on a node can talk to each other.
  3. All pods can talk to pods on any other node without NAT: the destination pod sees the source pod's real IP.

You can build it by hand, and doing it once helps you understand it. On each node, for each pod, you create a network namespace, connect it to a bridge with a virtual cable, give it an IP from the node's range and add routes:

# What a CNI plugin automates on every node, for every pod:
ip netns add pod-a                                  # 1. a network namespace for the pod
ip link add v-pod-a type veth peer name v-pod-a-br  # 2. a virtual cable (veth pair)
ip link set v-pod-a netns pod-a                     #    one end inside the pod
ip link set v-pod-a-br master cni0                  #    the other end on the node bridge
ip -n pod-a addr add 10.244.1.2/24 dev v-pod-a      # 3. an IP from the node's pod range
ip -n pod-a link set v-pod-a up
ip -n pod-a route add default via 10.244.1.1        # 4. a route out of the pod
The pod network Each node gets its own pod range: node01 uses 10.244.1.0/24 and node02 uses 10.244.2.0/24. Pods connect to a bridge on their node. A route sends traffic for the other node's range through that node, so pod 10.244.1.2 reaches pod 10.244.2.2 directly, without NAT. The CNI plugin sets all of this up. NODE01 · 192.168.1.11 NODE02 · 192.168.1.12 bridge cni0 · 10.244.1.0/24 bridge cni0 · 10.244.2.0/24 10.244.1.2 10.244.1.3 10.244.2.2 10.244.2.3 route: 10.244.2.0/24 via 192.168.1.12 10.244.1.2 → 10.244.2.2 · no NAT The CNI plugin (Calico, Cilium, Flannel…) creates the interfaces, IPs and routes.

Each node has its own IP range for pods, and a route sends traffic to the right node without NAT. Diagram: The House of Routing.

Doing this by hand with hundreds of pods that come and go every minute is impossible. That's why the right solution is a CNI plugin.

What about Services? The Services from chapter 2 rely on this network. Their ClusterIP doesn't belong to any interface: on each node, kube-proxy creates iptables or IPVS rules that translate that virtual IP into the IP of one of the pods.

CNI: the network plugins

CNI (Container Network Interface) is a CNCF standard that defines how a container runtime asks a plugin for networking. When a pod is created, the runtime calls the plugin with the ADD command, and the plugin creates the interface, assigns the IP and sets up the routes. When the pod is deleted, the runtime calls it with DEL and the plugin cleans everything up.

  • The plugin configuration is in /etc/cni/net.d/.
  • The plugin binaries are in /opt/cni/bin/.
  • The plugin is usually deployed as a DaemonSet, with one pod on each node.
ls /etc/cni/net.d/              # which CNI plugin is configured
ls /opt/cni/bin/                # the plugin binaries
kubectl get pods -n kube-system # e.g. calico-node or cilium on every node
kubectl get pods -o wide        # the IP and node of every pod
PluginHow it worksNetwork Policies
FlannelA simple overlay network with VXLANDoesn't enforce them on its own
CalicoBGP routing or overlay, widely used in companiesYes
CiliumBased on eBPF, with observability through HubbleYes, including layer 7
Back to chapter 4. The CNI plugin is also what enforces Network Policies. That's why choosing a CNI is a security decision, not just a networking one.

DNS in Kubernetes

Pod IPs change every time pods are recreated, so applications find each other by name. Kubernetes comes with its own DNS server: CoreDNS, which runs as a Deployment in the kube-system namespace behind a Service called kube-dns.

Every time you create a Service, CoreDNS gives it a name. The full name has four parts:

DNS inside the cluster A pod asks CoreDNS for web-service.apps.svc.cluster.local. CoreDNS answers with the ClusterIP of that Service, 10.96.0.20. The name has four parts: the service name, the namespace, the type svc and the cluster domain cluster.local. POD · apps nameserver 10.96.0.10 query 10.96.0.20 COREDNS kube-system · 10.96.0.10 SERVICE web-service · 10.96.0.20 FULLY QUALIFIED NAME web-service . apps . svc . cluster.local service namespace type cluster domain

A Service's full name: service, namespace, type and cluster domain. Diagram: The House of Routing.

You don't always need to type it in full. The kubelet sets up each pod's /etc/resolv.conf file with search domains:

# /etc/resolv.conf inside a pod of the namespace "apps"
nameserver 10.96.0.10
search apps.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
  • From the same namespace, web-service is enough.
  • From another namespace, use web-service.apps.
  • The full name, web-service.apps.svc.cluster.local, works from anywhere.

Pods can have DNS records too, but they're based on the IP with dashes (10-244-1-5.apps.pod.cluster.local) and turned off in many installations. In practice, you always talk to a Service.

kubectl get pods -n kube-system -l k8s-app=kube-dns
kubectl get svc -n kube-system kube-dns
kubectl run dns-test --image=busybox:1.36 --rm -it --restart=Never -- \
  nslookup web-service.apps.svc.cluster.local

Ingress

To publish an application outside the cluster, you can use a NodePort or LoadBalancer Service. It works, but with ten applications you'd have ten load balancers, ten public IPs and ten certificates to manage.

Ingress solves that with a single entry point that routes HTTP and HTTPS traffic by hostname or path. It has two parts:

  • The Ingress controller: a reverse proxy that runs in the cluster, such as NGINX, Traefik, HAProxy or Envoy. It isn't installed by default: without a controller, Ingress resources do nothing.
  • Ingress resources: the rules, written in YAML, that the controller reads and applies.
Ingress: one entry point, many services Users reach shop.example.com through a single load balancer. The Ingress controller reads the Ingress rules: requests to /wear go to wear-service and requests to /watch go to watch-service, each with its own pods. USERS shop.example.com INGRESS CONTROLLER e.g. NGINX, Traefik, HAProxy, Envoy reads the rules: /wear → wear-service /watch → watch-service TLS · one public IP WEAR-SERVICE ClusterIP :80 WATCH-SERVICE ClusterIP :80 pods pods Without Ingress, every service would need its own LoadBalancer and public IP.

A single controller routes traffic to several Services based on the path. Diagram: The House of Routing.

Path-based rules: everything arrives at shop.example.com and the path decides where it goes.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
spec:
  ingressClassName: nginx
  rules:
    - host: shop.example.com
      http:
        paths:
          - path: /wear
            pathType: Prefix
            backend:
              service:
                name: wear-service
                port:
                  number: 80
          - path: /watch
            pathType: Prefix
            backend:
              service:
                name: watch-service
                port:
                  number: 80

Host-based rules: each subdomain goes to its own Service.

spec:
  ingressClassName: nginx
  rules:
    - host: wear.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: { name: wear-service, port: { number: 80 } }
    - host: watch.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: { name: watch-service, port: { number: 80 } }

ingressClassName says which controller handles the resource, and pathType can be Prefix (the path and everything under it) or Exact (only that path). With a tls section and a Secret holding the certificate, the controller terminates HTTPS.

kubectl get ingressclass
kubectl get ingress
kubectl describe ingress shop
kubectl create ingress shop --class=nginx \
  --rule="shop.example.com/wear*=wear-service:80"

Gateway API: what's next

The Ingress API is still available and stable, but it's frozen: it no longer gets new features. Its successor is Gateway API, which splits responsibilities across three objects:

  • GatewayClass: the type of load balancer, defined by the infrastructure provider.
  • Gateway: the actual entry point, with its ports and certificates. The platform team manages it.
  • HTTPRoute (and other routes): each application's rules. Each development team writes its own.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: shop
spec:
  parentRefs:
    - name: public-gateway      # a Gateway managed by the platform team
  hostnames: ["shop.example.com"]
  rules:
    - matches:
        - path: { type: PathPrefix, value: /wear }
      backendRefs:
        - name: wear-service
          port: 80
Watch out. The community Ingress NGINX controller stopped being maintained in March 2026: it no longer gets new releases or security patches. Existing installations keep working, but the Kubernetes project recommends migrating to Gateway API or to another Ingress controller.

KCNA-style challenge

Answer before you open the solution. Getting it wrong here is the cheapest way to learn.

1. Which port does the kube-apiserver listen on?

6443. etcd uses 2379-2380 and the kubelet uses 10250.

2. A pod on node 1 talks to a pod on node 2. According to the Kubernetes network model, which source IP does the destination see?

The source pod's real IP. The model requires pod-to-pod communication without NAT.

3. Which component creates the interface and assigns the IP for a new pod?

The CNI plugin, which the container runtime calls with the ADD command.

4. A pod in the front namespace wants to reach the api Service in the back namespace. Which short name works?

api.back, or the full name api.back.svc.cluster.local. Just "api" isn't enough, because it would be looked up in the front namespace.

5. You create a correct Ingress resource, but nothing happens. What's missing?

An Ingress controller. Kubernetes doesn't install one by default, and without it the rules aren't applied.

Key takeaways

  • The nodes share a regular network; the API server listens on 6443, etcd on 2379-2380 and the kubelet on 10250.
  • NodePorts use the 30000-32767 range.
  • The network model: every pod has its own IP, and all pods talk to each other without NAT, whatever node they're on.
  • Kubernetes doesn't implement the pod network: a CNI plugin such as Calico, Cilium or Flannel does.
  • CoreDNS gives Services their names: service.namespace.svc.cluster.local.
  • Ingress is a controller plus rules; without a controller, the rules do nothing.
  • Gateway API is the successor to Ingress, and the Ingress NGINX controller is no longer maintained.

In the next chapter you'll go back to Services in more detail and take the leap to the service mesh: sidecars, Envoy and Istio.

Official resources

Source and credits. Chapter written from Jesús Espinoza's study notes on KodeKloud's KCNA course (January to April 2026). Text drafted with AI assistance; original diagrams by The House of Routing. Technical details and YAML examples were checked against the official Kubernetes and CNCF documentation.

Navigate