Ip4 is not assigned to vagrant interface (enp0s8)

Hello Team,

#CKA --Virtual Box related…

Challenge-1:

I’ve created the cluster using vagrant. The vagrant interface (enp0s8) not getting ip address assigned. Need to assign static ip?
$ ifconfig
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::6a:6bff:feb1:d294 prefixlen 64 scopeid 0x20
ether 02:6a:6b:b1:d2:94 txqueuelen 1000 (Ethernet)
RX packets 2105 bytes 506864 (506.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1286 bytes 137132 (137.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::a00:27ff:fe1f:61f2 prefixlen 64 scopeid 0x20
ether 08:00:27:1f:61:f2 txqueuelen 1000 (Ethernet)
RX packets 962 bytes 79480 (79.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 83 bytes 19962 (19.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Challenge-2:

Can we change the ip address of cluster OR we have to recreate the cluster?
because I have assigned ip of interface enp0s3 and that is same ip for all three nodes so getting error while listing the pods.

error: $ kubectl get pods -A

The connection to the server 10.0.2.15:6443 was refused - did you specify the right host or port?

Are you working from a tutorial here (such as the CKA repo’s virtualbox tutorial) or are you creating your own Vagrantfile? Or are you working from a video (in which case, a link to it would be handy).

Using “Demo - Deployment with Kubeadm” video to create cluster on my laptop. Created VMs using Vagrant tool as explained in tutorial video.

A better guide than that video would be the tutorials from the CKA repo, which are more detailed, and more up-to-date. Try them instead.

Okay let me try. thank you !

I’ve initiated the cluster using the tutorial steps but still not assigning the ip to interace(enp0s8), hence I have assigned static ip address in the same segment but getting below error. Please guide on this…

vagrant@controlplan01:~$ kubectl get pods -A
The connection to the server 10.0.x.x:6443 was refused - did you specify the right host or port?

I’m not sure what you did here. For starters, what does ip addr display?

Hello Rob,

I’ve figured it out. it’s resolved now.