You probably do not need Kubernetes
Kubernetes always seemed like a decent solution for very specific purposes but it’s increasingly becoming seen as a way to deploy everything. I don’t think this is a good idea.
An employer of mine had made the transition from AWS autoscale groups / EC2 instances to Kubernetes clusters and it’s been nothing but painful. Any cost savings on hardware has easily been spent on developer time and additional software / tooling and the end result is a setup that is far harder to develop, test and debug.
I won’t cover all the specifics that others have already covered. Might want to read:
- Why Does Developing on Kubernetes Suck?
- Corey Quinn’s opinion on Kubernetes
- Has Kubernetes Already Become Too Unnecessarily Complex for Enterprise IT?
- No one wants to manage Kubernetes anymore
Or simply take Amazon’s optimisation guide. Aside from noting you need to be careful about how you construct your container, what you may have missed, is the whole concept of Kubernetes means minimal environments. So in addition to it being more painful to get into the pod, you’re not missing the tools needed to diagnose things or not and you’re creating larger images and adding complexity.
Want to run cron jobs? That’s now no longer straight forward and at best you’re writing your cron jobs in YAML and that assumes you don’t want it in the pod which is turns out a lot of people do want.
You’re simply not going to get away from network problems. If anything you’re going to create more.
I think one thing that people see as a benefit is it hides bad code. Services can fall over and come right back up. There is a cheap solution to this. Write good code and tests. Masking problems rather than writing good code is not better for users of the services.
In the company I mentioned, we process millions of events per second within some teams. It’s the sort of “big scale” company everyone talks about and to be honest, most services stay up as long a new release doesn’t go out which can be months now that things are more established. Any scaling is often only done for peak periods of the day. As services are now spread amongst regions and US services get deployed in the US and EU services in the EU, this means those peaks often only come once per day and can easily be served with a fairly basic scheduled auto-scaling group. We wouldn’t have had to pay the added performance cost of containers too.
So, please consider if you really need to have Kubernetes, ensure you read up about it and when you are migrating existing services to Kubernetes just accept it will be painful and costly even if it is the right thing to do in your scenario.
Whatever you do, don’t use Kubernetes simply because it appears everyone else is using it and it’s the cool thing to do.