Hello, KubeKitten
Infrastructure doesn't have to be that hard, and it doesn't have to be that inaccessible.
Some time ago I had the urge to kick off a new side project, something a bit more serious than my usual shitpost projects (writing SQL in CSS, replacing Ruby code with NodeJS, fun times…). I’d planned to take a month break in between jobs to recharge but still wanted to keep myself occupied.
I’d spent a decent amount of time at the job I had just left dealing with infrastructure for the now-defunct Superwave, which was a platform for building communities. It was the usual deal: terraform, kubernetes, the big cloud, and what struck me was not just the inherent complexity of running this infrastructure on a big cloud provider’s platform, but the exorbitant expense of it.
An idle Kubernetes cluster on Google Cloud Platform (GCP), which requires three nodes at minimum to operate, could easily set you back around $300 a month. Three hundred bucks a month just to have a cluster that does nothing. And that’s just the start of it! The only way, price-wise, is up.
The thing is, infrastructure does not have to be that hard. And particularly from a socio-economic standpoint, it doesn’t have to be that inaccessible. You can do it for much less and still keep it decently secure.
As the years have gone by, kubernetes has become increasingly capable as an all-encompassing infrastructure platform. To an extent it can be easier to manage than an equivalent Terraform setup that provisions cloud-based services, and what’s better is that it’s democratised. Open source ftw! Helm charts and operators take the place of package managers and make it trivial to deploy all kinds of utilities and services on your cluster in a consistent way. It’s really quite something when you look back at managing servers with Ansible, Chef or Puppet.
For quite some time I used to push back on jumping into the world of kubernetes because it felt like overkill. The ecosystem was still nascent and it felt like innovating on your infra rather than your business (unless of course your business was infra, natch). I don’t think that’s the case any more.
So, armed with that knowledge I started writing a guide to running your own kubernetes cluster without breaking the bank. I had only two goals in mind:
The setup had to be cheap without being unreliable
I had to eat my own dogfood and run my own shit on it
The first one was easy enough: Hetzner Cloud. Super affordable, almost built for purpose.
I didn’t have much problem with the second either. In fact, my other websites have been running on it for as long as the guide has existed, acting as the test bed for verifying each step in the guide.
Iiiin faaact, I unintentionally went one better: the setup was reproducible based on the guide. I'd left the cluster unattended long enough, with no issues, that I forgot to update the config to use my new SSH keys. I couldn’t get onto the cluster or the actual servers themselves, so I had to nuke the entire thing and start again. Took me less than an hour while comparing notes between my infra repo (affectionately named epona, the work horse), and the guide.
Where does that bring us now? Well…I always wanted to do more than just write a guide. I won’t tempt fate by describing what I have in mind, but finding a proper home for it all was the first step.
Enter KubeKitten V0 - Literally Just The Guide Edition. It’s been brought out of ‘beta’ (whatever that even meant lol) and fleshed out to the point where you have a functioning cluster ripe for deploying stuff on.
Unfinished chapters are hidden
Hetzner price estimates have been updated
A new section on auto-managing your domain with `external-dns` is added
To my mind, that covers most of the useful basics without falling into any rabbit holes. This means that the focus for future updates will be similar to the chapter on observability and monitoring: adding things to your cluster that are either interesting or useful.
To give an idea of what’s coming (timeframe: it’s done when it’s done), I’m interested in covering:
Hosting an SQL database
Setting up a private docker registry
Capturing analytics
Managing secrets
Automating deploys with CI
Stay subscribed to find out when these go out! 😻