<p>I want to setup a kubernetes cluster locally where I would like to have 1 master node and 2 worker nodes. I have managed to do that but I am not able to access pods or see any logs of a specific pod because Internal IP address is the same for all nodes.</p>

<pre><code>vagrant@k8s-head:~$ kubectl get nodes -o wide
NAME         STATUS   ROLES    AGE     VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
k8s-head     Ready    master   5m53s   v1.15.0   10.0.2.15     &lt;none&gt;        Ubuntu 16.04.6 LTS   4.4.0-151-generic   docker://18.6.2
k8s-node-1   Ready    &lt;none&gt;   4m7s    v1.15.0   10.0.2.15     &lt;none&gt;        Ubuntu 16.04.6 LTS   4.4.0-151-generic   docker://18.6.2
k8s-node-2   Ready    &lt;none&gt;   2m28s   v1.15.0   10.0.2.15     &lt;none&gt;        Ubuntu 16.04.6 LTS   4.4.0-151-generic   docker://18.6.2
</code></pre>

<p>In order to resolve this problem I have found out that following things should be done:<br/>
- add <code>KUBELET_EXTRA_ARGS=--node-ip=&lt;IP_ADDRESS&gt;</code> in <em>/etc/default/kubelet</em> file <br/>
- restart kubelet by running:<br/><code>sudo systemctl daemon-reload &amp;&amp; sudo systemctl restart kubelet</code></p>

<p>The problem is that <em>/etc/default/kubelet</em> file is missing on this location and I am not able to add this additional parameter. Tried with creating file manually but it looks like it is not working when I restart kubelet, IP address is still the same.</p>

<p>Anyone faced this issue with missing /etc/default/kubelet file or if there is another easier way to setup different Internal IP addresses?</p>

Boban Djordjevic
<p><strong>It is normal to have the same IP in every node for the Kubernetes Cluster running in VirtualBox</strong>, the reason is that it is a <code>NAT newtork</code> not intended for communication between virtual machines, the 10.0.2.15 IP is NATed when accessing the outside world.</p>

<p>The following diagram shows the networks that are created in a Kubernetes Cluster on top of VirtualBox, as you can see, every node has the same IP in the <code>NAT newtork</code> but different IPs on the other networks:</p>

<p><a href="https://i.stack.imgur.com/xmAHo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xmAHo.png" alt="Kubernetes Cluster Networks"></a></p>

<p>In order to access the PODs you can use a NodePort and the <code>HOST ONLY</code> network.</p>

<p>See a full example and download the code at <a href="https://www.itwonderlab.com/ansible-kubernetes-vagrant-tutorial/" rel="noreferrer">Building a Kubernetes Cluster with Vagrant and Ansible (without Minikube)</a>. It is a tutorial that explains how to launch a Kubernetes cluster using Ansible playbooks, Vagrant and VirtualBox. </p>

<p>It uses Calico for networking and it includes another tutorial for installing <strong>Istio</strong> if you need a micro service mesh.</p>
