This question has been asked and answered before on stackoverflow but because I'm new to K8, I don't understand the answer.
Assuming I have two containers with each container in a separate POD (because I believe this is the recommend approach), I think I need to create a single service for my two pods to be apart of.
- How does my java application code get the IP address of the service?
- How does my java application code get the IP addresses of another POD/container (from the service)?
- This will be a list of IP address because these are stateless and they might be replicated. Is this correct?
- How do I select the least busy instance of the POD to communicate with?
Thanks
Siegfried
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…