First8 staat voor vakmanschap. Al onze collega’s zijn een groot aanhanger van Open Source en in het bijzonder het Java-platform. Wij zijn gespecialiseerd in het pragmatisch ontwikkelen van bedrijfskritische Java toepassingen waarbij integratie van systemen, hoge eisen aan beveiliging en veel transacties een belangrijke rol spelen. Op deze pagina vind je onze blogs.

Your own private Kubernetes cluster at home

So, you decided to setup your own Kubernetes cluster on some old pc or Raspberry Pi you’ve just got laying around. Great! Your own personal private Kubernetes cluster just for you to experiment with, just because you don’t want to use Minikube.

The basics

The first thing you do is search the internet for the documentation on how to install it. For me, it would be installed on an Ubuntu server, so I came out on https://kubernetes.io/docs/setup/independent/install-kubeadm/

First thing to do, is install Kubernetes.

You will see instructions from kubeadm on how to join other nodes to the cluster. If you want to run containers on your master as well (as it might be your only node), just run

Weave and the Dashboard

Next, you apply Weave and the dashboard:

If you want to log in to the cluster with the admin user, you can find the token by using the command:

All this can be found online relatively easily. Nothing special so far.

Ingress

Now to create the ingress controller (which is easy in the cloud or Minikube). I went to the Minikube repo https://github.com/kubernetes/minikube/tree/master/deploy/addons/ingress and applied the Ingress files with

Heapster

Now for something with a little more cool factor. You’ve heard of Horizontal Pod Auto-scaling: scaling your pods based on metrics served from the cluster. In the cloud, this would be installed by default. But not on our cloud. So what now?
What I did, was use the files in the Minikube repo https://github.com/kubernetes/minikube/tree/master/deploy/addons/heapster to install Heapster, Influx and Grafana with the apply command from above.

So Heapster is installed, but we can’t see any graphs in the dashboard. What is going on? As we can see from the logging of the Heapster pod, it cannot scrap the cluster. It hasn’t got the right roles and rights.

Now, delete your pod and let the Replicaset create a new one for you. Let the pod restart and then refresh your dashboard. It should now show you some graphs with CPU and memory stats on them. This means that the auto-scaler should work.

 

Happy deploying.