Hi Mani, Subhash,
Thank you for reaching to us again!
I have investigated more on this context and thought this would help you.
As per my understanding, I think it would be better you go with headless services.
A Kubernetes headless service is a form of service that doesn’t allocate a cluster IP to represent a set of pods. Instead of load-balancing traffic across a group of pods, a headless service allows DNS queries for the service to go back to the individual IP addresses of all the pods associated with it. Headless service are useful in scenarios in which databases or other clustered applications want to discover and communicate with each other.
Unfortunately, if the pod is killed, in deployment a new pod will spin up but the pod name changes. So, we suggest you use stateful sets so that the pod name can't be changed if pod is killed. The new pod will spin up with the same name.
Headless services are usually used with StatefulSets, where every pod has a unique identity. This allows for direct conversation with particular pods. It’s also useful in scenarios requiring custom load balancing or direct communication with individual pods, such as in database clustering setups.
Additionally, I can provide you with some documents:
https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
https://stackoverflow.com/questions/52707840/what-is-a-headless-service-what-does-it-do-accomplish-and-what-are-some-legiti