POD A (APP) has connection pool pointing to POD B's ip (DATABASE) if I restart POD B its ip might change, how can I get this new ip on POD A
right now I'm just using the pod's ip
I figure it out, i didn't understand to well the concept of services in kubernetes. the ENV variables in kubernetes contains the info from the services(ports, ip, etc), so my app pod is just gonna point to the service and not to the pod's ip, so if the database pod dies or get restarted is the service task to locate this new pod's endpoint with the selector.
Yeah just define a service for your pool of pods running the same containers. You will beneficiate of the Virtual IP and the dynamic load balancing accross pods