Pod to Pod communication via service endpoints. Try Pod on same host first



I have a daemonset deployed with a service which has each endpoint configured. Right now if I made a request to this service it’ll choose any of the endpoints. I’m curious if a pod makes a request to this service, is it possible to try going to the endpoint of the pod running on the same host first?


I don’t know of a straightforward way to do it. But there might be one.

One not ideal way to do it is using in the daemon set host network or hostPort. Then, the node IP address can be exported as an env var, for example, using the downward AP in the deployment (just like configmaps, etc. there is a way to populate them with these kind of data).

I’m not sure I can think of another (as long as it is not a sidecar) :frowning:


We have a KEP for this and the PRs are in progress, but it is not done yet.