I am using AKS.the DNS policy is not set explicitly,which should be clusterFirst.today I had a strange log inside pod during its starting,showing localhost pointed to the IP of node instead of 127.0.0.1. who can tell me how does localhost work inside pod?
Asked
Active
Viewed 645 times
0
-
1In the container, can you check what's inside /etc/hosts? If your container supports it, what's the output of `nslookup localhost`. – gohm'c Dec 10 '21 at 02:14
-
Is it running with `hostNetwork`? – zerkms Dec 10 '21 at 03:32
-
no,it is a cluster network.with azure cni plugin – focus zheng Dec 10 '21 at 07:36
1 Answers
-1
Can you share the log and yaml file?
We can access Node IP with this:
containers:
- env:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP

Hamid Ostadvali
- 192
- 1
- 7
-
Hi Osta,I did not config environment variables in the pod.what I saw is the localhost:port was resolved to ip of node:port in the pod logs. – focus zheng Dec 10 '21 at 02:09