How to access a service from another pod in same namespace without using namespace name in URL?
Can't use this as it is using namespace name in url.
<service-name>.<namespace>.svc.cluster.local
Reason: namespace names are dynamic in my setup and not in my control.
You can just directly use the other Service name as a host name if you know it's in the same namespace as your Pod.
http://<service-name>/path
DNS for Services and Pods documents that both svc.cluster.local
and <namespace>.svc.cluster.local
are added to the default DNS search path (in the container's /etc/resolv.conf
file), which makes this work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With