Why use Kubernetes?
I started learning based on the intersection of how popular the word 'scale/scaling' is in job postings and the recommendation of an acquaintance of mine.
At first, it was fustrating. Lots of material talking about kubernetes and not a lot of detialed information on it.
- Learn Pods
- Don't use pods, use Deployments
- Learn Delployments
- Learn services
- Don't use commands. Use yaml files.
A lot of newbie tutorials take you to this point. But where are the definitions for the yaml files? Plently of examples to be found all over the internet. The kubernetes configuration is a language where is it defined? The api reference.
Sorry soapbox moment
The api refernce was what I was looking for, sort of, but terrible. It includes a bunch of stuff that you don't write in a yaml file such as status sections, those are purely for information in an actual api call to the kubernetes control plane. It is a huge document with some annoying styling choices such as: the sidebar isn't resizable. The content boxes are not resizable. There is no link to the reference for older api versions. You have to change the version in the url and then the styling gets even more broken. Every time you click on a link to a different part of the api reference it scrolls to the right about an inch.
The Journey to the answer
Ok. Here we go.
- I found the language definition
- pushed through the annoying accesiblity issues and made flash cards from it
- wrote config files for this ghost image, a matrix server image, with mysql and postrgres databases for each and little parking page
I had a great start on learning and using kubernetes, but why? I could accomplish the same thing with a small vm that had git, docker, and docker-compose. The night I got my synapse server working I figured it why kubernetes. The matrix protocol, unlike a lot of chat protocols that just relay messages, save the state of room and all particpants need to agree and the state. If you join a room, then you need to sync/download the state of that room. I joined the synapse admin channel on matrix.org, and my server started to synchronize a big public room. The load my synapse server put on the smallest vm I could use in GKE kept crashing. I added a new node pool to the cluster. Deleted the old node pool, and my synapse server synced and stablized. Kubernetes had allowed me to install hardware into my software.
You have to literally write dozens of configuration files. It seems like most of them are in beta, like ingress, and storage. Therefore change often with current solutions that stopgaps. However, once you write all the configs and the docker images, you have described how you want a running instance of your software to look, and kuberenetes will do everything it can to keep it that way.
I read Nigel Poltoun's Kubernete's book Its a nice introductory lecture, but you could probably just watch all the free youtube "What is kubernetes?" videos.
I am currently reading Mastering kubernetes I'll write a review once I'm done, but its already been really handy with the persistent volume ecosystem.
And lastly you can find my kubernetes config files in my git repo