unable to access the clusterIP_service or Internet within a pod by using serviceName or domainName
Asked Answered
K

1

0

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 - success

  • Invoked restapi exposed in pod2 using wget service2ipaddress - success

  • Invoked restapi exposed in pod2 using wget service2Name - failure with message Could not resolve host: pcgamesapp-service

  • curl https://www.google.com - failure with message Could not resolve host: www.google.com

  • Executed below nslookup command , but received connection timeout error as shown in below screenshot enter image description here

Setup

  • Initalised k8s cluster (v1.22.9) with 1 masterNode and 1 workerNode on ubuntu 20.04 using kubeadm in AWS EC2 virtual machines
  • weavenet plugin 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

Karl answered 25/4, 2022 at 14:59 Comment(0)
K
2

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

Ports opened for Master node enter image description here

Ports opened for Worker node enter image description here

Please let me know if you have any doubts or concerns with the above details. Thank you

Karl answered 26/4, 2022 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.