I have a keydb service with a cluster IP on a namespace
Next to this i have a pod who need to connnect to this keydb and parse data,
How can my pod can know cluster ip of my keydb service ?
Thanks for your help,
If you create a service, there are 3 ways to access the service. Through cluster ip, node port and service load balancer. Anytime you configure kubernetes service, the service will have an IP address, however the IP address assigned is dynamic and it could possibly change, so it is not a good idea to connect your pods that is need to access your service, because once the ip address has change your connection form pod to service will no longer work.
What dns do inside your kubernetes pod network is it provides a dns service that can be used by pods within the network, it also configures containers to use that dns service. You can access services using the dns name assigned to them.
For more information, you can review the DNS for Services and Pods