In straits-1piti7d the API has a Service, and the client cannot reach it:
sh
kubectl exec client -n straits-1piti7d -- wget -qO- market-api:8080/healthzConnection refused. The name resolved, so DNS is fine. Check what the Service points at:
sh
kubectl describe svc market-api -n straits-1piti7dEndpoints: is <none>. Compare the Selector: line with the Pod labels:
sh
kubectl get pods -n straits-1piti7d --show-labelstext
Service selector app=market-wbe
Pod labels app=market-api
^^^ no Pod matchesFix it
kubectl set selector is not available here. Apply a manifest with the correct selector; the Service is updated in place and keeps its cluster IP:
sh
kubectl apply -n straits-1piti7d -f - <<EOF
apiVersion: v1
kind: Service
metadata:
name: market-api
spec:
selector:
app: market-api
ports:
- port: 8080
targetPort: 8080
EOFsh
kubectl describe svc market-api -n straits-1piti7d
kubectl exec client -n straits-1piti7d -- wget -qO- market-api:8080/healthzThe Endpoints: line fills in and the request returns {"status":"ok"}.