Extend kubernetes internal network to a Master only node

11/5/2015

I am trying to setup a small Kubernetes cluster using a VM (master) and 3 bare metal servers (all running Ubuntu 14.04). I am following the Kubernetes install tutorial for Ubuntu. Everything works fine if I use the 4 nodes (VM + servers) as minions. But when I try to use the VM as just a master, it cannot access the Flannel network. I can create pods, services, etc, but if I try to access a service from the master node (VM), it cannot find the Flannel's IP.

Can I include a master only node to the Kubernetes' internal network (Flannel's net in this case)? If not, any advice in how to access the Kubernetes UI and other services from the master node?

-- dilvan
flannel
kubernetes
ubuntu

1 Answer

11/6/2015

To have the master node access the cluster network, you can run flanneld and kube-proxy on the master node. This should give you the access you need.

However, adding these components in the context of using the kube-up.sh method may be a little involved. Seems like you may have a few options while remaining mostly within the framework of that tutorial:

  • You could walk through the kube-up.sh scripts and alter it so that it installs and configures kube-proxy and flanneld on the master node, but not the kubelet. That may be hard to maintain over time.
  • You could bring up the cluster as you already have with all 4 nodes running as 'nodes' (the new name for workers that used to be called 'minions'). Then mark the master node as unschedulable (kubectl patch nodes $NODENAME -p '{"spec": {"unschedulable": true}}') as outlined here. The master will still show up in node listings and such, but it should not get any pods scheduled to it and should have full network access to the cluster.
  • You could also bring the cluster up as you already have with 4 nodes and then just log in and remove the kubelet on the master. This is effectively like the above, except the master won't show up in node listings (although you may have to remove it (kubectl delete node $NODENAME) when you remove the kubelet.

There are probably other options (there always are!), but hopefully these can get you started.

-- rwehner
Source: StackOverflow