4 ms·
People keep saying k8s is so complex and the learning curve is steep but I honestly struggle to see it. The only hard part about k8s is setting up the cluster i
by Draiken 8y ago
People keep saying k8s is so complex and the learning curve is steep but I honestly struggle to see it. The only hard part about k8s is setting up the cluster itself. Using it is so easy it boggles my mind how can someone say it's hard.
It's a simple API with an amazing CLI that immediately solves dozens of issues you would have sooner or later.
Take for example a very simple rails application. I'll keep it simple with 3 routes: manual, automated and with k8s (assuming you're not building the cluster itself).
Manually setting up would require you to:
- Create a VPS
- SSH into the VPS
- Install at least Ruby, NGINX (or some webserver), the DB and all Rails dependencies
- If you want easy deployments you'd probably use something like Capistrano and have to set it up
- If you want the system to be resilient you will have to add some sort of process monitoring and automatic startup
This is very easy to get wrong. One missing step and you're having to manually SSH into the machine and trying to figure out what went wrong.
An automated setup would essentially do everything you did on the manual setup, but you'd have to write that into something reproducible like Ansible, Chef, Puppet or similar. Every single one of these tools has a gotcha and a learning curve and that's on top of all the base knowledge of setting it all up by hand.
Finally with k8s (assuming we're using Google's GKE offering):
- Dockerize the app (which is extremely simple with tons of tutorials)
- Download the gcloud CLI (alternatively it can all be done through the website if that's your thing)
- Create the cluster
- Either create some manual yaml files or just use kubectl to create a deployment for: rails, nginx and the database (again, there are millions of examples of this even on the official docs).
- Create an ingress and point my DNS to the ingress' IP
All of these methods have learning curves and are in many ways complex. However I don't think Kubernetes is a lot different than the others. It's just a different way of doing the same.
* Instead of manually finding out how to setup load balancing and reverse proxying on NGINX, you learn how to use the k8s services.
* Instead of setting up Capistrano (or any other deployment tool) you learn how a k8s Deployment and rollouts work
* Instead of figuring out how to setup L7 load balancing you learn to use k8s Ingress
On top of all that with GKE (or any other managed k8s solution, I presume) you'd automatically have: logging, metrics, scaling, rolling updates and much, much more.
People are resistant to change and it's definitely not an "one size fits all" situation, but as soon as you need anything beyond an amateur website, k8s provides the best ROI. I've had to do this on all of these scenarios and I can confidently say Kubernetes changed the game.
I got a 10 year old Rails application with tons of dependencies from an old dedicated server setup to Kubernetes on a few days (on Kubernetes 1.1 at the time, which was a lot harder) and I'm not some kind of genius. If I can do it, any developer can.