In k8s, I want my server to listen on podIP rather than 127.0.0.1 or 0.0.0.0. But the podIP is dynamically allocated, so I want to do something like:
ip := getIPFromNic("eth0")
net.Listen(ip)
But I don't know how to ensure the nic in pod is called eth0 rather than en0 or others. Should I do something in Dockerfile or should I do something in deployment.yaml?
I tried to search on google, but didn't find any related resources about the nic in docker. Most of the blogs are talking about the veth and docker bridge