medhir

personal k8s setup

I promised that when I first started this site that I would write a follow-up post about how it’s structured.

What started out as a single virtual machine on Amazon's EC2 has turned into a collection of services managed in a Kubernetes cluster on GKE, and the whole thing looks something like this:

medhir.com software architecture diagram

The main entrypoint of the application is through a service written in Go, but I also maintain an authentication server and an instance of Gitlab to manage source control & continuous deployment of the code that's written.

All the virtual machines in the cluster are pre-emptible, meaning they won’t last more than 24 hours at a time. This keeps costs low, though there is some trade-off on availability (Gitlab sometimes gets into weird states when VMs get killed). If there ever comes a point where I really need to have less issues (doubtful), there’s always the option to pay more for regular VMs.

Is all this overkill?

Some people will probably look at this and scoff at how much is going on. It’s totally not necessary to start a Kubernetes cluster for a blog site! In fact, you probably shouldn’t!

Software design decisions depend greatly on the context. I've used "writing a blog" (perhaps better stated as building a blog) for quite some time as the stimulus for learning new technologies . Some things I have learned since first beginning work in 2018:

  • Go, the programming language
  • Creating containerized applications with Docker
  • How to contribute to other software projects
  • Various cloud services from both AWS and GCP
  • And of course, Kubernetes, for managing the various things I need to deploy in a fault tolerant manner

Slow, incremental progress towards building / designing my own system from scratch has resulted in lots of knowledge that is useful in other domains.

While this system is downright extra for one person writing a couple of articles a year (aka me 🤪), it has become a foundation on which I can build more interesting things.

In the near-ish term, I’m working on building an interactive programming course that goes beyond the usual tutorial content by integrating an IDE directly in the browser. Here's a preview from some proof-of-concept work I did in January, which shows VS Code running on this site:

image

I have the problem of having too many outstanding side-projects so it’ll probably be a while still before I have anything I can put out in front of real users.

I do hope to build something that really engages learners and show what programming courses can look like in 2020. There is, however, a bunch of work to be done... 😳

Stay tuned I suppose!