title: Kubernetes through VirtualBox: Pods can't access internet services
body: <p><strong>Solution</strong></p>
  <p>The Problem disappeared after I moved to a proper development server. Apparently the Kubernetes cluster does not properly run with bridged AirPort network environments in Virutalbox.</p>
  <hr />
  <h2><strong><a href="https://serverfault.com/questions/1038655/kubernetes-pods-cant-access-internet-services">Moved it to ServerFault because off topic.</a></strong></h2>
  <hr />
  <p>I've setup a deployment and a service and I am exposing it via NodePort but my Pods somehow cant access the internet. The worker node which runs the pod however has an internet connection. I tested this by exec into the running pod and curl a webpage.</p>
  <p><strong>Pods</strong></p>
  <pre><code>root@master:/home/user# kubectl get pods
  NAME                               READY   STATUS      RESTARTS   AGE
  my-website-6d8f7c7bfb-sdtrh        1/1     Running     1          6d1h
  </code></pre>
  <p><strong>Curl from Host</strong></p>
  <pre><code>root@master:/home/user# curl https://wikipedia.org
  &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;301 Moved Permanently&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Moved Permanently&lt;/h1&gt;
  &lt;p&gt;The document has moved &lt;a href=&quot;https://www.wikipedia.org/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  <p><strong>Exec Pod - Curl</strong></p>
  <pre><code>root@master:/home/user# kubectl exec -it my-website-6d8f7c7bfb-sdtrh /bin/bash
  root@my-website-6d8f7c7bfb-sdtrh:/sbin# curl https://wikipedia.org
  curl: (6) Could not resolve host: wikipedia.org
  </code></pre>
  <p>Anyone an idea what that could be? I'm fairly new to DevOps, so I don't know quite as much about all of that yet.</p>
  <p><strong>EDIT for Howard_Roark</strong></p>
  <ol>
  <li>I've checked and yes the two <code>/etc/resolv.conf</code>'s differ.</li>
  </ol>
  <p><strong>On worker node</strong></p>
  <pre><code>root@worker:~# cat /etc/resolv.conf 
  # Generated by NetworkManager
  search fritz.box
  nameserver 192.168.178.1
  </code></pre>
  <p><strong>Inside Pod</strong></p>
  <pre><code>/ # cat /etc/resolv.conf 
  nameserver 10.96.0.10
  search default.svc.cluster.local svc.cluster.local cluster.local fritz.box
  options ndots:5
  </code></pre>
  <ol start="2">
  <li>From the node itself I can get out to another name server, but not from the pod.</li>
  </ol>
  <pre><code>root@worker:~# nslookup wikipedia.org 8.8.8.8
  Server:     8.8.8.8
  Address:    8.8.8.8#53
  
  Non-authoritative answer:
  Name:   wikipedia.org
  Address: 91.198.174.192
  Name:   wikipedia.org
  Address: 2620:0:862:ed1a::1
  
  
  root@worker:~# nslookup wikipedia.org 1.1.1.1
  Server:     1.1.1.1
  Address:    1.1.1.1#53
  
  Non-authoritative answer:
  Name:   wikipedia.org
  Address: 91.198.174.192
  Name:   wikipedia.org
  Address: 2620:0:862:ed1a::1
  </code></pre>
  <ol start="3">
  <li>Is presumable gonna fail too hence 2. But I'll test it now.</li>
  </ol>