The 3 ways of K3s
Speaker: Nuno do Carmo
Summary
Nuno do Carmo introduces three ways to run K3s: K3D, which excels in CI/CD pipelines with its impressive CLI; Rancher Desktop, offering full-featured Kubernetes on desktops with a UI and control functionalities; and Civo, a community-centric platform using K3s for their Kubernetes service with transparent pricing.
In this Navigate NA 2023 talk, he emphasizes the utility and flexibility of K3s, encouraging the audience to explore these tools themselves, as they can adapt to various use cases. His presentation underscores the importance of understanding and leveraging these Kubernetes technologies.
Transcription
It will be a demoless presentation but it will be a presentation and hopefully, you will have fun. So, my talk will be on the 3 ways of running K3s directly. No, not practically, just believe me, it works.
But wait, I lied already. There's 4 ways to run K3s. Okay, sorry, there's a bit out here.
It will be actually only a talk, not demo. So, here are the waypoints that we will go through first. introduction about K3s, what is the architecture behind, some use cases because yeah, it's nice to have a project but what for? And then, we will deep dive into K3D, Rancher, and Civo. I counted 3, the 1st. Well, it's k3s itself because K3s can be installed on a bare metal. So, my name is Nuno do Carmo. I'm a tech writer for Suze, the Evangelist is not here so I can tell it my way, Suze, and I'm known as the Corsair because this talk, I've already given it before. I will ask my partner to come which is Saiyam normally but is not here so we will just have the second best which is Scion GPT. So, it works at Civo and is leading the Kube Simplify Community which is great. And again, this is fiction, so just enjoy. All right, so the first one, it will be the three points here directly so we will talk about K3s itself.
All right, it doesn't be super. It's a PowerPoint on a Mac so excuse this shouldn't be doing that. That's nice. Okay, so what's K3s? K3s is actually a CNCF Sandbox project. So, it has been created by Rancher and given to the CNCF years ago now. And it's a fully Kubernetes certified distribution. What it means is like it pass all the tests that needs to be passed actually to be certified by the CNCF as a Kubernetes distribution.
Now, I will let you read everything. The really important point here is like it's not a fork of Kubernetes. So, if you think about Linux, think about like Ubuntu and Kubuntu or Lubuntu or Xubuntu or whatever, it's a flavor. Okay, it's not like Ubuntu and Debian. So, it's not a fork of Kubernetes. What they did, and they say 'they' because I'm not the inventor, I'm just a tech writer, so what they did is they took out a lot of these Cloud plugins that might come with Kubernetes that are a bit bloated for local deployment or at edge deployment because you might not need the Azure CNI Plugin or the Azure compatibility or whatever, they have plugins, Amazon or whatever. Okay? So, it's a single binary which is kind of nice so you can just download the K3s and run K3s. It will bring some tools with it which is CRI, CRI CTL, so you can just do a K3s space CRI CTL and something, Okay? That's why and the battery is included. Okay, it will be along the top but it's like it brings everything that you need to be up and ready by default. So, it's not secure, okay, it's secure by default but it's not that secure. It's not that configured but by default, you will have several tools that you can just simply use kubectl and deploy applications against it.
So, the architecture, there's, I will speak about two architectures. Along the slides, you will see that the docs are mentioned, not the website because I'm a tech writer and the docs are better than the homepage. Anyway, so here it's a single note approach where we have like okay, not sing along but single server, single control plane with the database embedded which will be SQLite by default. And then you can attach like three nodes. We will see actually we won't but I have demos here if you want to see it afterwards. So here, you can deploy like three nodes and it will connect to the control plane. And then, you have your worker nodes and at the far side to the right, you can see that there's also the load balancer so your applications are accessible from external.
Then, we have a little bit more complex architecture which will be a multi-node. HA so high availability. Here, you can see that you have like the load balancer could be Kubevirt for example. But you have an external load balancer that reaches like the three control plane nodes first. So when you do a `kubectl` command, it will reach whatever control plane is active, and then it will connect to all the worker nodes. And finally, you have the load balancer on the end that will actually let you reach your application. Now, the external database. There are several, everything is described in the docs. It can be `etcd`. That's the preferred nowadays, it could be MySQL or whatever.
The use case. So, the use cases are like K3s was built to be small, really small, optimized. So the first thing that we have is edge cases. Now, edge cases, it's not only Raspberry Pis on your desk or smaller devices. It can simply be other hard to get or with lower storage, maybe high compute, like wind turbines for example. The storage might not be the biggest thing. So, you can have like K3s deployed for this kind of edge devices. Of course, it's not the main point but one of them, it will be IoT, so Internet of Things. Here, the smaller it is, yet powerful, we are still limited in terms of power. Even ARM is getting bigger, like Cheryl will show us, but still, we are still limited for certain devices. So here, K3s is really good at fitting the environment it's installed in.
Yeah, so that was written by SaiyamGPT, by the way. But so, K3s because of the simplicity, right. I don't know if anyone read the Kubernetes the hard way by Kelsey. That's the opposite of the spectrum because you just download one binary and you run it. You don't have to create your cluster from scratch, which is good to do once in a while, like Linux from scratch is the same.
But anyway, K3s can really be adapted to your use case. There are others, of course. I won't speak about them, but there are others that might be in the same realm. But K3s really grew to be, I'll say, almost on par with the Kubernetes distribution nowadays. There's a lot of projects that actually use K3s as the backend, Civo being one of them still.
Alright, so K3d. Read it, I mean K3d does all. K3d was created by Torsten Klein, a community member that worked at some point as a contractor for SUSE and now he's on his own but still maintaining the K3d project. K3d is really used a lot, especially on CIs. It's typically the nice demo that I have on my laptop that you cannot see, will also leverage some capabilities of K3d.
Over time, K3d evolved to be more like a Kubernetes management to the point that you can create a multi-node HA. Now you have a load balancer and for the ones who know Docker and how ports opening occur normally, you open the ports before you run. On runtime, you are like kind of blocked with the ports opening. Well, K3d did some magic now that you can open ports after the cluster is created without the need of destroying the cluster and taking the cluster up again. This is quite nice actually, okay because you will gain time.
The magic is that they created a load balancer node that you don't see when you do a `kubectl get nodes`. You won't see it. It's a pure K3d feature and this node is the one that is being recreated on Docker. It will get crashed, get up but you don't see it on your cluster, and then the port is open from a Docker perspective. So there's a two-layer abstraction here. We have the Kubernetes that sits on top of Docker and that's important, it's only Docker runtime, it's not containerd yet, but it's still in a container and then finally the container is the one with ports open. So that's why they had to create that.
There's a really nice CLI that was created since day one. On version five though, they swapped the verb noun non verb, okay so before it was like kind for example it was `k3d create cluster` and now it's `cluster create`. Believe me, these small changes are not really small because if you have scripts, you have to change them. That was one of the features that was the most criticized. Now it's okay, but at the time, you could speak about whatever else but because the verb noun was changed, then swapped, people got crazy.
Alright, so I think it's okay. Everything was, and yeah they used again like HVS, they use the load balancer is the Nginx. The one node that I said, it has the Ingress with Traefik and the backend DB is the embedded one. Remember the first example, which is SQLite.
All right, Rancher Desktop now, it's more into my realm.
So, Rancher Desktop, first of all, who uses Docker Desktop? That's great. I'm a Docker Captain by the way, so working at SUSE. So, it's like I have a split personality right there. But, Rancher Desktop was created before, that's important now, before Docker Desktop implemented the subscriptions. So, the fact that Rancher Desktop came out at the same time as a subscription model for Docker Desktop, and everyone wanted to swap or switch, whatever, pure opportunity, like pure luck. And I swear, that's just not me being SUSE here, it's pure luck. And the thing is like, everyone thought that Rancher created Rancher Desktop because of that. No, Rancher created Rancher Desktop initially. Now mind the words. Already without a demo, seriously? Wow, okay, so I wouldn't have time for them anyway. I will speed up then. So, initially, they created it to have a nice and full-featured Kubernetes distribution on your desktop. Okay, easy to manage with the Rancher dashboard potentially attached, and so on. The sources are fully open, which Docker Desktop is not. I won't shoot too much onto the Docker Desktop. I love it, but Rancher Desktop is fully open source. You can get to the slide and everything, battery included again, because it's K3S.
We were the first, however. So now, it's going back and forth. We were the first to have like the three OS's. How many wanted Docker Desktop for Linux? Potentially like some capabilities on Linux and we didn't get it. So now you have it. But first, Rancher Desktop was there. And there's a management of Kubernetes, so we specialize in Kubernetes on the desktop. If you use Docker Desktop, or potentially yeah, Podman is a bit different yet, but you have like the latest version of Kubernetes, you cannot choose. When you are developing your application, you want to target a specific version. With the Rancher Desktop, you can do it. 'kubectl' latest is a no-no in all aspects of development when you deploy, so here you can set your version.
It cannot do multi-node officially, that was part of my demo. So if you want to see it, come to me after. And there's now, okay, there's the UI of course, but there's also a 'rdctl' or control or whatever, 'kubectl', that is part of it. Finally, Civo. Okay, so again, that was Saiyam GPT that wrote it, so I'll let you just read it. But Civo, since its inception, I will just mention one really important thing, they are pro-community, believe me. So you can get your $250 now, code, not the course, no code actually, but you can get it for one month. You can try it out, especially now with all the announcements. There's other, apparently, there's other Kubernetes runtimes that they are implementing. But stay on K3S, show them K3S love.
And one thing that is really important is the third before last, the transparent pricing. When I deploy, I spoke with another cloud provider, but when I deploy at Civo, I know exactly how much it will cost me, like it's pre, it's on the page of creation. Others still have calculators, and I'm not speaking about the big three, I'm speaking about other cloud providers where I just deploy and it's like, well, Inshallah, let's see how much I will get.
Yeah, and therefore there was this last point that you will never see because it's on my laptop, and that was all the chat that I was for you. So let's just enjoy the chat please, and that's all.
So, SaiyamGPT was about to help me about how to run a demo. The first demo was how to run K3S on a Civo compute node, and that's quite easy. That is the commands. You can use a project called Ketchup, actually that's how you spell it, by Alex Ellis, big star. And that's the command, that's all. So, it works in my demo, not on my computer, in my demo. Okay, so then SaiyamGPT actually knows that we are at Civo, navigate, I don't know how, and okay, so it tells me to deploy on Civo, this is the command actually.
Oh, okay, sorry, two minutes, that's on me. I will give you chocolate again. So, this is really short, as you can tell, nothing as Azure or AWS CLI, or whatever, even maybe Digital Ocean, I don't know, they're getting there. But okay, but what do I get with that? That was really like the question, because well, that's the default. So, the defaults on Civo are quite good, I would say, HA, because you have the control planes, but you don't, I mean, it's a managed Kubernetes. But then you have three worker nodes, medium size, and actually the storage is the same storage across all offerings. I tested it with Saiyam, actually. So, they have, yeah, they have like a, I don't know, the blue ones will answer.
Okay, so then he makes fun of me because I'm an ambassador, I should know that, but I don't. And finally, the last one was how to create a Rancher Desktop multi-node because it's not part of it. So, the last command, as you can tell, there's variables. Get back to me if you have any questions. I will post my demo somehow or I'll make a demo and I will post it on YouTube somewhere. And voila, you have a multi-node K3S or Rancher Desktop actual cluster.
Stay up to date
Sign up to the Navigate mailing list and stay in the loop with all the latest updates and news about the event.