<p>I am novice to k8s, so this might be very simple issue for someone with expertise in the k8s.</p>

<p>I am working with two nodes </p>

<ol>
<li>master - 2cpu, 2 GB memory</li>
<li>worker - 1 cpu, 1 GB memory</li>
<li>OS - ubuntu - hashicorp/bionic64</li>
</ol>

<p>I did setup the master node successfully and i can see it is up and running </p>

<pre><code>vagrant@master:~$ kubectl get nodes
NAME     STATUS   ROLES    AGE   VERSION
master   Ready    master   29m   v1.18.2
</code></pre>

<p>Here is token which i have generated </p>

<pre><code>vagrant@master:~$ kubeadm token create --print-join-command
W0419 13:45:52.513532   16403 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
kubeadm join 10.0.2.15:6443 --token xuz63z.todnwgijqb3z1vhz     --discovery-token-ca-cert-hash sha256:d4dadda6fa90c94eca1c8dcd3a441af24bb0727ffc45c0c27161ee8f7e883521 
</code></pre>

<p><strong>Issue</strong> - But when i try to join it from the worker node i get</p>

<pre><code>vagrant@worker:~$ sudo kubeadm join 10.0.2.15:6443 --token xuz63z.todnwgijqb3z1vhz     --discovery-token-ca-cert-hash sha256:d4dadda6fa90c94eca1c8dcd3a441af24bb0727ffc45c0c27161ee8f7e883521 
W0419 13:46:17.651819   15987 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase preflight: couldn't validate the identity of the API Server: Get https://10.0.2.15:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s: dial tcp 10.0.2.15:6443: connect: connection refused
To see the stack trace of this error execute with --v=5 or higher
</code></pre>

<p>Here are the ports which are occupied </p>

<pre><code>10.0.2.15:2379 
10.0.2.15:2380 
10.0.2.15:68
</code></pre>

<p>Note i am using CNI from - </p>

<pre><code>kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
</code></pre>

<p>Here are mistakes which realized i did during my kubernetes installation - </p>

<p>(For detailed installation step follow - <a href="http://jhooq.com/14-steps-to-install-kubernetes-on-ubuntu-18-04-and-16-04/" rel="nofollow noreferrer">Steps for Installation</a> )</p>

<p>But here are the key mistakes which i did -</p>

<p><strong><em>Mistake 1 -</em></strong> Since i was working on the VMs so i had multiple ethernet adapter on my both the VMs (master as well as worker ). By default the the CNI always takes the <strong><em>eth0</em></strong> but i our case it should be <strong><em>eth1</em></strong></p>

<pre><code>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt;
2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:bb:14:75 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15
3: eth1: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:fb:48:77 brd ff:ff:ff:ff:ff:ff
    inet 100.0.0.1
4: docker0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt;
</code></pre>

<p><strong><em>Mistake 2-</em></strong> The way i was initializing the my <strong><em>kubeadm</em></strong> without <strong><em>--apiserver-advertise-address</em></strong> and <strong><em>--pod-network-cidr</em></strong></p>

<p>So here is kubeadm command which i used - </p>

<pre><code>[vagrant@master ~]$ sudo kubeadm init --apiserver-advertise-address=100.0.0.1 --pod-network-cidr=10.244.0.0/16
</code></pre>

<p><strong><em>Mistake 3 -</em></strong> - Since we have mulitple ethernet adapter in our VMs so i coudln't find the a way to set up extra args to switch from <strong><em>eth0</em></strong> to <strong><em>eth1</em></strong> in <strong><em>calico.yml</em></strong> configuration.</p>

<p>So i used <strong>flannel CNI*</strong> </p>

<pre><code>[vagrant@master ~]$ wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
</code></pre>

<p>and in the args section added  - <strong><em>--iface=eth1</em></strong></p>

<pre><code>- --iface=eth1
        args:
        - --ip-masq
        - --kube-subnet-mgr
        - --iface=eth1
</code></pre>

<p>And it worked after that</p>
