Kubernetes for Personal Projects
2019-12-29
This post explains why I was not using Kubernetes for personal projects. If you are reading this post trying to set up Kubernetes, it will disappoint you.
Yesterday, I saw a very cool self-hosted project (anki-sync-server) and I would like to host it myself.
It had happened to me repeatedly that I hosted something (e.g., Wordpress) and ended up abandoning it. It was mostly because I forgot the machine setup or how those apps were configured. They became burdens, and I killed them to save hosting costs.
However, technology keeps evolving! We now have Docker and Kubernetes for running portable containers. Configurations can be stored as Dockerfiles in a git repository. The apps can be restored accurately. How cool is it to own a personal cluster? How cool is it to be able to launch random Docker containers in the cluster? It is just super cool, at least from a software engineer’s perspective.
Hence, I decided to set up a Kubernetes cluster on DigitalOcean this afternoon. My goal was to set up a cluster that allows me to launch whatever containers as easily as possible. My direction was to set up Ingress and IngressController for routing traffic to the right pod. If possible, I would try using NodePort instead of LoadBalancer to avoid the extra $10 per month.
A few hours passed, I took a pause and went for a run. During the run, I decided to give up. Here are the reasons.
First, the learning curve of Kubernetes is steep. That means the re-learning curve is also steep. Imagine that even if the cluster is set up today but I do not touch it for a few months (because I focus on other things later or life just does not allow me to spend more time on it), it is very likely that I will not be able to maintain it without going through a steep re-learning curve. It will likely become another burden that I choose to get rid of, again. The time I spent on setting up the cluster is gone.
Second, it is expensive for small projects. Do you need a load balancer for an app that has very little QPS? It is simply overkill. You might argue that it is possible to avoid the load balancer. However, these solutions (like setting up an extra Nginx with a public IP as a proxy) are hacky to me. Hacky solutions increase complexity / maintenance cost, and thus it is more likely to become a burden in the future.
Everything comes with costs; the biggest is time, simply because it is limited. When you choose to do something, you are giving up another at the same time, inevitably. As of now, my priority is no longer playing with those self-hosted services. Kubernetes is nice and all, but just not for me at this moment.