We’ll be using a great, fresh out of alpha utility, kubeadm, and following along a very nice quick start, we’ll skip the boring parts and we’ll spend some time doing other things.

The quick start we are following along is intended for Ubuntu 16.04+, CentOS 7 or HypriotOS v1.0.1+, I can tell you it also works on Debian Jessie. We’ll be traversing the Debian branch package wise, everything else is pretty much identical. So lets get our feet wet (do eveything as root we are having fun after all, or sudo ), also run this in screen or tmux .

It all starts with Docker, as it usually always does…

following with the things we really care about (k8s)

All set, lets init our cluster, we’ll be using flannel as our network plugin of choice (dont’t ask, or click the links :)), therefor you need the --pod-network-cidr option, otherwise hairpulling.

kubeadm init --pod-network-cidr=10.244.0.0/16

You should see something like this

And thats it, you’ll be seeing an endless screen of the line.

This has been fixed in 1.6.1 (allegedly :)), so after the cluster initializes feel free skip to the flannel configuration below…

[apiclient] Waiting for at least one node to register and become ready

and that’s just not very nice, turns out there is a kink in post alpha kubeadm . Node is not considered ready, until networking is ready. In the previous versions you would set up networking after (or you know kubeadm would finish…).

While apiclient is still assaulting you, switch to another screen|tmux window. We only care about the config files at this time and we got that already, lines below are good lines

we like them a lot. In the window you’ve switched to run:

cp /etc/kubernetes/admin.conf $HOME/

chown $(id -u):$(id -g) $HOME/admin.conf

export KUBECONFIG=$HOME/admin.conf

This will allow you to interact with your cluster and set up this networking nobody is talking about, if you remember we’ll be using flannel (you really don’t need to care, yet). Notable change from the previous versions of Kube is that you need to set up roles and role bindings , flannel guys have our back :). CoreOS is also awesome mind you :).

git clone https://github.com/coreos/flannel.git

kubectl apply -f flannel/Documentation/kube-flannel-rbac.yml

kubectl apply -f flannel/Documentation/kube-flannel.yml -f flannel/Documentation/kube-flannel-rbac.yml-f flannel/Documentation/kube-flannel.yml

After you’ve done with that, you can return to the window where the cluster has been initializing, and you should see it initialized (beers for everybody…).

Take note of the line similar to:

kubeadm join --token <token> <master-ip>:<master-port>

Disregard everything else, you did that already (unless everything is different this time).

Do export KUBECONFIG=$HOME/admin.conf again for good luck and lets see how we are doing, watch kubectl get pods --all-namespaces should get you something like this: