Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Illustrative terminal output
Our shop Pod says Running, yet curl gets connection refused. Look at the READY column: zero out of one. That's the first clue that Running doesn't mean reachable. This terminal output is illustrative, but the pattern is very real, and it's worth learning to read.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
shop-7d9f 0/1 Running 0 2m
$ curl http://shop-svc
curl: (7) Failed to connect to shop-svc port 80:
Connection refusedEvery link must hold
Running only tells you about the last box, the app process. A request first goes from the Client to shop-svc on port 80. The Service selects Pods into Endpoints, but only if they're Ready. Then targetPort must match 8080. Break any link, and traffic stops.
Part 3
Running means the kubelet started the container process. That's all. Ready means the readiness probe passed, so the app can actually serve requests. Picture a slow-loading app: the process is alive, the light is green, but the sign still says closed, so no traffic arrives.
Readiness gates traffic
Watch what the kubelet does. It calls /ready on the shop app, and while the app is still loading, it gets a 503. So the Pod stays out of the endpoints. The kubelet keeps asking. Once shop answers 200 OK, the Pod is marked Ready and its IP joins. If that never happens, you stay at zero of one.
The shop Pod shows Running with READY zero of one. Will shop-svc send it any requests?
The shop Pod shows Running with READY zero of one. Will shop-svc send it any requests?
- No, it stays out of the endpoints
- Yes, Running is enough for traffic
- Only some requests, at reduced rate
The shop Pod shows Running with READY zero of one. Will shop-svc send it any requests?
No, it stays out of the endpoints. A Service only routes to Pods whose readiness probe has passed. Running just means the container process started, so a Pod that is not Ready is left out of the endpoints and gets no traffic at all.
- No, it stays out of the endpoints
- Yes, Running is enough for traffic
- Only some requests, at reduced rate
deployment.yaml (Pod template)
In the Deployment's Pod template, three lines matter. The label app: shop is what the Service will look for. The containerPort says the app listens on 8080. And the readinessProbe checks /ready on 8080. Get that path or port wrong, and the Pod stays unready forever.
template:
metadata:
labels:
app: shop
spec:
containers:
- name: shop
image: shop:1.0
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /ready
port: 8080service.yaml
Now the Service side. The selector says app shop, and it has to match the Pod's labels exactly. Clients call port 80, and the Service forwards to targetPort 8080. That's what actually routes traffic. containerPort in the Deployment is mostly informational, so targetPort must match what the app listens on.
apiVersion: v1
kind: Service
metadata:
name: shop-svc
spec:
selector:
app: shop
ports:
- port: 80
targetPort: 8080Common cause 1: selector mismatch
Say someone typo'd the label. The Pod is labeled app equals web, but shop-svc looks for app equals shop. Nothing matches, so Endpoints stays empty. The Pod is Running, even Ready, yet the Service has nowhere to send traffic. Requests through shop-svc fail anyway.
Common cause 2: ports don't line up
The Service accepts traffic on port 80 and forwards it to targetPort 8080. That has to match what the app really does. If shop listens on 3000, connections fail. Same if it binds to 127.0.0.1, because traffic from outside the container gets refused. Bind to 0.0.0.0.
Diagnose in this order
Start with READY. If it's 0/1, that's readiness, so run describe pod and look at the probe failures. Then check endpoints for shop-svc. Empty means the selector doesn't match. If endpoints exist but requests fail, compare the ports.
- kubectl get pods: check READY column
- kubectl get endpoints shop-svc: empty?
- Compare labels, targetPort, listening port
Running is only the first link
Running means the process started. Traffic needs Ready, plus a Service that matches. So when an app is unreachable, don't trust STATUS. Check the READY column first, then look at the Service's endpoints. Those two checks tell you which link in the chain broke.




