Cheap Kubernetes hosting for personal use
Cheap Kubernetes Cluster
This post is the first post in my first series, where I share my experiences in setting a Kuberenetes Cluster under ultra-low budget. This is my personal cluster in which I deployed several of my productive applications.
15 bucks for a Kubernetes cluster?
My Adventures With Kubernetes Cluster
There have been several tutorials [1][2] online that talk about setting up your own Kubernetes cluster on different cloud providers. I tried to set one on Google Cloud as it was easy to set up and I found a tutorial on devons’ blog [3]. From the beginning my goal was to set up the cluster as cheap as possible, preferably less than 20 euros. In this tutorial, he points out that using preemptive VMs are better and are way cheaper than the normal nodes – this is true. A preemptive VM is a node that is available for a maximum of 24 hours and GCP does not guarantee after which. This is somewhat close to what AWS offers as Spot instances.
After adjusting few settings in GCP, I found a way to get the per-day burn-rate to 33 cents. That is close to 10 bucks a day, and I was already excited at this number:
who says #k8s is expensive ;) from ~6 eur to 0,33 cents/day .. #gke #gce #kubernetes 🥳🥳 pic.twitter.com/ZO5JgoPfoK
— tckb (@this_is_tckb) October 18, 2019
But, that was short-lived excitement. As soon as I added a public facing Loadbalancer(this is much-needed to me), the rate jumped back up-to 6-7 bucks a day. This is evidently the opposite of what I wanted. The rest of the cloud providers Digital Ocean, Azure etc., weren’t far from that number either.
Because of my interest in container orchestration, I was focused on setting up my own cluster. I wanted to take this opportunity to learn by maintaining the cluster running entirely by myself.
My Experiments With Baremetal Servers for Kubernetes
After much deliberation, I found a great other alternative provider that offers cheap, yet good Bare-metal servers, Hetzner Cloud.
The cheapest VPS offering from Hetzner is their CX11 server, that offers 1vCPU and 2Gb Ram. This would be enough for working with simple load. A comparable offering in GCP would be 2x
g1-small
instances.
For the argument sake, we will just 2 worker nodes and a master node with the same type of instance. In most cases, for simpler loads, this should be enough.
let’s look at math -
resource | # instances | cost (euros) |
---|---|---|
CX11 worker nodes | 2 | 5,78 |
CX11 master node | 1 | 2,89 |
Total (minimum) | 9,67 |
That is quite tempting, I have all the required resources under 10 euros! Including a Public IP.
Since this is not a Cloud provider, we need to setup our own loadbalancer with the public IP that we get from Hetzner cloud. This is possible using MetalLb (more on that in the next posts).
All the other resources needed to set up wouldn’t cost a lot.
In this blog series, Cheap Kubernetes Cluster I will explain or at least glaze through the steps I took to set up –
- Password Manager - think your own LastPass
- Secure and private DNS Server stack
- Mail Server
- Object Storage - think your own AWS S3
- Public facing IP
- Analytics Server (Coming 🔜!)
- Monitoring/Alerting Stack
- Gitlab CI/CD Runners
.. And more.
Using the above setup. All these services with sparing 50% of the resources costing less than 15 euros. Yes, no jokes! don’t believe me, here’s the snap of my invoices.
More parts in the series coming very soon ✌️.