how to communicate with daemonset pod from another pod in the same node? how to communicate with daemonset pod from another pod in the same node? kubernetes kubernetes

how to communicate with daemonset pod from another pod in the same node?


There is a way of not using a service.

You can Expose Pod Information to Containers Through Environment Variables.

And you can use status.hostIP to know the ip address of node where pod is running.This was introduced in Kubernetes 1.7 link

You can add that to your pod or deployment yaml:

env:- name: HOST_IP  valueFrom:    fieldRef:      fieldPath: status.hostIP

It will set an variable HOST_IP which will have a value of node ip on which the pod is running, then you can use it to connect to a local DeamonSet.


you should define a service ( selecting all redis pods ) and then communicate with redis from other pods