"The Service exists, but traffic never reaches the pods, and Endpoints is empty" — the most common beginner bug in Kubernetes. And the cause is almost always the same one.
Part seven of the series is the chapter where, instead of copy-pasting YAML, you finally understand HOW Kubernetes objects connect to each other. We write three minimal manifests for myapp — Namespace, Deployment, Service — and unpack what you really need to internalize: labels and selectors are the glue that binds Deployment and Service together. No hard references like "Service, here are the IDs of these pods" — it's all held together by matching labels.
The key rule everyone trips on: a Deployment's spec.selector.matchLabels MUST match its spec.template.metadata.labels. And the big trap — the Service selector doesn't match the pod labels (a typo, or you forgot to update it): the Service just hangs, and kubectl describe svc shows Endpoints: <none>. The service seems to exist, but traffic goes nowhere. You can verify it instantly.
Plus: how ClusterIP differs from a pod's direct address, the difference between port and targetPort (80 vs 8080), declarative kubectl apply vs imperative create, and where to keep your manifests (spoiler: in Git next to the code, in a k8s/ folder). https://dorokhovich.com/blog/local-k8s-kubernetes-manifests?utm_source=devto&utm_medium=syndication&utm_campaign=local-k8s-kubernetes-manifests
Top comments (0)