Kubernetes: Container not able to ping www.google.com










1















I have kubernetes cluster running on 4 Raspberry-pi devices, out of which 1 is acting as master and other 3 are working as worker i.e w1, w2, w3. I have started a daemon set deployment, so each worker is running a pod of 2 containers.



w2 is running pod of 2 container. If I exec into any container and ping www.google.com from the container, I get the response. But if I do the same on w1 and w3 it says temporary failure in name resolution. All the pods in kube-system are running. I am using weave for networking. Below are all the pods for kube-system



NAME READY STATUS RESTARTS AGE
etcd-master-pi 1/1 Running 1 23h
kube-apiserver-master-pi 1/1 Running 1 23h
kube-controller-manager-master-pi 1/1 Running 1 23h
kube-dns-7b6ff86f69-97vtl 3/3 Running 3 23h
kube-proxy-2tmgw 1/1 Running 0 14m
kube-proxy-9xfx9 1/1 Running 2 22h
kube-proxy-nfgwg 1/1 Running 1 23h
kube-proxy-xbdxl 1/1 Running 3 23h
kube-scheduler-master-pi 1/1 Running 1 23h
weave-net-7sh5n 2/2 Running 1 14m
weave-net-c7x8p 2/2 Running 3 23h
weave-net-mz4c4 2/2 Running 6 22h
weave-net-qtgmw 2/2 Running 10 23h


If I am starting the containers using the normal docker container command but not from the kubernetes deployment then I do not see this issue. I think this is because of kube-dns. How can I debug this issue.?










share|improve this question




























    1















    I have kubernetes cluster running on 4 Raspberry-pi devices, out of which 1 is acting as master and other 3 are working as worker i.e w1, w2, w3. I have started a daemon set deployment, so each worker is running a pod of 2 containers.



    w2 is running pod of 2 container. If I exec into any container and ping www.google.com from the container, I get the response. But if I do the same on w1 and w3 it says temporary failure in name resolution. All the pods in kube-system are running. I am using weave for networking. Below are all the pods for kube-system



    NAME READY STATUS RESTARTS AGE
    etcd-master-pi 1/1 Running 1 23h
    kube-apiserver-master-pi 1/1 Running 1 23h
    kube-controller-manager-master-pi 1/1 Running 1 23h
    kube-dns-7b6ff86f69-97vtl 3/3 Running 3 23h
    kube-proxy-2tmgw 1/1 Running 0 14m
    kube-proxy-9xfx9 1/1 Running 2 22h
    kube-proxy-nfgwg 1/1 Running 1 23h
    kube-proxy-xbdxl 1/1 Running 3 23h
    kube-scheduler-master-pi 1/1 Running 1 23h
    weave-net-7sh5n 2/2 Running 1 14m
    weave-net-c7x8p 2/2 Running 3 23h
    weave-net-mz4c4 2/2 Running 6 22h
    weave-net-qtgmw 2/2 Running 10 23h


    If I am starting the containers using the normal docker container command but not from the kubernetes deployment then I do not see this issue. I think this is because of kube-dns. How can I debug this issue.?










    share|improve this question


























      1












      1








      1








      I have kubernetes cluster running on 4 Raspberry-pi devices, out of which 1 is acting as master and other 3 are working as worker i.e w1, w2, w3. I have started a daemon set deployment, so each worker is running a pod of 2 containers.



      w2 is running pod of 2 container. If I exec into any container and ping www.google.com from the container, I get the response. But if I do the same on w1 and w3 it says temporary failure in name resolution. All the pods in kube-system are running. I am using weave for networking. Below are all the pods for kube-system



      NAME READY STATUS RESTARTS AGE
      etcd-master-pi 1/1 Running 1 23h
      kube-apiserver-master-pi 1/1 Running 1 23h
      kube-controller-manager-master-pi 1/1 Running 1 23h
      kube-dns-7b6ff86f69-97vtl 3/3 Running 3 23h
      kube-proxy-2tmgw 1/1 Running 0 14m
      kube-proxy-9xfx9 1/1 Running 2 22h
      kube-proxy-nfgwg 1/1 Running 1 23h
      kube-proxy-xbdxl 1/1 Running 3 23h
      kube-scheduler-master-pi 1/1 Running 1 23h
      weave-net-7sh5n 2/2 Running 1 14m
      weave-net-c7x8p 2/2 Running 3 23h
      weave-net-mz4c4 2/2 Running 6 22h
      weave-net-qtgmw 2/2 Running 10 23h


      If I am starting the containers using the normal docker container command but not from the kubernetes deployment then I do not see this issue. I think this is because of kube-dns. How can I debug this issue.?










      share|improve this question
















      I have kubernetes cluster running on 4 Raspberry-pi devices, out of which 1 is acting as master and other 3 are working as worker i.e w1, w2, w3. I have started a daemon set deployment, so each worker is running a pod of 2 containers.



      w2 is running pod of 2 container. If I exec into any container and ping www.google.com from the container, I get the response. But if I do the same on w1 and w3 it says temporary failure in name resolution. All the pods in kube-system are running. I am using weave for networking. Below are all the pods for kube-system



      NAME READY STATUS RESTARTS AGE
      etcd-master-pi 1/1 Running 1 23h
      kube-apiserver-master-pi 1/1 Running 1 23h
      kube-controller-manager-master-pi 1/1 Running 1 23h
      kube-dns-7b6ff86f69-97vtl 3/3 Running 3 23h
      kube-proxy-2tmgw 1/1 Running 0 14m
      kube-proxy-9xfx9 1/1 Running 2 22h
      kube-proxy-nfgwg 1/1 Running 1 23h
      kube-proxy-xbdxl 1/1 Running 3 23h
      kube-scheduler-master-pi 1/1 Running 1 23h
      weave-net-7sh5n 2/2 Running 1 14m
      weave-net-c7x8p 2/2 Running 3 23h
      weave-net-mz4c4 2/2 Running 6 22h
      weave-net-qtgmw 2/2 Running 10 23h


      If I am starting the containers using the normal docker container command but not from the kubernetes deployment then I do not see this issue. I think this is because of kube-dns. How can I debug this issue.?







      docker networking kubernetes






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 7:05







      S Andrew

















      asked Nov 15 '18 at 6:57









      S AndrewS Andrew

      7671144




      7671144






















          1 Answer
          1






          active

          oldest

          votes


















          2














          You can start by checking if the dns is working



          Run the nslookup on kubernetes.default from inside the pod, check if it is working.



          [root@metrics-master-2 /]# nslookup kubernetes.default
          Server: 10.96.0.10
          Address: 10.96.0.10#53

          Name: kubernetes.default.svc.cluster.local
          Address: 10.96.0.1


          Check the local dns configuration inside the pods:



          [root@metrics-master-2 /]# cat /etc/resolv.conf 
          nameserver 10.96.0.10
          search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal
          options ndots:5


          At last, check the kube-dns container logs while you run the ping command, It will give you the possible reasons why the name is not resolving.



          kubectl logs kube-dns-86f4d74b45-7c4ng -c kubedns -n kube-system


          Hope this helps.






          share|improve this answer























          • When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

            – S Andrew
            Nov 15 '18 at 7:55












          • You can do it inside the container also. It is the same thing.

            – Prafull Ladha
            Nov 15 '18 at 8:36











          • What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

            – S Andrew
            Nov 15 '18 at 8:42











          • Also I do not see any activity in logs of kube-dns while I run ping command

            – S Andrew
            Nov 15 '18 at 8:43











          • kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

            – Prafull Ladha
            Nov 15 '18 at 8:50










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313967%2fkubernetes-container-not-able-to-ping-www-google-com%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          You can start by checking if the dns is working



          Run the nslookup on kubernetes.default from inside the pod, check if it is working.



          [root@metrics-master-2 /]# nslookup kubernetes.default
          Server: 10.96.0.10
          Address: 10.96.0.10#53

          Name: kubernetes.default.svc.cluster.local
          Address: 10.96.0.1


          Check the local dns configuration inside the pods:



          [root@metrics-master-2 /]# cat /etc/resolv.conf 
          nameserver 10.96.0.10
          search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal
          options ndots:5


          At last, check the kube-dns container logs while you run the ping command, It will give you the possible reasons why the name is not resolving.



          kubectl logs kube-dns-86f4d74b45-7c4ng -c kubedns -n kube-system


          Hope this helps.






          share|improve this answer























          • When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

            – S Andrew
            Nov 15 '18 at 7:55












          • You can do it inside the container also. It is the same thing.

            – Prafull Ladha
            Nov 15 '18 at 8:36











          • What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

            – S Andrew
            Nov 15 '18 at 8:42











          • Also I do not see any activity in logs of kube-dns while I run ping command

            – S Andrew
            Nov 15 '18 at 8:43











          • kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

            – Prafull Ladha
            Nov 15 '18 at 8:50















          2














          You can start by checking if the dns is working



          Run the nslookup on kubernetes.default from inside the pod, check if it is working.



          [root@metrics-master-2 /]# nslookup kubernetes.default
          Server: 10.96.0.10
          Address: 10.96.0.10#53

          Name: kubernetes.default.svc.cluster.local
          Address: 10.96.0.1


          Check the local dns configuration inside the pods:



          [root@metrics-master-2 /]# cat /etc/resolv.conf 
          nameserver 10.96.0.10
          search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal
          options ndots:5


          At last, check the kube-dns container logs while you run the ping command, It will give you the possible reasons why the name is not resolving.



          kubectl logs kube-dns-86f4d74b45-7c4ng -c kubedns -n kube-system


          Hope this helps.






          share|improve this answer























          • When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

            – S Andrew
            Nov 15 '18 at 7:55












          • You can do it inside the container also. It is the same thing.

            – Prafull Ladha
            Nov 15 '18 at 8:36











          • What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

            – S Andrew
            Nov 15 '18 at 8:42











          • Also I do not see any activity in logs of kube-dns while I run ping command

            – S Andrew
            Nov 15 '18 at 8:43











          • kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

            – Prafull Ladha
            Nov 15 '18 at 8:50













          2












          2








          2







          You can start by checking if the dns is working



          Run the nslookup on kubernetes.default from inside the pod, check if it is working.



          [root@metrics-master-2 /]# nslookup kubernetes.default
          Server: 10.96.0.10
          Address: 10.96.0.10#53

          Name: kubernetes.default.svc.cluster.local
          Address: 10.96.0.1


          Check the local dns configuration inside the pods:



          [root@metrics-master-2 /]# cat /etc/resolv.conf 
          nameserver 10.96.0.10
          search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal
          options ndots:5


          At last, check the kube-dns container logs while you run the ping command, It will give you the possible reasons why the name is not resolving.



          kubectl logs kube-dns-86f4d74b45-7c4ng -c kubedns -n kube-system


          Hope this helps.






          share|improve this answer













          You can start by checking if the dns is working



          Run the nslookup on kubernetes.default from inside the pod, check if it is working.



          [root@metrics-master-2 /]# nslookup kubernetes.default
          Server: 10.96.0.10
          Address: 10.96.0.10#53

          Name: kubernetes.default.svc.cluster.local
          Address: 10.96.0.1


          Check the local dns configuration inside the pods:



          [root@metrics-master-2 /]# cat /etc/resolv.conf 
          nameserver 10.96.0.10
          search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal
          options ndots:5


          At last, check the kube-dns container logs while you run the ping command, It will give you the possible reasons why the name is not resolving.



          kubectl logs kube-dns-86f4d74b45-7c4ng -c kubedns -n kube-system


          Hope this helps.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 7:39









          Prafull LadhaPrafull Ladha

          3,6781523




          3,6781523












          • When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

            – S Andrew
            Nov 15 '18 at 7:55












          • You can do it inside the container also. It is the same thing.

            – Prafull Ladha
            Nov 15 '18 at 8:36











          • What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

            – S Andrew
            Nov 15 '18 at 8:42











          • Also I do not see any activity in logs of kube-dns while I run ping command

            – S Andrew
            Nov 15 '18 at 8:43











          • kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

            – Prafull Ladha
            Nov 15 '18 at 8:50

















          • When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

            – S Andrew
            Nov 15 '18 at 7:55












          • You can do it inside the container also. It is the same thing.

            – Prafull Ladha
            Nov 15 '18 at 8:36











          • What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

            – S Andrew
            Nov 15 '18 at 8:42











          • Also I do not see any activity in logs of kube-dns while I run ping command

            – S Andrew
            Nov 15 '18 at 8:43











          • kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

            – Prafull Ladha
            Nov 15 '18 at 8:50
















          When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

          – S Andrew
          Nov 15 '18 at 7:55






          When you say running the nslookup from inside the pod, do you mean from inside the container or on the master device. Thanks

          – S Andrew
          Nov 15 '18 at 7:55














          You can do it inside the container also. It is the same thing.

          – Prafull Ladha
          Nov 15 '18 at 8:36





          You can do it inside the container also. It is the same thing.

          – Prafull Ladha
          Nov 15 '18 at 8:36













          What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

          – S Andrew
          Nov 15 '18 at 8:42





          What does default in kubernetes.default means. Does this default means default namespace so which means I will have to mention my namespace while nslookup

          – S Andrew
          Nov 15 '18 at 8:42













          Also I do not see any activity in logs of kube-dns while I run ping command

          – S Andrew
          Nov 15 '18 at 8:43





          Also I do not see any activity in logs of kube-dns while I run ping command

          – S Andrew
          Nov 15 '18 at 8:43













          kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

          – Prafull Ladha
          Nov 15 '18 at 8:50





          kubernetes.default resolves to the kubedns service which has clusterIP of 10.96.0.1 in my case. That was just to check if kubedns is working fine. If it works fine, it means the problem is somewhere else. I just deployed kubernetes cluster of 3 node(1 master, 2 worker) with the weave CNI. On my cluster everything is working fine.

          – Prafull Ladha
          Nov 15 '18 at 8:50



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313967%2fkubernetes-container-not-able-to-ping-www-google-com%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

          Museum of Modern and Contemporary Art of Trento and Rovereto