If you are anything like me, after many years of working with computers, you end up with a lot of random computer hardware that just sits in a close. This is especially true if you got caught up in the Altcoin mining craze for a bit.

Well the good news is you can breathe some new life into that hardware with the power of Kubernetes! You don’t need much, a dual core with 4GB of ram is enough for a simple k8s node, and if you have a couple of the, you can combine the power of them into a proper cluster! That said, even if you only have one machine - it’s enough to setup a basic “cluster” for testing/dev purposes.

To do this I used kubeadm to setup a k8s master/node. I only setup one machine, but with kubeadm it’s super simple to add more nodes as you need to.

The first thing you need to do is setup the machine with your favorite flavor of linux, I almost always use Debian because that’s what I use.

Next get Docker installed. The kubeadm instructions seem to negelect to metion this, but trying to install it without it produces an obvious error. I used the latest version of docker even though kubeadm complained about it being unsupported. I have not had any issues but YMMV.

Once docker is kicking, next you’ll need to install kubeadm. Pretty straightfoward just follow the instructions on their site.

Now optional step if you are setting up a single node and not adding anymore is to turn master isolation off. In my case I only have one machine, so that means turning it off. Even if you have multiple nodes, on a dev cluster like this, it’s probably worthwhile to shut off master isolation anyway.

kubectl taint nodes --all node-role.kubernetes.io/master-

The last step is to setup pod networking. This step gave me the most trouble because there was a big shift in security in k8s between 1.5 and 1.6 involving RBAC and this breaks a lot of examples online. So when you try to go straight to installing a network as provided in the documentation, you will run into problems.

I ended up finding that Weave worked the best and provided instructions on how to setup for Kubernetes 1.6 which you can find here. The gist being you need to create the RBAC roles before applying the daemonsets.

All together this entire process took me maybe 30 minutes from Debian install to running cluster, if you exclude the time I spent trying to resolve the pod networking problem I outlined above.

Now take your totally sweet k8s cluster and start deploying your self hosted apps!