DevOps

Visualizing Kubernetes: pods, services, ingress and gateways

The hardest part of Kubernetes is not the YAML; it is holding the mental model of how a request actually reaches a container. A diagram of the networking objects makes it click. Here is how to draw the one that matters.

People do not struggle with Kubernetes because the YAML is hard to type. They struggle because there is an invisible chain of objects between "a request arrives" and "a container handles it," and none of it is in one place. A Pod runs the code, but you never point traffic at a Pod. A Service gives it a stable name, but a Service does not terminate TLS. An Ingress or a Gateway handles the outside world, but it forwards to a Service, which selects Pods, which can move at any moment. Miss one link and nothing works, and the error message rarely tells you which link.

A diagram of that chain is worth more than any amount of re-reading the manifests. Let us build the mental model object by object, then draw it.

Pods: where the code actually runs

A Pod is one or more containers scheduled together, sharing a network identity. It is the unit that runs your process. The crucial fact for a diagram: Pods are cattle, not pets. They are created and destroyed constantly, their IPs change, and you should never depend on a specific one. That is exactly why everything above them exists: to give something stable to point at.

Services: a stable name in front of moving Pods

A Service is a stable virtual address and a load-balancing rule. It uses a label selector to find the Pods that back it, and it spreads traffic across whichever ones currently exist. When a Pod dies and a new one starts, the Service quietly updates; callers never notice. In your diagram, the Service is the box that other things connect to, with an implied fan-out to a shifting set of Pods behind it.

outside client Ingress /Gateway Service Pod Pod Pod
The request chain: client to Ingress or Gateway, to a Service, fanning out to whichever Pods currently exist.

Ingress and Gateway: the door to the outside

A Service alone does not expose you to the world in a useful way. That is the job of an Ingress or, in the newer model, a Gateway. This layer handles host and path routing, TLS termination and the rules that say "requests for this host and path go to that Service." The Gateway API generalises the older Ingress with a cleaner split of responsibilities (who owns the gateway versus who owns the routes), but the shape in a diagram is the same: it is the edge box that everything external hits first, forwarding to Services by rule.

Draw the chain once and the errors start explaining themselves: a broken selector, a missing route, a Service pointing at nothing.

Why drawing it beats re-reading it

When something is unreachable, the diagram is a checklist. Does the Ingress rule point at the right Service? Does the Service's selector match the Pods' labels? Are there Pods at all? Each link in the picture is a thing that can be wrong, and seeing them laid out turns a vague "it is not working" into a specific "the selector does not match." That is the difference between debugging and guessing.

Let the manifests draw it

You do not have to place these boxes by hand. Your manifests already encode the whole chain: the Ingress names its Service, the Service carries its selector, the Deployment stamps the labels on its Pods. Paste the YAML and the relationships are drawn for you, grouped by namespace, so the picture matches the cluster instead of your assumptions about it.

Tip. Generate the diagram from the same manifests you apply, and regenerate after a change. A picture that comes from the source of truth is the only one that stays trustworthy in a system that reschedules itself constantly.

Then annotate for humans

Once the objects are on the canvas, make the picture teach. Colour the external edge, group by namespace, mark where TLS terminates, and note which Service is the one under load. A new engineer should be able to trace a request from the internet to a container with a finger, without opening a single YAML file. That is the diagram worth keeping.

Paste your manifests, see the pods, services, ingress and gateways connect, and finally hold the whole request path in your head at once.

See how your cluster actually connects

Paste your Kubernetes manifests and get a diagram of the request path, grouped by namespace and ready to annotate.

Open LetDraw, free