I've created a virtual kubernetes cluster using vagrant boxes. All my boxes have 2 network interfaces
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:1d:76:b3:3c:fe brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::1d:76ff:feb3:3cfe/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:35:39:9f brd ff:ff:ff:ff:ff:ff
inet 192.168.70.11/24 brd 192.168.70.255 scope global enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe35:399f/64 scope link
valid_lft forever preferred_lft forever
enp0s3 is created by default and has the same ip address on all the boxes. Apparently this is a virtual box thing https://github.com/hashicorp/vagrant/issues/6456 . I added the enp0s8 interface as a private network to allow my boxes to talk to each other, this one has a different IP on each box so I want to use it for kubernetes.
When I set up my cluster I used this command which allowed me to create the cluster on the first node and join the second node
$ kubeadm init --apiserver-advertise-address=192.168.70.11 --pod-network-cidr=10.244.0.0/16
The problem is all the kube-system pods are still using the enp0s3 interface
$ kubectl -n kube-system get pods -owide
NAME READY STATUS RESTARTS AGE IP NODE
coredns-78fcdf6894-8tpnc 1/1 Running 0 11m 10.244.0.2 node-1
coredns-78fcdf6894-tbqxk 1/1 Running 0 11m 10.244.0.3 node-1
etcd-node-1 1/1 Running 0 10m 10.0.2.15 node-1
kube-apiserver-node-1 1/1 Running 0 10m 10.0.2.15 node-1
kube-controller-manager-node-1 1/1 Running 0 10m 10.0.2.15 node-1
kube-flannel-ds-5wm74 1/1 Running 0 11m 10.0.2.15 node-2
kube-flannel-ds-wx77l 1/1 Running 0 11m 10.0.2.15 node-1
kube-proxy-gmst8 1/1 Running 0 11m 10.0.2.15 node-2
kube-proxy-sbqqs 1/1 Running 0 11m 10.0.2.15 node-1
kube-scheduler-node-1 1/1 Running 0 10m 10.0.2.15 node-1
I'd like to force kubernetes to use enp0s8 exclusively. Is there anyway to do that without removing the the enp0s3 interface?
This is what the nodes look like
$ kubectl get nodes -owide
NAME STATUS ROLES AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
node-1 Ready master 4m v1.11.2 <none> Ubuntu 16.04.5 LTS 4.4.0-134-generic docker://17.3.2
node-2 Ready <none> 3m v1.11.2 <none> Ubuntu 16.04.5 LTS 4.4.0-134-generic docker://17.3.2
And this is the version info
$ sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}