NetworkingLesson 2 of 8
- The pod network model, not reconciled
- Services, not reconciled
- EndpointSlices and kube-proxy, not reconciled
- Following a packet through the node, not reconciled
- Cluster DNS with CoreDNS, not reconciled
- Gateway API and the frozen Ingress API, not reconciled
- NetworkPolicies, not reconciled
- gRPC, service mesh and mTLS, not reconciled
Services
A Service gives a changing set of pods one stable name and virtual IP. Choose a Service type, wire ports correctly, decide where traffic may go and what source address it keeps, and recognise a Service with no endpoints.
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 8 scenes
A stable name and a virtual IP
Pods are disposable: a replacement pod gets a different name and IP, and a rollout replaces all of them. Clients need an address that outlives any pod. A ServiceAn API object that selects a set of pods by label and gives them one stable virtual IP, DNS name and set of ports. provides one.
Three things happen when you create a Service with a selector:
- The API server allocates a cluster IPA virtual address from the Service range. No interface owns it; service proxies on every node recognise it and redirect connections to it. and cluster DNS starts answering for
<service>.<namespace>.svc.cluster.local. - The EndpointSlice controller finds the pods that match the selector in the Service’s namespace and writes their addresses, ports and readiness into EndpointSlice objects. It keeps them current as pods come, go, and pass or fail readiness. EndpointSlice is the primary API; the v1 Endpoints API has been deprecated since Kubernetes 1.33.
- A service proxy on every node, kube-proxy by default, watches Services and EndpointSlices and programs kernel rules that rewrite the destination of any connection to
clusterIP:portto a ready endpoint.
Why a virtual IP rather than DNS that lists the pods? Many clients resolve a name once and keep the answer far past its TTL, so a DNS answer that changes with every rollout sends them to pods that no longer exist. A cluster IP never changes for the life of the Service; the churn moves into kernel rules, which the proxies update within seconds of a pod change.
kube-proxy programs those rules and stays out of the data path. On Linux it uses iptables by default; nftables mode, GA since 1.33, outperforms both iptables and IPVS, and IPVS mode has been deprecated since 1.35. The next lesson follows a packet through the rules. One consequence matters here: the redirect changes only the destination, so a pod reached through a cluster IP sees the calling pod’s own address.
kubectl get service web
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE web ClusterIP 10.98.108.133 <none> 80/TCP 15s
kubectl get endpointslices -l kubernetes.io/service-name=web
NAME ADDRESSTYPE PORTS ENDPOINTS AGE web-q79zt IPv4 80 10.244.3.3,10.244.2.2,10.244.1.3 15s
kubectl exec client -- curl -s web | grep Hostname
Hostname: web-6664b96dd5-dq87d
kubectl exec client -- curl -s web | grep Hostname
Hostname: web-6664b96dd5-nshlv
kubectl exec client -- curl -s web | grep Hostname
Hostname: web-6664b96dd5-pggpj
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
web-b10.244.3.3
web-c10.244.2.3
$ 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.
The proxy picks a backend per connection, not per request. A client that holds one HTTP keep-alive or gRPC connection open sends every request to the same pod, and replicas added later get nothing until clients reconnect. Spread long-lived connections in the client, or put an L7 proxy in front. If you want the same client to keep reaching the same pod across connections, set sessionAffinity: ClientIP; the default stickiness timeout is 10800 seconds.
Press Play to send requests from client to web one connection at a time. Each lands on the pod kube-proxy’s rules picked for that connection, and the stage counts the answers per pod.
kind cluster kx
Starting
Switch to Model to see the set lit by whoever acts.
$
Underneath
Types
spec.type decides who can reach the Service. The first three types build on each other; ExternalName stands apart.
- ClusterIP, the default, is reachable only from inside the cluster.
- NodePort adds a port on every node. Traffic to any node’s address on that port reaches the Service, even if no backend runs on that node. The API server picks the port from
--service-node-port-range, 30000-32767 by default. Automatic allocation prefers the upper band (30086-32767 with the default range), so if you choose a port yourself, choose it from the static band, 30000-30085, to avoid collisions. - LoadBalancer adds an external load balancer that sends traffic to the node ports. Kubernetes does not build it: a controller for your platform watches the Service, provisions a load balancer, and writes its address into
status.loadBalancer, which kubectl shows asEXTERNAL-IP. With no controller, as onkx, the address stays<pending>forever.loadBalancerClasspicks which controller handles a Service and cannot change afterwards. Implementations that send traffic straight to pod IPs can setallocateLoadBalancerNodePorts: falseto skip node ports.loadBalancerIPhas been deprecated since 1.24. - ExternalName maps the Service name to another DNS name with a CNAME record. There is no cluster IP, no proxying and no port mapping. Clients connect with the Service’s name, so HTTP servers see a
Hostheader they may not recognise, and TLS servers cannot present a certificate for it. A value that looks like an IPv4 address is treated as a DNS name and never resolves.
kubectl expose deployment web --name=web-np --type=NodePort --port=80 --target-port=http
service/web-np exposed
kubectl expose deployment web --name=web-lb --type=LoadBalancer --port=80 --target-port=http
service/web-lb exposed
kubectl expose deployment web --name=web-headless --cluster-ip=None --port=80 --target-port=http
service/web-headless exposed
kubectl create service externalname payments-api --external-name=api.example.com
service/payments-api created
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 45s payments-api ExternalName <none> api.example.com <none> 0s web ClusterIP 10.98.108.133 <none> 80/TCP 15s web-headless ClusterIP None <none> 80/TCP 0s web-lb LoadBalancer 10.102.72.24 <pending> 80:32524/TCP 0s web-np NodePort 10.108.234.254 <none> 80:32651/TCP 0s web-v2 ClusterIP 10.105.30.240 <none> 80/TCP 15s
kubectl exec client -- curl -s http://172.18.0.3:32651 | grep Hostname
Hostname: web-6664b96dd5-dq87d
web-lb got a cluster IP and a node port, but no external address: nothing on kx provisions load balancers.
Headless Services
Set clusterIP: None and the Service gets no virtual IP. kube-proxy ignores it, and cluster DNS answers its name with one A record per ready pod instead of one cluster IP. Clients pick a pod themselves.
That suits two kinds of client. StatefulSets need a headless Service for stable per-pod names such as db-0.db. Clients that balance load themselves, such as gRPC with client-side balancing or databases that discover their peers, need the full list of addresses rather than one virtual one. Created again on the lesson’s cluster and looked up from client, the web-headless and payments-api Services from above answer like this:
kubectl expose deployment web --name=web-headless --cluster-ip=None --port=80 --target-port=http
service/web-headless exposed
kubectl create service externalname payments-api --external-name=api.example.com
service/payments-api created
kubectl exec client -- nslookup web-headless
Server: 10.96.0.10 Address: 10.96.0.10#53 Name: web-headless.default.svc.cluster.local Address: 10.244.3.3 Name: web-headless.default.svc.cluster.local Address: 10.244.2.2 Name: web-headless.default.svc.cluster.local Address: 10.244.1.3
kubectl exec client -- nslookup payments-api
Server: 10.96.0.10 Address: 10.96.0.10#53 payments-api.default.svc.cluster.local canonical name = api.example.com. Name: api.example.com Address: 203.0.113.10
Ports
Each entry under spec.ports maps a Service port to a pod port:
portis what clients connect to on the cluster IP.targetPortis where the pods listen. It defaults to the value ofport, and it can be a number or the name of a container port.nodePortis the node port, for NodePort and LoadBalancer Services.protocolisTCPby default;UDPandSCTPalso work.
A named targetPort is resolved per pod, so a rollout can move the container to another port number without touching the Service, and pods with different numbers under the same name can sit behind one Service. A single-port Service may leave its port unnamed. Once a Service has two or more ports, every port needs a unique name of lowercase letters, digits and -, starting and ending with a letter or digit.
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- name: http
port: 80
targetPort: http
- name: metrics
port: 9090
targetPort: 9090
Traffic policies
Two fields restrict which endpoints a node may use, and with that, how many hops a packet takes and what source address the pod sees.
externalTrafficPolicy applies to traffic arriving from outside through a node port or load balancer.
Cluster, the default, lets every node forward to any ready endpoint in the cluster. A packet that lands on a node without a local pod takes a second hop to another node, and that node rewrites the source to its own address so the reply comes back through it. The pod sees a node address, not the client’s. Every node whose kube-proxy is healthy is a target; Kubernetes recommends that load balancers health-check kube-proxy at<node IP>:10256/healthz, which fails while the node is being deleted so that connections drain.Locallets a node forward only to endpoints on itself. There is no second hop and no source NAT, so the pod sees the real client address. A node with no local endpoint does not forward traffic for the Service at all; its health check fails, so the load balancer stops sending it any. The cost is balance: the load balancer spreads by node, so a node with one pod gets the same share as a node with five.
internalTrafficPolicy, stable since 1.26, applies to traffic from pods to the cluster IP. Local restricts it to endpoints on the client’s own node and drops it when there are none. It suits node agents run by a DaemonSet, such as a node-local cache, where the nearest copy is the only one you want.
A rolling update can leave a Local node with only terminating endpoints. Since 1.28, kube-proxy then sends traffic to those terminating endpoints instead of dropping it, so connections drain while the load balancer notices the failing health check.
Pod-to-cluster-IP traffic keeps the client’s address. Source NAT happens for node port and load balancer traffic with externalTrafficPolicy: Cluster, for hairpin traffic, when a pod reaches itself through its own Service, and for traffic leaving the cluster network.
Send one request from the dock, kubectl exec client -- curl -s web, then walk it through client’s node: the cluster IP it was sent to, the rule that drew an endpoint, the DNAT, the route to the pod, and the conntrack entry that keeps the source address the client’s own.
ExplainerA packet through the node
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-worker3 ip routedocker exec kx-worker3 iptables-save -t natdocker exec kx-worker3 iptables-save -t natdocker exec kx-worker3 iptables-save -t natdocker exec kx-worker3 ip routedocker exec kx-worker3 ip routedocker exec kx-worker3 conntrack -L -p tcp -d 10.98.108.133
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.98.108.133.The packet leaves eth0 inside the pod and comes out of veth249012b5 in kx-worker3's network namespace, addressed to 10.98.108.133:80. No interface anywhere holds that address.PREROUTING jumps to KUBE-SERVICES, where kube-proxy wrote one rule per Service port: 10.98.108.133 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.98.108.133.
Resolve web
kubectl exec client -- cat /etc/resolv.confsearch 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.98.108.133.
Leave the pod
docker exec kx-worker3 ip routedefault 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.0/24 via 172.18.0.4 dev eth0 10.244.3.2 dev veth249012b5 scope host 10.244.3.3 dev vethf2213491 scope host 172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.5
The packet leaves eth0 inside the pod and comes out of veth249012b5 in kx-worker3's network namespace, addressed to 10.98.108.133:80. No interface anywhere holds that address.
Match the cluster IP
docker exec kx-worker3 iptables-save -t nat-A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES -A KUBE-SERVICES -d 10.98.108.133/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.98.108.133 port 80 goes to KUBE-SVC-LOLE4ISW44XBNF3G.
Draw an endpoint
docker exec kx-worker3 iptables-save -t nat-A KUBE-SVC-LOLE4ISW44XBNF3G ! -s 10.244.0.0/16 -d 10.98.108.133/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.3:80" -m statistic --mode random --probability 0.33333333349 -j KUBE-SEP-MHDQ23KUGG7EGFMW -A KUBE-SVC-LOLE4ISW44XBNF3G -m comment --comment "default/web -> 10.244.2.2:80" -m statistic --mode random --probability 0.50000000000 -j KUBE-SEP-QHWUG6SOC7OJ2BZK -A KUBE-SVC-LOLE4ISW44XBNF3G -m comment --comment "default/web -> 10.244.3.3:80" -j KUBE-SEP-74RNEJOQ4CH6BCPU
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.
Rewrite the destination
docker exec kx-worker3 iptables-save -t natNo 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.
Route on this node
docker exec kx-worker3 ip routedefault 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.0/24 via 172.18.0.4 dev eth0 10.244.3.2 dev veth249012b5 scope host 10.244.3.3 dev vethf2213491 scope host 172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.5
The rewritten packet is routed by its new destination. Send a request: kube-proxy's draw happens once per connection.
Into the endpoint's pod
docker exec kx-worker3 ip routeNo lines match.The endpoint's node sends it down the pod's veth. Send a request: kube-proxy's draw happens once per connection.
The reply finds its way back
docker exec kx-worker3 conntrack -L -p tcp -d 10.98.108.133No 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.
trafficDistribution
spec.trafficDistribution, GA since 1.33, expresses a preference rather than a rule. With PreferSameZone, the EndpointSlice controller adds zone hints to each endpoint, and kube-proxy on each node uses only endpoints in its own zone when there are any. When a zone has none, its clients fall back to the whole cluster. PreferSameNode, GA since 1.35, prefers the client’s node, then its zone, then the cluster. PreferClose is a deprecated alias for PreferSameZone. Zones come from the topology.kubernetes.io/zone label on nodes.
apiVersion: v1
kind: Service
metadata:
name: checkout
spec:
selector:
app: checkout
ports:
- port: 80
targetPort: 8080
trafficDistribution: PreferSameZone
The reason to use it is money and latency: many clouds bill cross-zone traffic, and it adds a network hop. The cost is balance. Every endpoint in a zone takes all of that zone’s traffic, however many clients the zone has, so spread replicas across zones evenly, for example with topology spread constraints. A traffic policy set to Local takes precedence over trafficDistribution, and so does the service.kubernetes.io/topology-mode: Auto annotation, which balances proportionally to allocatable CPU instead.
Services without selectors
A Service with no selector gets no EndpointSlices from the controller. You write them yourself, which lets a cluster name and address a backend that is not a pod: a database outside the cluster during a migration, or servers in another network.
apiVersion: v1
kind: Service
metadata:
name: ledger
spec:
ports:
- name: https
port: 443
targetPort: 8443
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: ledger-1
labels:
kubernetes.io/service-name: ledger
endpointslice.kubernetes.io/managed-by: cluster-admins
addressType: IPv4
ports:
- name: https
protocol: TCP
port: 8443
endpoints:
- addresses:
- 192.0.2.40
conditions:
ready: true
The kubernetes.io/service-name label links the slice to the Service, and the slice name is free. endpointslice.kubernetes.io/managed-by names whoever maintains it: pick a value of your own, such as cluster-admins, never endpointslice-controller.k8s.io, which marks the control plane’s slices. Endpoint addresses cannot be loopback or link-local addresses, or other Services’ cluster IPs. kubectl port-forward to such a Service fails, because the API server only proxies to pods.
Write EndpointSlices, not Endpoints. The Endpoints API is deprecated, and so is the controller that mirrors hand-made Endpoints into slices.
spec.externalIPs, which made a Service answer on arbitrary addresses that route to nodes, has been deprecated since 1.36, with removal planned for v1.43. Kubernetes never managed those addresses, so anyone allowed to create Services could claim one. Use a load balancer controller or Gateway API.
No endpoints
A Service with no ready endpoints still has a cluster IP and a DNS name, so clients resolve it and then fail to connect. With kube-proxy, connections are rejected at once rather than timing out.
kubectl exec client -- curl -sS -m 3 web-v2
curl: (7) Failed to connect to web-v2 port 80 after 1 ms: Couldn't connect to server command terminated with exit code 7
kubectl get endpointslices -l kubernetes.io/service-name=web-v2
NAME ADDRESSTYPE PORTS ENDPOINTS AGE web-v2-p8nz6 IPv4 <unset> <unset> 15s
kubectl get service web-v2 -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR web-v2 ClusterIP 10.105.30.240 <none> 80/TCP 15s app=wbe
kubectl get pods -l app=wbe
No resources found in default namespace.
kubectl get pods --show-labels
NAME READY STATUS RESTARTS AGE LABELS client 1/1 Running 0 15s <none> web-6664b96dd5-dq87d 1/1 Running 0 15s app=web,pod-template-hash=6664b96dd5 web-6664b96dd5-nshlv 1/1 Running 0 15s app=web,pod-template-hash=6664b96dd5 web-6664b96dd5-pggpj 1/1 Running 0 15s app=web,pod-template-hash=6664b96dd5
Manifestweb-v2.yaml, the Service whose selector matches nothing
- service/web-v2
The preview runs once this page's cluster starts.$ kubectl diff -f web-v2.yamlWork through the causes in order:
- The selector matches no pods. Run the Service’s selector as a label query with
kubectl get pods -l. A typo, a label renamed in the Deployment template but not in the Service, or pods in another namespace all look like this; a Service only selects pods in its own namespace. - The pods are not ready. The slice lists them with
ready: false, andkubectl describe serviceshows no endpoints. Fix the readiness probe or what it checks. - The endpoints are fine, but the port is wrong. Connections are refused at the pod. Compare
targetPortwith the container port.
kubectl --context kind-kx create deployment hello --image=traefik/whoami:v1.12 --replicas=3 --port=80kubectl --context kind-kx expose deployment hello --port=80kubectl --context kind-kx expose deployment hello --name=hello-np --type=NodePort --port=80kubectl --context kind-kx get endpointslices -l kubernetes.io/service-name=hello -o yamlkubectl --context kind-kx run curler --image=nicolaka/netshoot:v0.16 -- sleep infinitykubectl --context kind-kx wait --for=condition=Ready pod/curler --timeout=60skubectl --context kind-kx exec curler -- curl -s http://hellokubectl --context kind-kx label pods -l app=hello app=hello-old --overwritekubectl --context kind-kx get endpointslices -l kubernetes.io/service-name=hellokubectl --context kind-kx delete deployment hellokubectl --context kind-kx delete pods -l app=hello-oldkubectl --context kind-kx delete service hello hello-npkubectl --context kind-kx delete pod curler --now
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. Relabelling the pods empties the Service's slice at once, and the Deployment's ReplicaSet creates three fresh app=hello pods, which then fill it again. The relabelled pods no longer belong to the ReplicaSet, so deleting the Deployment leaves them behind until you delete them by label.
Actual state
Check your understanding
Your first answer to each check is the one that counts. After a miss you can answer again; passing every check reconciles the lesson.
Lesson not yet reconciled
Desired: 5 objectives, 0 metReconciled: 5 of 5 objectives met
- Choose between ClusterIP, NodePort, LoadBalancer, ExternalName and headless Services for a workload. (not yet met)
- Wire
port,targetPortand named ports so that a Service reaches its pods, including Services with several ports. (not yet met) - Explain how
externalTrafficPolicyandinternalTrafficPolicychange source addresses and the number of hops. (not yet met) - Keep traffic inside a zone with
trafficDistributionset toPreferSameZone, and say what it costs. (not yet met) - Diagnose a Service with no endpoints from its EndpointSlices, selector and pod labels. (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 6. 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
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.
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.
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
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
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
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
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
The notes saidFor LoadBalancer Services the controller creates NLBs by default; annotation 'aws-load-balancer-type: external' (missing 'service.beta.kubernetes.io/' prefix; grouped)
CorrectedThe annotation key needs its prefix: service.beta.kubernetes.io/aws-load-balancer-type: external. Since AWS Load Balancer Controller v2.5, its Service mutating webhook (enableServiceMutatorWebhook, default true) sets loadBalancerClass: service.k8s.aws/nlb on new LoadBalancer Services, so the controller provisions them without the annotation. The NLB is internal by default (since v2.2.0) unless aws-load-balancer-scheme: internet-facing is set, and the default target type is instance.
Sourcekubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/service/nlb
The notes saidGateway Load Balancer is the newest load balancer type
CorrectedGateway Load Balancer launched in Nov 2020. Give the launch date instead of 'newest', which goes stale.
Sourceaws.amazon.com/about-aws/whats-new/2020/11/introducing-aws-gateway-load-balancer
The notes saidAWS Load Balancer Controller scope (Ingress and Service only)
CorrectedThe AWS Load Balancer Controller also implements Gateway API, with L7 routes on ALB and L4 routes on NLB; that support is GA in v3.0.0 (Jan 23, 2026). The most recent release as of 2026-11-19 is v3.6.3.
Sourcegithub.com/kubernetes-sigs/aws-load-balancer-controller/releases/tag/v3.0.0
The notes saidSecurity groups control traffic to load balancers
CorrectedNLBs have supported security groups since Aug 10, 2023, but only if a security group is associated when the NLB is created (AWS Load Balancer Controller v2.6.0+ does this for new Services). Cross-zone load balancing is always on for ALBs at the load-balancer level (it can be turned off per target group) and off by default for NLBs and GWLBs.
The notes said'NLB preserves the source IP address by default' is wrong for IP-type target groups with TCP/TLS
CorrectedConfirmed. Client IP preservation is enabled by default for instance targets and for IP targets using UDP, TCP_UDP or QUIC, but disabled for IP targets using TCP or TLS. For IP-mode TCP/TLS, set preserve_client_ip.enabled=true (with the controller, the aws-load-balancer-target-group-attributes annotation) or enable proxy protocol v2.
Sourcedocs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html
The notes said'Connection logs for NLB capture TLS connection details'
CorrectedConfirmed. NLBs have access logs, created only for TLS listeners. Connection logs, which record client TLS connection details including mTLS, are an ALB feature.
Every correction across the guide, by note and topic.
Sources
Checked against kubernetes.io and AWS documentation for Kubernetes 1.37 on .
- kubernetes.io/docs/concepts/services-networking/service
- kubernetes.io/docs/reference/networking/virtual-ips
- kubernetes.io/docs/concepts/services-networking/service-traffic-policy
- kubernetes.io/docs/concepts/services-networking/topology-aware-routing
- kubernetes.io/docs/concepts/services-networking/endpoint-slices
- kubernetes.io/docs/concepts/services-networking/dns-pod-service
- kubernetes.io/blog/2025/04/24/endpoints-deprecation
- docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html
- docs.aws.amazon.com/eks/latest/userguide/auto-configure-nlb.html
- kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/service/nlb
Services
↓ ↑ step, 1 to 8 scene, Esc leave