Two namespaces:
text
straits-1sobp6o Deployment market-api + Service market-api (8080)
straits-1sobp6o-ops Deployment ops-dashboard (nginx) + Pod client (busybox)Short name from the wrong namespace
sh
kubectl exec client -n straits-1sobp6o-ops -- nslookup market-apiRead the error. The name was searched in straits-1sobp6o-ops and not found. The second objective asks for the error word.
Full name
sh
kubectl exec client -n straits-1sobp6o-ops -- nslookup market-api.straits-1sobp6o.svc.cluster.local
kubectl exec client -n straits-1sobp6o-ops -- wget -qO- market-api.straits-1sobp6o.svc.cluster.local:8080/healthzThe first objective asks for the suffix that turned the short name into something CoreDNS could find.
Expose the dashboard in its own namespace
ops-dashboard has no Service yet. Give it one on port 80 in straits-1sobp6o-ops:
sh
kubectl expose deployment ops-dashboard --port=80 -n straits-1sobp6o-ops
kubectl exec client -n straits-1sobp6o-ops -- wget -qO- ops-dashboardSame namespace, so the short name resolves.