We have Kubernetes cluster where each service has 3 pod running. we got a use case where i want each pod knows the ip of other pods.
For Example:
P1 --> this pod should know ip of itself, p2, p3 pod ip's
P2 --> this pod should know ip of itself, p1, p3 pod ip's
p3 --> this pod should know ip of itself, p2, p3 pod ip's
I found this on google but looks like we only get IP of pod itself it won't give the ip of other two pod running.
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
Is there a way i can get this info in my java code?