A story about a Kubernetes migration
medium.com
medium.com
As an example, they suggest that there's a heavy cognitive load associated with having devs run some Ansible playbooks, and then argue that to avoid that, they just have to introduce an entirely new toolchain via workshops and tutorials. Right.
Scaling applications in k8s, updating, and keeping configs consistent are a great deal easier for me than using Ansible or any other config management tool.
In the end, it's a singular platform that one can build tooling against that allows an organization to abstract away the infrastructure. My team has done that (on top of k8s). As such, a developer can spin up a new environment with the click of a button, deploy whatever code they like, scale the environment, etc. with very little to no training. Those capabilities were a tremendous accelerator for my organization.
Sure, you can build something similar with Ansible on AWS, but then you're married to AWS, you have to worry about sizing, and the cost of idle instances. In my experience, it's just a great deal more overhead.
I'm running a production service on EKS, also tried it on GKE. Both take away most of the cluster management pain.
Kubernetes is great, but you're not being honest with yourself if you can't acknowledge the difficulty in going from 0 to production-ready. There is a ton of complexity and lots of grief on the path to a fully functional k8s environment.
Migrating between the two isn’t even all that difficult if you change your mind later.
Creating a cluster is a one-liner, no Ansible required. The node pool comes with that, which sets up the hosts. Databases are all created in cluster with a helm chart.
Many people will advise against running stateful workloads in k8s. It's tricky, sure, but the benefits are still there.
As a result of the orchestration my team has built on top of k8s, any developer in my organization can clone any production environment at any time with production data. Those cloned environments can be configured to receive streaming updates from the production environment, once created.
Developers can test bug fixes and features on live streaming production data with absolute certainty that they won't break anything. This capability is immensely valuable.
Swarm is much easier to reason about and run. It's a godsend for startups without dedicated devops.
I have dreamed a dream, but now that dream is gone from me.
I'd strongly recommend using a hosted k8s - either GKE, EKS, or I believe digital ocean have just released one.
If you want to use an existing VPS just to test it out, see the docs here https://kubernetes.io/docs/setup/independent/create-cluster-...
Once you have the cluster running, kompose[1] might be a nice tool if you're used to using docker-compose, however I'd say just use it as a guideline - you'll probably want to rewrite most of what it generates at one point or another
On the other hand EKS offers what I'd call a "managed kubernetes master", everything else is still pretty manual.
My team has deployed in AWS using KOPS and EKS, Azure with AKS and ACS-engine, and GKE in GCP
GKE is far, far easier to manage, update, etc.
The one downside is that it doesn't have a feature complete UI and there arn't any good ones out there that do what the Kubernetes webui does.
But so they managed to consolidate their infrastructure around Kubernetes and Google Cloud which made the management of their servers easier and faster? I wonder how much actual money they saved but I guess it will pay off for them in the long run.
I've been dabbling with Kubernetes for some time now but God forbid it can be a bit complicated. Time required to become well-versed with Kubernetes is a hefty investment which is not for all organizations. Lots of small things that can drive up your blood-pressure when figuring them out. Were it simpler I would be much more inclined to be using it but now it's only in the "learning for funsies" -category. I feel people who've developed k8s have been more of the theoretical sort and not the regular-joe-dummy-kind like me.
Even their documentation can't keep up. And with a release cycle of 3 months, and a deprecation cycle of 6 months, you need a team dedicated to keeping up with K8s state-of-the-art; so much of that knowledge you picked up a year ago is at best stale, and at worst wrong.
Sure, it makes setting up and keeping a set of containers up simple. But that's never really been that hard.
To paraphrase an article from a few weeks ago:
"We made microservices to address the problems with monoliths."
"We made containers to address the problems with microservices."
"We made Kubernetes to address the problems with containers."
We transitioned out of AWS where we had relatively well managed instances of our stack managed with chef and terraform to GKE in Google Cloud where we migrated to a helm chart and custom orchestration tooling on top of that.
Prior to the migration I'd say that 80% of our instances were idle. Currently, all of our k8s nodes with 16 cores are running with an average load 5-7. We try to keep enough headroom to prevent any waiting or queuing, which is an entire medium blog post unto itself.
So, roughly the same or a little more "production" workload, but the number of non-prod instances of our stack quadrupled. Anyone in the org at any time can spin up an instance of the stack for a custom sales demo, to debug an issue, to test a feature, or anything else. There was a great deal of pent up demand that nobody expected and which caused my team to thrash a bit to catch up to when we made the transition.
All in all, our GCP spend is about 20% less than our AWS spend was. We're getting a lot more utility for a little less money.
More typical is Team A working on Project A spin up a test DB + test app server. Team B also spin up a test app server + web server + DB for project B
Then Project A gets productionized and you have SIT/UAT/Stage copies of all of that sitting mostly idle.
Then project C comes along and the devs need to test on a 3 node C* cluster with 3 kafka brokers...
Suddenly you have a whole bunch of dev environments sitting mostly idle. No-one would ever fork out on reserving a t2.medium, but they all add up to $$$$$ every month. With k8s you can reclaim all that idling power, reserve some beefy instances, whilst also gaining easily deployable artefacts, CI/CD, production scaling, etc.
There are other things to like about GCP vs. AWS, but that's a bit tangential.
We're not on production yet, but moving soon.
I always preferred ansibles to kubernetes yaml
I'm using both daily and can work with either though
If someone is authoring Ansible playbooks this way, this is definitely not a best practice. Code should go into modules, plugins, filters, etc. Playbooks should be YAML, with extremely minimal use of any coding constructs.
Do kubernetes files really concern themselves with little details such as how a database or application is configured ?
I assumed that kubernetes is more about having 'images' of pre-installed machines (e.g via ansible) and having kubernetes just 'clone' them into production and interconnect them.
However, those images typically will be unconfigured aside from sane defaults. The final configuration (connecting an application to a database, etc) is indeed handled through Kubernetes.
The one pain point, for me, is still the development workflow, which is still lacking compared with told like docker-compose.
However, skaffold seems to be quickly closing that gap and I'm pretty excited about it.
Hah. I'm a huge kubernetes fan but not sure I can agree here.
k8s yaml files are the most verbose and spammy things imaginable.
granted, ansible playbooks can be horrific, but i'd say that's more down to the authors of the playbook than ansible itself.
Kubernetes resource definitions are verbose, but you can expect them to always be about that verbose and nothing else.
Ansible playbook instead really depend on the author, they can both be works of art or abominations.
It's more of an issue with your organization's (or in some cases, personal) process if you allow abysmal code to get checked into your codebase :) Even Ansible has easy to integrate linting and testing tools.
K8s is designed around a desired state of the world with control loops.
The two are very different conceptually, and lead you in different directions organizationally.
Ansible encourages you to code the derivative and hopefully approach the integral, whereas K8s encourages you to code the integral and infer the derivative in your controller, if that makes sense.
Note: The 5-15s DNS problem seems a pretty serious one. Weird that it didn't get more publicity (and a proper fix).
My personal rule of thumb is that unless the client specifically need auto-scaling or have more than 100 services to run, have a 5 people devops team, just use Terraform.
For a small number of servers a better strategy is to have a base image with Docker and monitoring, and use Terraform to deploy the infrastructure. CI can then use docker-compose to deploy the containers onto the hosts directly. This approach is much more stable and doesn't require to learn as many things as K8s. This can be run by a 1 man DevOps team without a sweat.
Using TCP as the main message bus then using layers upon layers of NAT needs to be revisited, routing is the solution.
A lot of cloud providers now have a way to easily deploy and manage a k8s cluster on their servers but I cannot find a tools that help with the deployment of a basic service, something like dokku but on Kubernetes.
Let's pause a moment and appreciate that if you have a DevOps team, you're not doing DevOps.
https://akomljen.com/protect-kubernetes-external-endpoints-w...
(As it is, I expected it to be about migrating k8s version. (Still much better than OP though...))