Comparing K3s with vanilla Kubernetes
hoelzel.it
hoelzel.it
I checked the apps of a bunch of clients. None of them loaded. I was like what...
I checked the server. Everything down.
I'd been running Kubernetes on Digital Ocean. And Digital Ocean forced a Kubernetes update that was incompatitable with mine at night.
Took me 8 hours to fix it. No sleep. Ended up moving it back to a good old VPS. And throw away K8s.
Now to be fair, I had been getting warnings with deployments. But I was used to that, Kubernetes has 10 updates per week. I dont have time to update K8S or my helm files every week.
So yeah it was my fault, but I was used to good old VPS hosting. There is an old php application I've build 5 years ago with Laravel, that never needs anything. I did some updates and patches, but it always just works.
Im used to running node on apache or nginx, even though a bit less stable, still almost never crashes.
Kubernetes there is always something. I guess there are reasons to choose it, but it's not stability.
I ended up taking the plane, and my daughter was super kind and patient. But no more kubernetes for me.
have a look at k3s and maybe you will like kubernetes more again. There is no magic to it. Have a faulty node? spin up a new one.
And if your hoster is kind enough, there will even be apis with cloudinit for you to do that.
Im not trying to imply that you need a managed k3s with this post, but rather trying to show how easy kubernetes can be if you leave the big clouds and try not to overcomplicate things.
After dutifully updating EKS releases and AMIs it seems to have fixed itself last year.
EKS seems to be fine generally, but it would be nice if they didn't release new AMIs with missing commits?? [1] and especially [2]
[1] https://github.com/aws/containers-roadmap/issues/319
[2] https://github.com/awslabs/amazon-eks-ami/issues/278#issueco...
Been running managed Kubernetes in GCP for years without any issues.
They are bugging me to update for some time now, but I don't think they would force an update on me.
How do they test that across the infinite number of permutations of configurations and deployments of K8S in the field though? It'll work for some people on the happy path, but it's really hard to maintain over time. Worse, it'll break randomly at some point in the future that is hard to predict, instead of at some publicly announced point in time where the breaking change is deployed (how it happened this time).
If you want a Kubernetes cluster that never gets forcibly updated or shut down, you should not be using a managed service, period.
I once tried nomad because it claimed to be simpler. I stopped when I realized I’d also have to use multiple clusters to run a cluster (nomad+consul).
I use k3s because I build apps for multiple clients and I like the flexibility that it gives me in running servers like cattle.
My point is that these orchestrators need to start decreasing the enormous amount of risk they add to any project.
Still worked on my test cluster. It was a throw away site, so I didn’t even bother fixing it. And, I honestly can’t tell you what went wrong. Just deploying docker compose, often with ansible, is the most reliable for me at most scales.
When going in I assumed there are some kind of standard way to implement ingresses/loadbalancers but no, it's just different plugins each with different syntax and features.
1. the project claims to be production ready and support HA control plane setup, but there's no solution for API load balancing out of box. How do you bring up a new node(either control plane or worker node)? You write down the join token produced by the first control plane node, and hardcode the token and the existing control plane's IP in the new node's systemd unit file. Btw, if you use the official installation script, that file is going to have permission 755 and everyone on the server can just read that token.
2. And how do you bring up the first control plane anyways? The official instruction is to `curl` a bash script and pipe into a shell. You can probably translate that script into some ansible playbook, but the whole running-a-bootstrap-script-and-passing-along-secrets approach make the whole process difficult to be converted into some something that's supposed to be idempotent.
All the problems can be worked around, in fact I was half way there, but then I suddenly started thinking: "didn't I choose k3s because I thought it was easy?"
1) Your main problem though would probably be the need for a haproxy or bgp which does load balancing for you. There are other solutions like kube-vip but they are more a "failover" solution that HA. Which would be fine for a homelab and is for instance how Rancher Harvester (kubernetes for virtual machines) does it.
2) you have to pass a parameter called --cluster-init for the first node and then join the other nodes. once the cluster is running you dont need any node with that parameter anymore and its common practise to create the first node wiuth --cluster-init then join 3 other ones and take down the first node
And on a personal node, you sound like you would be happy with rancher harvester. check it out its bascially turnkey
I know there are solutions to my problem, but I can either implement them by myself, or like you mentioned, I can just use a different distribution and not having these problems.
turn up the first node, install kube-vip, switch config to point to the vip, turn up all my other master nodes, then turn up my workers, install metallb, setup my subnet, install rancher, expose it with a LB, install longhorn. then start deploying things. here is an example of what i use to turn up the first one with k3sup. all of the servers are turned up and configured with ansible doing minimal updates, users, sudo access, etc..
k3sup install \ --ip=192.168.1.11 \ --user=k3s-user \ --sudo \ --tls-san=192.168.1.10 \ --cluster \ --k3s-channel=stable \ --k3s-version=v1.24.12+k3s1 \ --no-extras \ --k3s-extra-args "--flannel-iface=ens160 --node-ip=192.168.1.11" \ --merge \ --local-path $HOME/.kube/config \ --context=k3s-lab
Knowing what NOT to investigate because it isn't "ready" can be one of the biggest time sucks.
Why do you need this in a homelab?
1. My homelab has a lot of crappy hardware with zero enterprise support. And when a server fails, I need to be able to easily swap it out. And I don't want to make it a full time job for myself to maintain it.
2. I did knock some control plane nodes down a few times. It was rare, but still not fun.
3. Also, because why not? HA control plane is not particularly challenging these days. I know exactly how to do it. I just don't have the bandwidth to learn how to do it in k3s, especially when it comes for free in some other distributions.
The fact that you can integrate existing Sysadmin Teams because they will understand that a program that runs a service with a binary and a config is all it takes, is worth its weight in gold.
They know their Loadbalancers and haproxies as well as how to provision true raid systems that are not software based which almost makes disk failure go away and maintenance really sheduleable.
Of course, other stakeholders and constraints may eventually mean that we adopt something else before it gets implemented, but K3s is what I start with for many of the same reasons outlined in this article.
Folks might also be interested in two free resources:
1 - K3sup https://github.com/alexellis/k3sup - the author mentions HA K3s - K3sup is an easy way to get that using SSH. It's also a good pairing for K3s with Raspberry Pi 2 - Kubernetes at the Edge with K3s (CNCF / LF course) - I was commissioned to write this and I talk a lot about the differences and also the origin story of K3s and what Darren was aiming for.
Have fun with Kubernetes - whichever flavour you go for.
What you might be trying to compare is kubeadm which is the official deployment stack provided by Kubernetes.
im not trying to compare it with kubeadm (which is a more a setup script https://kubernetes.io/docs/reference/setup-tools/kubeadm/ ) but with the fact that vanilla kubernetes comes with moving parts that have to be configured and maintained and also updated separately.
you can actually setup "kubernetes" which is often referred to as vanilla kubernetes without it too. See "Kubernetes the hard way" by kelsey hightower.
But in general k3s can be HA without issue and scaled just as well as vanilla k8s. The main advantage of it is that everything comes neatly packed into a single binary whereas the alternative would mean to have a multitude of services running for cluster provisioning.
Kubernetes in the end is basically an API server with multiple componets and k3s puts a nice bow around all of them.
The whole "kubernetes-lens" debacle still burns deep.
I have suggested it to basically everyone working with k8s saying its a must have tool and also made many teams install it.
It was a great time for half a year and a lot of the community contributed to it, only to have them turn around and force accounts on all users: https://github.com/lensapp/lens/issues/5444
this turned into an application that now comes with a signed hidden binary, could not be build through the open source repository any more and much ohter things related to this.
All in all Mirantis is not to be trusted, not to mention the fact that the tool wants to share your kube-config amongs your team which is a clear antipattern and a high security risk.
You can start with a single storage node without replication and easily go from there to triple replicated storage
Just make sure to remember to set it as the default storage class.
k3s is a kubernetes distribution
What would have been a better title for you?
> Kubernetes and k3s are both container orchestration platforms
Your article makes it seem like k3s and k8s are different platforms which is simply incorrect.
A more useful comparison would have been to compare k3s with another distribution like EKS, GKE, OKD etc.
in the linux context, a distribution would be an opinionated build of user-land tools around the linux kernel which might also bring patches done to the kernel by the distributor.
in the (cloud) kubernetes context, a distribution would be an opinionated (cloud) implementation of core kubernetes binaries (EKS/AKS/etc.pp.) on top of a linux-distribution of your liking.
to my humble understanding k3s is a stripped down and optimized (IMHO opinionated) build of kubernetes binaries derived from the official source.
kubeadm is the official projects (opinionated?) idea of arriving at a vanilla cluster, leaving you with the freedom to make choices for lots of the needed components involved.
in the linux context, „linux from scratch“ would be an analogy I suppose.
more knowledgeable people should please correct me if I‘m wrong in my understanding here.
"Our name is literally a complex joke about complexity" doesn't inspire confidence in a project that supposedly simplifies complexity.
On the bright side you can put whatever you want there. Personally I read k3s as "kerts", because why not. Similar to "thirds" but with the "t" from kubernetes.
k3s is a pared down version of k8s, which is illustrated by the number 3 being chosen because it looks like an 8 sliced in half.
"What's with the name?
We wanted an installation of Kubernetes that was half the size in terms of memory footprint. Kubernetes is a 10-letter word stylized as K8s. So something half as big as Kubernetes would be a 5-letter word stylized as K3s. There is no long form of K3s and no official pronunciation."
k8s -> k3s
Double numeronym'd
We wanted an installation of Kubernetes that was half the size in terms of memory footprint. Kubernetes is a 10-letter word stylized as K8s. So something half as big as Kubernetes would be a 5-letter word stylized as K3s. There is no long form of K3s and no official pronunciation.