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

<ol>
<li><p>Run the command 'kubectl config view' or 'kubectl cluster-info' to check the IP address of Kubernetes control plane. In my case it is 10.0.0.2.</p>
<p>$  kubectl config view</p>
<p>apiVersion: v1</p>
<p>clusters:</p>
<ul>
<li><p>cluster:</p>
<p>certificate-authority-data: DATA+OMITTED</p>
<p>server: <a href="https://10.0.0.2:6443" rel="nofollow noreferrer">https://10.0.0.2:6443</a></p>
</li>
</ul>
<p>Or</p>
<p>$  kubectl cluster-info</p>
<p>Kubernetes control plane is running at <a href="https://10.0.0.2:6443" rel="nofollow noreferrer">https://10.0.0.2:6443</a></p>
</li>
<li><p>Tried to telnet the Kubernetes control plane.</p>
<p>telnet 10.0.0.2 6443</p>
<p>Trying 10.0.0.2...</p>
</li>
<li><p>Press Control + C in your keyboard to terminate the telnet command.</p>
</li>
<li><p>Go to your Firewall Rules and add port 6443 and make sure to allow all instances in the network.</p>
</li>
<li><p>Then try to telnet the Kubernetes control plane once again and you should be able to connect now:</p>
<p>$ telnet 10.0.0.2 6443</p>
<p>Trying 10.0.0.2...</p>
<p>Connected to 10.0.0.2.</p>
<p>Escape character is '^]'.</p>
</li>
<li><p>Try to join the worker nodes now. You can run the command 'kubeadm token create --print-join-command' to create new token just in case you forgot to save the old one.</p>
</li>
<li><p>Run 'kubectl get nodes' on the control-plane to see this node join the cluster</p>
<p>$  kubectl get nodes</p>
<p>NAME          STATUS   ROLES           AGE   VERSION</p>
<p>k8s           Ready    control-plane   57m   v1.25.0</p>
<p>wk8s-node-0   Ready              36m   v1.25.0</p>
<p>wk8s-node-1   Ready              35m   v1.25.0</p>
</li>
</ol>
