I am trying to create a new kubernetes cluster by having one master and one worker node. I've completed all the configurations in the master node by using kubeadm tool. All the control plane components are running in master node and it is verified by checking the status of pod.
coredns-6955765f44-xspkr 0/1 Pending 0 8d
etcd-master-1 1/1 Running 1 8d
kube-apiserver-master-1 1/1 Running 1 8d
kube-controller-manager-master-1 1/1 Running 1 8d
kube-proxy-8z8qr 1/1 Running 1 8d
kube-scheduler-master-1 1/1 Running 1 8d
After installing kubectl,kubeadm,kubelet and docker in worker node, I tried to add the node in to the cluster by running kubeadmin join command by providing token and discovery token but getting below error.
I0202 22:17:57.778406 28654 token.go:78] [discovery] Failed to request cluster info: [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]
I did ping the master from worker node and was able to do that. I also disabled firewall and even after that unable to join the cluster.
Are there any pre requisites to be done in worker node apart from installing the above components as i mentioned ? Any help would be highly appreciated.
New Discovery
One interesting thing I just found is the enp0s3 ip address . Although I use ip address of enp0s8 to login to the vm's , enp0s3 of both master the worker node is same which i guess is causing the issue. when I generate a token using kubeadm token create command in the master node, it gives kubeapi url with the ip of enp0s3 as (kubeadm join 10.0.2.15:6443) which seems to be common for both master and worker node.
Master
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::b7:1fff:fe33:e924 prefixlen 64 scopeid 0x20<link>
ether 02:b7:1f:33:e9:24 txqueuelen 1000 (Ethernet)
RX packets 45801 bytes 50621300 (50.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12270 bytes 811968 (811.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Worker
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::b7:1fff:fe33:e924 prefixlen 64 scopeid 0x20<link>
ether 02:b7:1f:33:e9:24 txqueuelen 1000 (Ethernet)
RX packets 703 bytes 588444 (588.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 305 bytes 23784 (23.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Not sure like how these vm's got same IP for enp0s3 and is there any way to overcome this issue?
10.0.2.15:6443
– zerkms