11/17/2022, 4:51 PM
Hello all, I have setup a k3s cluster on AWS EC2 instances (one master + 2 worker nodes). I am trying to deploy a pod on one of the worker nodes, in this pod a docker image is pulled and this docker image internally is running some scripts to fetch package from the internet. But I am seeing an issue with DNS resolution in this pod
wget: unable to resolve host address
however upon logging onto that pod and trying to ping, the packets are being transmitted successfully.
bash-4.3# ping <|>
ping: bad address '<|>'

bash-4.3# ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=49 time=1.133 ms
64 bytes from seq=1 ttl=49 time=1.084 ms
--- ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 1.083/1.109/1.137 ms
Note: 1. Security groups are proper with access to all http traffic. So I am not sure why the DNS resolution is failing on the EC2 instances. I have tried restarting coredns service
sudo kubectl -n kube-system rollout restart deployment coredns
and it temporarily fixes the issue but when I delete and recreate the pod, I again see issue with DNS resolution. Please let me know of there is anything needs to be changed in config files or is there any setup issue.