NetworkingLesson 3 of 8
  1. The pod network model, not reconciled
  2. Services, not reconciled
  3. EndpointSlices and kube-proxy, not reconciled
    1. From selector to endpoints
    2. Slices scale
    3. Endpoint conditions
    4. Endpoints is deprecated
    5. kube-proxy modes
    6. The packet path
    7. Replacing kube-proxy
  4. Following a packet through the node, not reconciled
  5. Cluster DNS with CoreDNS, not reconciled
  6. Gateway API and the frozen Ingress API, not reconciled
  7. NetworkPolicies, not reconciled
  8. gRPC, service mesh and mTLS, not reconciled

EndpointSlices and kube-proxy

How a Service's selector becomes EndpointSlices, what the ready, serving and terminating conditions mean, why Endpoints is deprecated, and how kube-proxy's iptables or nftables rules turn a cluster IP into a pod.

  • 26 min
  • 4 objectives
  • 7 scenes
  • Includes an On AWS layer

Shows the lesson one block at a time. Arrow keys step, number keys jump to a scene, and Escape returns to the page where you were.

Reconcile, in 7 scenes

From selector to endpoints

A Service’s selector is a query, and something has to keep its answer current. The EndpointSlice controllerA loop in kube-controller-manager that watches Services with selectors and the pods they match, and writes the matching pods’ addresses, ports and conditions into EndpointSlice objects. does that. For every pod with an IP that matches the selector in the Service’s namespace, it writes an endpoint with:

  • addresses: the pod IP.
  • conditions: ready, serving and terminating, covered below.
  • nodeName and zone: where the pod runs, which traffic policies and trafficDistribution rely on.
  • targetRef: the pod itself.
  • hints: zone or node hints, when the Service sets trafficDistribution.

The slice carries the Service’s ports by name, with named target ports resolved to numbers for its pods. Names are how a proxy matches a slice port to a Service port, which is why a Service with two or more ports must name every one, while a single port may stay unnamed. Its labels say whose it is: kubernetes.io/service-name names the Service, and endpointslice.kubernetes.io/managed-by: endpointslice-controller.k8s.io names the controller. An owner reference ties it to the Service, so deleting the Service deletes its slices.

Pods that have no IP yet, or that have finished with Succeeded or Failed, get no endpoint. Everything else that matches is listed, ready or not, so a slice tells you which pods a Service considered and why it skipped some.

Many components read slices: kube-proxy or its replacement on every node, CoreDNS for headless Services, ingress and Gateway controllers, and service meshes. They all see the same answer.

Four pods match, three receive traffic
kubectl get pods -l app=catalog -o wide
NAME                      READY   STATUS    RESTARTS   AGE   IP           NODE         NOMINATED NODE   READINESS GATES
catalog-5ddc7b78d-dq87d   1/1     Running   0          20s   10.244.3.2   kx-worker3   <none>           <none>
catalog-5ddc7b78d-nshlv   1/1     Running   0          20s   10.244.2.2   kx-worker2   <none>           <none>
catalog-5ddc7b78d-pggpj   1/1     Running   0          20s   10.244.1.3   kx-worker    <none>           <none>
catalog-canary            0/1     Running   0          20s   10.244.3.3   kx-worker3   <none>           <none>
kubectl get endpointslices -l kubernetes.io/service-name=catalog
NAME            ADDRESSTYPE   PORTS   ENDPOINTS                                      AGE
catalog-xs4dj   IPv4          80      10.244.3.2,10.244.2.2,10.244.1.3 + 1 more...   20s
kubectl get endpointslices -l kubernetes.io/service-name=catalog -o jsonpath='{range .items[*].endpoints[*]}{.targetRef.name}{"\t"}{.addresses[0]}{"\t"}{.conditions}{"\n"}{end}'
catalog-5ddc7b78d-dq87d	10.244.3.2	{"ready":true,"serving":true,"terminating":false}
catalog-5ddc7b78d-nshlv	10.244.2.2	{"ready":true,"serving":true,"terminating":false}
catalog-5ddc7b78d-pggpj	10.244.1.3	{"ready":true,"serving":true,"terminating":false}
catalog-canary	10.244.3.3	{"ready":false,"serving":false,"terminating":false}
kubectl get pod catalog-canary -o jsonpath='{.spec.containers[0].readinessProbe.httpGet.path}'
/ready
kubectl describe pod catalog-canary | grep Unhealthy
  Warning  Unhealthy  0s (x4 over 15s)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 404

The summary table lists all four addresses, ready or not. Only the conditions show that catalog-canary gets no traffic: its readiness probe asks nginx for /ready, which nginx does not serve. A probe pointed at the wrong path looks exactly like this, except that every replica fails at once and the Service has no ready endpoints at all.

Slices scale

Before slices, every Service had one Endpoints object holding every address. That shape broke at scale for a simple reason: every kube-proxy on every node watches every Service’s endpoints. Change one pod in a 1,000-pod Service and the API server rewrote the whole object and sent all of it to each watcher, on every node. Endpoints objects were also capped at 1,000 addresses; beyond that the controller truncates the list and annotates the object with endpoints.kubernetes.io/over-capacity: truncated.

EndpointSlices, GA since Kubernetes 1.21, split the list. A slice holds at most 100 endpoints by default (kube-controller-manager’s --max-endpoints-per-slice raises that to at most 1,000), so a pod change rewrites one slice, not all of them. A Service gets more than one slice in three cases:

  • More than 100 endpoints. The controller adds slices as the list grows.
  • Different ports. Every endpoint in a slice shares the slice’s ports. During a rollout that moves a named port from 80 to 8080, the Service has one slice for each number.
  • Dual-stack. A slice holds one address family, so a dual-stack Service has an IPv4 slice and an IPv6 slice.

The controller prefers fewer writes to perfect packing. It removes and updates endpoints in place, fills the slices it already touched, and creates another slice rather than updating several partly full ones, because each write goes to every node. Partly full slices are normal, and a rolling update repacks them. Changes to different slices can also reach a watcher at different times, so one endpoint can briefly appear in two slices. A client of the API must merge every slice for a Service and remove duplicates, as kube-proxy does.

Endpoint conditions

Each endpoint carries three conditions, and they answer different questions:

  • serving, stable since 1.26, says whether the endpoint can take traffic. For a pod it is the pod’s Ready condition, which comes from its readiness probe.
  • terminating, stable since 1.26, turns true when the pod gets a deletion timestamp, usually well before its containers exit.
  • ready is shorthand for serving and not terminating. It is what proxies normally route by.

Readiness reaches the slice with a delay. The kubelet marks a container unready only after failureThreshold failed probes in a row, so with the defaults of a 10-second period and a threshold of 3, a broken pod keeps receiving connections for up to 30 seconds. A failing readiness probe never restarts anything; it only takes the pod out of rotation until the probe passes again.

Proxies ignore terminating endpoints with one exception: when every endpoint they could use is terminating, they send traffic to the endpoints that are still serving. That keeps a Service answering while its last pods drain during a rollout, instead of dropping traffic between the last outgoing pod and the first replacement.

A deleted pod stays in the slice while it terminates
kubectl delete pod queue-58fcc98859-m59zh --wait=false
pod "queue-58fcc98859-m59zh" deleted from default namespace
kubectl get endpointslices -l kubernetes.io/service-name=queue -o jsonpath='{range .items[*].endpoints[*]}{.targetRef.name}{"\t"}{.conditions}{"\n"}{end}'
queue-58fcc98859-m59zh	{"ready":false,"serving":true,"terminating":true}
queue-58fcc98859-nd5rg	{"ready":true,"serving":true,"terminating":false}
queue-58fcc98859-qcw8n	{"ready":true,"serving":true,"terminating":false}
kubectl get endpointslices -l kubernetes.io/service-name=queue -o jsonpath='{range .items[*].endpoints[*]}{.targetRef.name}{"\t"}{.conditions}{"\n"}{end}'
queue-58fcc98859-m59zh	{"ready":false,"serving":true,"terminating":true}
queue-58fcc98859-nd5rg	{"ready":true,"serving":true,"terminating":false}
queue-58fcc98859-qcw8n	{"ready":true,"serving":true,"terminating":false}

Two seconds after the delete, the old pod is still in the slice as serving and terminating, and a replacement has joined. Once its 90-second grace period ends, it is gone.

A Service can opt out of readiness entirely. With publishNotReadyAddresses: true, ready is always true, so DNS and proxies include pods before they pass readiness. Databases that must find their peers in order to become ready use it on their headless Service:

apiVersion: v1
kind: Service
metadata:
  name: db-peers
spec:
  clusterIP: None
  publishNotReadyAddresses: true
  selector:
    app: db
  ports:
    - name: gossip
      port: 7000

Endpoints is deprecated

The v1 Endpoints API has been deprecated since Kubernetes 1.33, and the API server warns on every read or write. Service proxies, Gateway API implementations and DNS servers had already moved to EndpointSlices, because dual-stack Services and traffic distribution exist only there. The Endpoints type will probably never be removed outright, but the plan is to stop requiring conformant clusters to run the Endpoints controller, so nothing should depend on it.

The same Service through the deprecated API
kubectl get endpoints catalog
Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice
NAME      ENDPOINTS                                   AGE
catalog   10.244.3.2:80,10.244.2.2:80,10.244.1.3:80   20s

Migration has two sides:

  • Reading. A Service has exactly one Endpoints object with its own name, but any number of slices with unpredictable names. Code and scripts list slices by the kubernetes.io/service-name label, merge them, and remove duplicates.
  • Writing. For a Service without a selector, create EndpointSlices yourself, labelled with the Service name, as the Services lesson shows. The control plane still mirrors hand-written Endpoints into slices, but that mirroring is deprecated along with the API.

kube-proxy modes

kube-proxyA node agent, usually a host-network DaemonSet, that watches Services and EndpointSlices and programs the node’s kernel so connections to Service addresses reach endpoints. does not proxy anything. It writes kernel rules and the kernel redirects packets. Its userspace mode, which did relay traffic, was removed in Kubernetes 1.26. On Linux it has three modes:

  • iptables is the default in Kubernetes 1.37. kube-proxy creates a chain per Service with a rule per endpoint that jumps at random, and per-endpoint chains that DNAT to the pod. Rule count grows with the number of Services and endpoints, and the first packet of each connection walks the Service rules in order. Since 1.28 kube-proxy updates only the rules that changed, and it waits at least minSyncPeriod, one second by default, between syncs so that bursts of changes land in one update.
  • nftables, GA since 1.33 and requiring kernel 5.13 or later, is the successor. It uses nftables maps for lookups, so matching stays cheap as Services grow, and it applies endpoint changes faster than iptables mode. It behaves differently in a few places: node ports listen only on the node’s primary addresses by default (--nodeport-addresses primary), it adds no firewall-compatibility rules for node ports, and it installs no workaround for a conntrack bug in Linux kernels before 6.1. Node ports on localhost are alpha in 1.37 behind the KubeProxyNFTablesLocalhostNodePorts feature gate.
  • ipvs has been deprecated since 1.35, and kube-proxy 1.37 logs a deprecation warning when it starts in that mode. It used the kernel’s IPVS load balancer, which had the performance its designers wanted but never fitted every edge case of the Services API. The 1.37 documentation schedules it to be disabled by default in 1.40 and removed in 1.43; a SIG Network post of 2026-11-16 brings removal forward to 1.40. Either way, move to nftables, or to iptables on kernels too old for nftables.

The random choice in iptables mode is a chain of probabilities. For a Service with three ready endpoints, the Service’s chain has three rules: the first jumps to endpoint one with probability 1/3, the second jumps to endpoint two with probability 1/2 of the remaining traffic, and the third catches everything left. Each endpoint gets a third of the connections. With sessionAffinity: ClientIP, an extra rule remembers which endpoint each client address last used and sends it there again until the timeout.

Press Play to send connections through those three rules on a cluster with one Service and three pods, and watch the counts per pod even out as the draws add up.

kind cluster kx

Starting

Starting the cluster…

$

    Six requests from the client pod to service/web, and the rules that spread them. Press Play: the scene runs its commands on this page's cluster, and the dock's terminal shows each one.

    On Windows the only mode is kernelspace. If you leave mode empty, kube-proxy uses the platform default, and a future release will make that default nftables, so set the mode explicitly to keep an upgrade from changing it. kind sets it with networking.kubeProxyMode: iptables (the default), nftables, ipvs or none.

    The packet path

    Follow one request from client to the web Service:

    1. Resolve. client asks cluster DNS for web and gets the cluster IP 10.111.74.185.
    2. Send. It opens a TCP connection to 10.111.74.185:80. No interface anywhere has that address. The packet leaves the pod’s eth0 and enters the node through the veth.
    3. Translate. In netfilter’s PREROUTING hook, kube-proxy’s rules match the destination address, protocol and port, pick a ready endpoint at random, and rewrite the destination to it, say 10.244.2.5:80. That is destination NAT; the source stays 10.244.2.3.
    4. Remember. conntrack records the translation. Later packets of the same connection skip the rule walk and get the same rewrite, which is why a connection stays on one backend.
    5. Deliver. From here the packet is an ordinary pod-to-pod packet and crosses the pod network as in the first lesson of this track.
    6. Reply. The backend answers 10.244.2.3. conntrack recognises the flow and rewrites the reply’s source back to 10.111.74.185:80, so the client sees an answer from the address it called.
    Through the cluster IP, the source address survives
    kubectl get service web
    NAME   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
    web    ClusterIP   10.111.74.185   <none>        80/TCP    20s
    kubectl get pod client -o wide
    NAME     READY   STATUS    RESTARTS   AGE   IP           NODE         NOMINATED NODE   READINESS GATES
    client   1/1     Running   0          20s   10.244.2.3   kx-worker2   <none>           <none>
    kubectl exec client -- curl -s web | grep -e Hostname -e RemoteAddr
    Hostname: web-8677756b99-7vfml
    RemoteAddr: 10.244.2.3:40050
    kubectl -n kube-system get configmap kube-proxy -o yaml | grep mode
        mode: iptables

    ExplainerService routing

    Podclient10.244.1.2

    Serviceweb

    clusterIP
    10.102.158.59
    port
    80, targetPort 8080

    The value pods need on their app label to be selected.

    EndpointSliceweb-jlc26

    • 10.244.3.2:8080web-aready trueserving trueterminating false
    • 10.244.3.3:8080web-bready trueserving trueterminating false
    • 10.244.2.3:8080web-cready trueserving trueterminating false

    kube-proxy3 ready endpoints, each taking 1/3 of new connections.

    • web-a10.244.3.2

      Readykx-worker3

    • web-b10.244.3.3

      Readykx-worker3

    • web-c10.244.2.3

      Readykx-worker2

    $ kubectl exec client -- curl -s web
    Send a request to see the reply.
    

    The selector app=web matches 3 pods; 3 are ready. Send a request to see where kube-proxy routes it.

    Change a pod's readiness or labels, or the Service's selector, and send a request. Only ready pods the selector matches are in the EndpointSlice, and kube-proxy picks among them.

    The packet walk follows the same six steps on this lesson’s cluster, with the real rules from client’s node at each one. Send a request first, kubectl exec client -- curl -s web, and the walk picks it up from conntrack: which endpoint the draw chose, the DNAT, and the reply’s way back.

    ExplainerA packet through the node

    client to Service web3 ready endpoints; send a request to draw one

    kubectl exec client -- curl -s -m 2 -o /dev/null -w '%{http_code}\n' http://web

    Resolve webLeave the podMatch the cluster IPDraw an endpointRewrite the destinationRoute on this nodeInto the endpoint's podThe reply finds its way back

    kubectl exec client -- cat /etc/resolv.confdocker exec kx-worker2 ip routedocker exec kx-worker2 iptables-save -t natdocker exec kx-worker2 iptables-save -t natdocker exec kx-worker2 iptables-save -t natdocker exec kx-worker2 ip routedocker exec kx-worker2 ip routedocker exec kx-worker2 conntrack -L -p tcp -d 10.111.74.185

    search default.svc.cluster.local svc.cluster.local cluster.local
    nameserver 10.96.0.10
    options ndots:5
    

    curl in client asks the nameserver in its resolv.conf for web. The search list makes it web.default.svc.cluster.local, and CoreDNS answers with the Service's cluster IP, 10.111.74.185.The packet leaves eth0 inside the pod and comes out of vethaa891131 in kx-worker2's network namespace, addressed to 10.111.74.185:80. No interface anywhere holds that address.PREROUTING jumps to KUBE-SERVICES, where kube-proxy wrote one rule per Service port: 10.111.74.185 port 80 goes to KUBE-SVC-LOLE4ISW44XBNF3G.KUBE-SVC-LOLE4ISW44XBNF3G holds one rule per ready endpoint, 3 of them. Each rule but the last matches with probability 1/(remaining), so every endpoint is equally likely. Send a request: kube-proxy's draw happens once per connection.The winning rule jumps to the endpoint's KUBE-SEP chain, whose DNAT rewrites the destination to the pod's IP and port. Send a request: kube-proxy's draw happens once per connection.The rewritten packet is routed by its new destination. Send a request: kube-proxy's draw happens once per connection.The endpoint's node sends it down the pod's veth. Send a request: kube-proxy's draw happens once per connection.conntrack keeps one entry per connection, with the original destination and the reply's source. Send a request: kube-proxy's draw happens once per connection.

    Step 1 of 8: Resolve web. curl in client asks the nameserver in its resolv.conf for web. The search list makes it web.default.svc.cluster.local, and CoreDNS answers with the Service's cluster IP, 10.111.74.185.

    1. Resolve web

      kubectl exec client -- cat /etc/resolv.conf

      search default.svc.cluster.local svc.cluster.local cluster.local
      nameserver 10.96.0.10
      options ndots:5
      

      curl in client asks the nameserver in its resolv.conf for web. The search list makes it web.default.svc.cluster.local, and CoreDNS answers with the Service's cluster IP, 10.111.74.185.

    2. Leave the pod

      docker exec kx-worker2 ip route

      default via 172.18.0.1 dev eth0 
      10.244.0.0/24 via 172.18.0.2 dev eth0 
      10.244.1.0/24 via 172.18.0.3 dev eth0 
      10.244.2.2 dev veth3251d026 scope host 
      10.244.2.3 dev vethaa891131 scope host 
      10.244.2.4 dev vetheba261a4 scope host 
      10.244.2.5 dev vethb62007d9 scope host 
      10.244.3.0/24 via 172.18.0.5 dev eth0 
      172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.4 
      

      The packet leaves eth0 inside the pod and comes out of vethaa891131 in kx-worker2's network namespace, addressed to 10.111.74.185:80. No interface anywhere holds that address.

    3. Match the cluster IP

      docker exec kx-worker2 iptables-save -t nat

      -A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
      -A KUBE-SERVICES -d 10.111.74.185/32 -p tcp -m comment --comment "default/web cluster IP" -m tcp --dport 80 -j KUBE-SVC-LOLE4ISW44XBNF3G
      

      PREROUTING jumps to KUBE-SERVICES, where kube-proxy wrote one rule per Service port: 10.111.74.185 port 80 goes to KUBE-SVC-LOLE4ISW44XBNF3G.

    4. Draw an endpoint

      docker exec kx-worker2 iptables-save -t nat

      -A KUBE-SVC-LOLE4ISW44XBNF3G ! -s 10.244.0.0/16 -d 10.111.74.185/32 -p tcp -m comment --comment "default/web cluster IP" -m tcp --dport 80 -j KUBE-MARK-MASQ
      -A KUBE-SVC-LOLE4ISW44XBNF3G -m comment --comment "default/web -> 10.244.1.5:80" -m statistic --mode random --probability 0.33333333349 -j KUBE-SEP-3BXOQLMOWG4452TJ
      -A KUBE-SVC-LOLE4ISW44XBNF3G -m comment --comment "default/web -> 10.244.2.5:80" -m statistic --mode random --probability 0.50000000000 -j KUBE-SEP-ZA2JI7K7LSQNKDOS
      -A KUBE-SVC-LOLE4ISW44XBNF3G -m comment --comment "default/web -> 10.244.3.5:80" -j KUBE-SEP-EIIOLXL5XON5PVXA
      

      KUBE-SVC-LOLE4ISW44XBNF3G holds one rule per ready endpoint, 3 of them. Each rule but the last matches with probability 1/(remaining), so every endpoint is equally likely. Send a request: kube-proxy's draw happens once per connection.

    5. Rewrite the destination

      docker exec kx-worker2 iptables-save -t nat

      No lines match.

      The winning rule jumps to the endpoint's KUBE-SEP chain, whose DNAT rewrites the destination to the pod's IP and port. Send a request: kube-proxy's draw happens once per connection.

    6. Route on this node

      docker exec kx-worker2 ip route

      default via 172.18.0.1 dev eth0 
      10.244.0.0/24 via 172.18.0.2 dev eth0 
      10.244.1.0/24 via 172.18.0.3 dev eth0 
      10.244.2.2 dev veth3251d026 scope host 
      10.244.2.3 dev vethaa891131 scope host 
      10.244.2.4 dev vetheba261a4 scope host 
      10.244.2.5 dev vethb62007d9 scope host 
      10.244.3.0/24 via 172.18.0.5 dev eth0 
      172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.4 
      

      The rewritten packet is routed by its new destination. Send a request: kube-proxy's draw happens once per connection.

    7. Into the endpoint's pod

      docker exec kx-worker2 ip route

      No lines match.

      The endpoint's node sends it down the pod's veth. Send a request: kube-proxy's draw happens once per connection.

    8. The reply finds its way back

      docker exec kx-worker2 conntrack -L -p tcp -d 10.111.74.185

      No lines match.

      conntrack keeps one entry per connection, with the original destination and the reply's source. Send a request: kube-proxy's draw happens once per connection.

    Send a request from a pod to the Service, then step through what the node does with it: the cluster IP rule, kube-proxy's random draw between endpoints, the DNAT, the route to the endpoint's node and conntrack's rewrite of the reply. Each step shows the real lines from iptables-save, ip route and conntrack.

    Source NAT enters only where the reply would otherwise go astray. kube-proxy marks such packets and masquerades them on the way out: traffic from outside through a node port or load balancer with externalTrafficPolicy: Cluster, which may hop to another node; hairpin traffic, where a pod reaches itself through its own Service; and traffic to a cluster IP from outside the pod network. A load balancer that targets pod IPs directly skips the node port and its hop, which is why such implementations can set allocateLoadBalancerNodePorts: false.

    Three consequences of this design show up in practice:

    • ping to a cluster IP fails. The rules match only the Service’s protocol and ports, and no interface owns the address to answer ICMP. Test Services with a real connection.
    • conntrack can fill up. Every connection through a Service takes a conntrack entry. A busy node logs table full, dropping packet from nf_conntrack and drops further connections until entries expire.
    • Endpoint changes affect only later connections. An open connection keeps its translation until it ends. kube-proxy clears conntrack entries for UDP endpoints that go away, so a DNS client does not keep sending to a deleted CoreDNS pod.

    Replacing kube-proxy

    kube-proxy is optional. Its job is to turn Services and EndpointSlices into data-plane state, and a network plugin can do the same job another way. Cilium’s kube-proxy replacement and Calico’s eBPF data plane load eBPF programs that look up Service backends in eBPF maps. For pod traffic they can translate the address once, when the application calls connect(), instead of rewriting packets, which saves per-packet work and conntrack entries. They also add features that netfilter rules lack, such as direct server return for node ports.

    Running without kube-proxy means creating the cluster without it, for example with kind’s kubeProxyMode: none, and giving the plugin the API server’s real address, because the kubernetes Service cannot be reached until something implements Services. The trade-off is coupling: Service routing belongs to the plugin, and debugging moves from iptables-save or nft list ruleset to the plugin’s own tools. Check who maintains a plugin before you hand it this job; Weave Net, for example, was archived on 2024-06-20 after Weaveworks shut down.

    Whatever implements Services, the inputs are the same Services and EndpointSlices, so everything in this lesson about slices and conditions still applies.

    Look at slices and rules on your cluster

    1. kubectl --context kind-kx create deployment hello --image=traefik/whoami:v1.12 --replicas=3 --port=80
    2. kubectl --context kind-kx expose deployment hello --port=80
    3. kubectl --context kind-kx rollout status deployment hello
    4. kubectl --context kind-kx get endpointslices -l kubernetes.io/service-name=hello -o yaml
    5. kubectl --context kind-kx get endpoints hello
    6. kubectl --context kind-kx -n kube-system get configmap kube-proxy -o yaml
    7. docker exec kx-worker sh -c 'iptables-save -t nat | grep default/hello'
    8. docker exec kx-worker conntrack -L
    9. kubectl --context kind-kx delete deployment hello
    10. kubectl --context kind-kx delete service hello

    For your own kind cluster kx: copy a command and paste it into your terminal. Run in the simulator runs the same command in this page's simulated cluster instead; nothing on this page touches your machine. The KUBE-SVC chain for default/hello jumps to one KUBE-SEP chain per endpoint with a random probability, and each KUBE-SEP chain DNATs to one pod address.

    Actual state

    Check your understanding

    5 checks

    Your first answer to each check is the one that counts. After a miss you can answer again; passing every check reconciles the lesson.

    1. Check 1 of 5

      A pod behind a Service has been deleted and is inside its grace period. Its endpoint shows serving: true. What do ready and terminating show?

    2. Check 2 of 5

      Check runs your command on a private cluster; what it prints shows here.

    3. Check 3 of 5

      Why did Kubernetes replace one Endpoints object per Service with several EndpointSlices?

    4. Check 4 of 5

      A cluster runs kube-proxy in IPVS mode for performance. What does Kubernetes recommend?

    5. Check 5 of 5

      Pod 10.244.1.2 connects to cluster IP 10.99.70.249:80, and kube-proxy in iptables mode picks the endpoint 10.244.3.3:80. What does the backend see as the source, and what rewrites the reply?

    Lesson not yet reconciled

    Desired: 4 objectives, 0 metReconciled: 4 of 4 objectives met

    • Read an EndpointSlice and explain what its ready, serving and terminating conditions mean for traffic. (not yet met)
    • Explain why v1 Endpoints is deprecated in Kubernetes 1.33 and what replaces it for reading and for writing. (not yet met)
    • Compare kube-proxy's iptables and nftables modes, and say why IPVS mode is deprecated. (not yet met)
    • Follow a packet to a cluster IP through destination NAT and conntrack to a pod, and back. (not yet met)

    Pass every check above to reconcile this lesson.

    Every check has passed, so the desired state is met. First-try accuracy: 0 of 5. This lesson's review cards are in your queue.

    Practice

    Put this lesson to work on the simulated cluster. Everything runs in your browser, with nothing to install.

    Changed since the notes

    This lesson draws on an earlier set of study notes. Where the documentation contradicts a claim in them, qualifies it or has moved past it, the claim is listed here with the corrected statement and the source it was checked against.

    Show 13 corrections
    1. Stale, true once, no longerKubernetes Networking

      The notes saidWeave Net creates a mesh overlay network

      CorrectedWeaveworks shut down in February 2024 and archived weaveworks/weave on 2024-06-20. Only community forks remain.

      Sourcegithub.com/weaveworks/weave

    2. Stale, true once, no longerKubernetes Networking

      The notes saidThe Endpoints object (or EndpointSlice in newer clusters)

      CorrectedEndpointSlice has been GA since v1.21 and is the primary API. v1 Endpoints is deprecated since v1.33.

      Sourcekubernetes.io/blog/2025/04/24/endpoints-deprecation

    3. Stale, true once, no longerKubernetes Networking

      The notes saidIPVS mode handles large numbers of services more efficiently

      CorrectedIPVS is deprecated since v1.35. nftables (GA in v1.33) is the recommended scalable mode.

      Sourcekubernetes.io/docs/reference/networking/virtual-ips

    4. Stale, true once, no longerKubernetes Networking

      The notes saidVPC CNI doesn't enforce Network Policies; deploy Calico (three entries incl. self-contradiction)

      CorrectedThe VPC CNI has enforced NetworkPolicy natively since v1.14 (August 2023), enabled with the enableNetworkPolicy add-on setting through an eBPF node agent. Current docs require v1.21+ for both standard and admin network policies.

      Sourceaws.amazon.com/about-aws/whats-new/2023/08/amazon-vpc-cni-kubernetes-networkpolicy-enforcement

    5. Wrong, not trueKubernetes Networking

      The notes saidThe source IP pods see is often the node's IP due to SNAT

      CorrectedPod-to-ClusterIP traffic is redirected without rewriting the client IP. SNAT applies to NodePort and LoadBalancer traffic with externalTrafficPolicy: Cluster, to hairpin traffic, and to egress leaving the VPC.

      Sourcekubernetes.io/docs/reference/networking/virtual-ips

    6. Nuance, true with conditionsKubernetes Networking

      The notes saidkube-proxy intercepts the connection and redirects it

      CorrectedKernel iptables, nftables or IPVS rules do the redirecting, and kube-proxy only programs them. Userspace mode was removed in v1.26.

      Sourcekubernetes.io/docs/reference/networking/virtual-ips

    7. Stale, true once, no longerKubernetes Services

      The notes saidThe Endpoints object (or EndpointSlice in newer clusters) … the Endpoints controller

      CorrectedThe EndpointSlice API and controller are primary. v1 Endpoints has been deprecated since v1.33.

      Sourcekubernetes.io/blog/2025/04/24/endpoints-deprecation

    8. Stale, true once, no longerKubernetes Services

      The notes saidIPVS performs better at scale than iptables

      CorrectedIPVS is deprecated since v1.35. nftables mode outperforms both iptables and IPVS and is the recommended replacement.

      Sourcekubernetes.io/docs/reference/networking/virtual-ips

    9. Nuance, true with conditionsKubernetes Services

      The notes saidIn EKS with the AWS Load Balancer Controller, a LoadBalancer Service creates an NLB by default

      CorrectedOnly new Services get an NLB by default, through the LBC v2.5+ mutating webhook (on by default), which sets loadBalancerClass service.k8s.aws/nlb. The scheme defaults to internal. The legacy cloud provider creates Classic Load Balancers.

      Sourcedocs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html

    10. Wrong, not trueKubernetes Services

      The notes saidIn EKS, annotations control whether you get an NLB or ALB

      CorrectedA LoadBalancer Service never produces an ALB. ALBs come from Ingress or Gateway API through the LBC or EKS Auto Mode.

      Sourcedocs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html

    11. Stale, true once, no longerKubernetes Services

      The notes saidSelector-less Services are wired by manually managing the Endpoints object

      CorrectedCreate EndpointSlices labelled kubernetes.io/service-name=<service>. The Endpoints API is deprecated and its mirroring is deprecated too.

      Sourcekubernetes.io/docs/concepts/services-networking/service

    12. Wrong, not trueKubernetes Services

      The notes saidEach port gets a name

      CorrectedPort names are required only when a Service has more than one port.

      Sourcekubernetes.io/docs/concepts/services-networking/service

    13. Nuance, true with conditionsKubernetes Services

      The notes saidLoadBalancer traffic always flows LB -> NodePort -> pod

      CorrectedWith IP targets (LBC or EKS Auto Mode) the load balancer sends traffic straight to Pod IPs. Setting allocateLoadBalancerNodePorts: false skips NodePort allocation for such implementations.

      Sourcekubernetes.io/docs/concepts/services-networking/service

    Every correction across the guide, by note and topic.

    Sources

    Checked against kubernetes.io and AWS documentation for Kubernetes 1.37 on .

    1. kubernetes.io/docs/concepts/services-networking/endpoint-slices
    2. kubernetes.io/blog/2025/04/24/endpoints-deprecation
    3. kubernetes.io/docs/reference/networking/virtual-ips
    4. kubernetes.io/docs/concepts/services-networking/service
    5. kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle
    6. kubernetes.io/blog/2026/08/26/kubernetes-v1-37-release
    7. kubernetes.io/blog/2026/11/16/ipvs-removal
    8. kind.sigs.k8s.io/docs/user/configuration
    9. docs.aws.amazon.com/eks/latest/best-practices/nftables.html
    10. docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html
    11. docs.aws.amazon.com/eks/latest/userguide/cni-network-policy-configure.html

    EndpointSlices and kube-proxy

    ↓ ↑ step, 1 to 7 scene, Esc leave

    kind cluster kxLast command: Nothing run yet