'unable to access the clusterIP_service or Internet within a pod by using serviceName or domainName
i have 2 pods(pod1,pod2) with 2 services(service1 links pod1, service2 links pod2) in the same namespace.
Within pod1 i performed below testing. i entered into pod1 using kubectl exec ... and
Invoked restapi exposed in pod2 using
wget pod2ipaddress- successInvoked restapi exposed in pod2 using
wget service2ipaddress- successInvoked restapi exposed in pod2 using
wget service2Name- failure with messageCould not resolve host: pcgamesapp-servicecurl https://www.google.com- failure with messageCould not resolve host: www.google.comExecuted below
nslookupcommand , but receivedconnection timeout erroras shown in below screenshot
Setup
- Initalised k8s cluster (v1.22.9) with 1 masterNode and 1 workerNode on
ubuntu 20.04usingkubeadmin AWS EC2 virtual machines weavenetplugin for networking
i tracked the kube-dns logs but the request information of curl serviceName doesnot showup in the kube-dns logs
kubectl logs --namespace=kube-system -l k8s-app=kube-dns
i followed the steps mentioned in dns-debugging-resolution documentation, but i'm not able to figure out a solution
From reading the previous answers i assume that there is some issue with coredns or iptables ...etc . But i'm unable to figure out a solution for this issue.
Please suggest
Solution 1:[1]
i received the solution from a member named felix-dpg(@fdpg in stackoverflow) through another platform. i have added the solution details below
The information related to "which ports has to be opened for master node and worker node" are in this link
The weavenet port details are in this link
Initially i didnot open (6783,6784)TCP,(6783,6784)UDP ports for Weavenet and port 53 for UDP(to enable inter-communication among the nodes in the cluster). The issue which i reported in this question got resolved by opening the ports for Weavenet and UDP
Please let me know if you have any doubts or concerns with the above details. Thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


