abyss-1y1kf5m runs the Monster Market: market-web, market-api, market-db, and a client Pod. A second namespace, other-1y1kf5m, has a Pod called outsider.
sh
kubectl get pods -n abyss-1y1kf5m -o wide
kubectl get svc -n abyss-1y1kf5mTest the database port from each place:
sh
kubectl exec client -n abyss-1y1kf5m -- nc -zv market-db 5432
kubectl exec outsider -n other-1y1kf5m -- nc -zv market-db.abyss-1y1kf5m 5432
kubectl exec outsider -n other-1y1kf5m -- wget -qO- market-web.abyss-1y1kf5mThen read the Pod IP of the database and connect to it directly, without the Service:
sh
kubectl get pod -l app=market-db -n abyss-1y1kf5m -o jsonpath='{.items[0].status.podIP}'