 So hello everyone and welcome to my presentation build your own k3s ready operating system like a pro and I'm Rohit and I work as a software engineer as Susie software solutions here at Vancouver So today I'm gonna walk through what is elemental toolkit, which is a set of tools to manage operating system images Like booting an operating system or upgrading an operating system and so on and then I'm gonna explain how to build this operating elemental operating system using the elemental toolkit that we have and So this elemental toolkit manages the elemental OS like installing or upgrading or resetting the OS images at your machines and then I'll show you a demo of how to build this specific elemental operating system Using the toolkit and then you know boot a virtual machine using that operating system And at the end I'll give a brief overview of how to manage This elemental OS at your edge locations through rancher manager and elemental toolkit so So what is this elemental toolkit? Elemental toolkit provides a build time and runtime framework in order to boot containers either in virtual machines or cloud or bare metal So what does this mean? So basically there are two steps involved here The first one is building a container image based out of a Linux distro almost every Linux distro provides Operating system a container operating system like open source Ubuntu or Fedora and Then we add elemental toolkit to this Docker file to this base Linux distro operating Base image and then build it and the result would be an OS operating it OS Container image with elemental toolkit inside it obviously not only just elemental toolkit you can add much more packages inside it So it's basically a docker docker file So this is basic docker stuff, but the interesting part comes here Where in the toolkit would convert this OS container image into a bootable OS container Container image so that you can boot into your bare metal or cloud or virtual machines and The toolkit takes an argument that is the cloud in it config files and Let's see what This cloud in it config files is So what are these cloud in it config files cloud in it config files are like operating system templates where you can define things like Okay, I'm at the Yeah, here cloud in it is an operating system templates for your machine Like when you when you want to boot your operating system into a virtual machine You want to have something pre-installed like your username or create a bunch of user names and passwords for them or Inject your SSH key once You know the server the operating system is booted or you want to start some binaries even before the server boot Server is up so you can use this templates the config files And you can Elemental toolkit can run these config files at different stages of the boot stages. That is in it RMF RMFS or boot or network or You know even upgrade and here upgrade is a special kit. What do you mean by upgrade upgrading is the Upgrading of the elemental operating system in your virtual machine. So generally, how does upgrading operating system work? So when you upgrade for example Ubuntu or open source you upgrade the packages each individually But using elemental toolkit the upgrade happens, you know by booting into the new bootable container image that you get So you have a new bootable container operating system image And what elemental toolkit does is at the server location is it would boot it would Discard the currently running operating system image and then boot into the new OCI artifact that you get in So you might get a doubt here like how is the data persisted? So for that I need to explain how elemental the layout of elemental OS So it contains the elemental OS contains this five partitions and let's concentrate on the persistent partition So you can specify some directories that you can say that these need to be persistent Like if you're running a single node Kubernetes cluster the data related to the cluster You know, you know the directories you can tell that these need these are persistent and these needs to be in the persistent Partition so when you upgrade or boot into a new operating system It would not you know touch that partition and it would do it in the state partition There are other partitions as well the anatomy of an elemental OS you can I Would recommend you to look more into this into the docs the links. I'll be providing at the end Okay, so now you might get a feeling that this is very opinionated like elemental Who has a specific number of partitions and this is elemental toolkit that that's used to boot this images and the upgrade process You know, you don't upgrade the packages, but you boot into a completely new Container image. So yes, this is opinionated But this is very useful, you know in the cloud native ecosystem And but it's also important to note that this is not coupled to any Kubernetes This is just a toolkit to build your operating system images and you know boot and upgrade Operating system images at any bare metal location or a virtual machine or anything and it's not tied to any specific Linux distro and This toolkit is provided as a Golang CLI and so it's easy to distribute and deploy and This CLI has the sub commands that is installing the operating system or upgrading or you can even say if your edge location is not Responding you can just reset the operating system And then there's this other command called build ISO wherein you can convert the you know general docker image into a bootable docker image so ISO is the installation media using which you can boot your operating system in virtual machines so here I have a demo wherein I'll be showcasing how to build this elemental OS using the toolkit and Then I will also create a virtual machine with the OS that we just built So here the first step that is a docker file, you know having all the required packages and elemental toolkit inside it so this is the elemental toolkit that I'm taking in and This is the operating system base image open-source leap. I'm using open-source leap. You can use anything and Then I'm also having k3s inside it So k3s is this minimalistic Kubernetes cluster the smallest possible Kubernetes cluster that you can deploy at your edge locations and I'm I'm installing some packages that are required for booting, you know making this container image bootable And I'm also copying this cloud in it config files as I tell you as I told you cloud in it config files are the operating system templates like you can you know tell at various stages of boot to do to run some scripts or you know create users or Anything and then a drag code is for you know, automating the boot process Yep, so I will run this docker build. It's very simple just docker file with the right packages in the docker build And now I have the image Container image, but the thing to note is this is not bootable in a virtual machine Because it doesn't have the required thing. So the what elemental toolkit does is it would convert this container image into a bootable container image So I have the elemental CLI and you can see the sub commands build ISO Install the image upgrade the system or reset the OS and This is a manifest file that it takes so for the grub name So when you are booting it, you need a grub name and that's derivative installer You will see this name at the when I'm booting into a new virtual machine When I'm using this ISO image to boot into the virtual machine and this is the cloud in it config files The operating system templates like as I told you at each stage you can tell You know you're operating by the boot process is going on You can tell the machine to do some things like you know, for example here after the init rmf rmf stage you can say Set up a custom user like as soon as the operating system is booted I need a user named Joe and the password would be Joe And also you can also inject some SSH keys. So as soon as the operating system is up you can just you know SSH into it and Remember, I told you that you need you need to have some directories that are persistent So while elemental toolkit is upgrading this operating system, you know, this partition is not touched and the data remains safe Yep, here's this interesting part. So as soon as the operating system gets a network I would tell it to start k3s the Kubernetes cluster So now I'm using the elemental toolkit build ISO sub command to convert the container image into a bootable container image This is gonna take some time. So I just skip So you can see it converted the Rohit sakala elemental demo into an ISO image And then now I will use this ISO image to create a virtual machine So that this ISO image is booted into it. So I'm using word install with KVM virtualization And you can see her the CD ROM is the elemental dot ISO. So it's starting As I told you that's the grub Entry name Install and this is just booting up. Oh, let me skip this. These are just logs and you remember we Specified username and password and cloud init config file named Joe and the password Joe So I Would use that to as a search into it Yep so you also remember that we used you know after the network stage we wanted our k3s to be up and running and So this is the first time I'm doing an SSH into it. So if I do cube cuttle, you know get pods You should have your k3s up and running So see you have I mean you didn't go you just have this complete embedded image With everything installed and you know all all the stuff to run like Complete solution and you can just directly boot into at your edge location. You'll have everything up and running So yep, this was demo Okay, so what we have seen is we Created an elemental OS using elemental toolkit booted into a virtual machine with I mean the elemental OS has everything inside it All the commands to run beforehand everything now What is this useful for what is the use case? Imagine you have an edge location where you want to run you want to run your cloud native app That is a Kubernetes pod at your edge location so that One important aspect about running about in an edge edge is you need to have the smallest footprint plausible So you can achieve that using k3s and sleep micro rancher OS image So k3s is the smallest Kubernetes cluster like the smallest footprint You can have to create Kubernetes cluster at your edge location with the operating system sleep micro rancher Which is the minimalistic operating system? You know the basic kernel and the basic packages required to run this k3s So this is the smallest possible embedded OS with k3s in it with the Kubernetes pod in it and then you can Run run that at your edge location now. There's a problem here How can you upgrade or manage your Kubernetes pods running at your edge location or your how can you upgrade the OS? At your edge location. So here comes elemental stack. So that's possible using rancher multi cluster manager so rancher multi cluster manager is you know a software for Managing your clusters. You can create multiple clusters. You can tear them out You can install some things in it using the apps in marketplace And then for the OS layer for you know upgrading the OS into a new thing you have elemental operator running inside the rancher manager that connects with All the elemental OS the edge locations that you have that are running elemental OS and this elemental operator will manage the life cycle of that OS and this rancher manager will manage the Life cycle of your k3s the smallest Kubernetes cluster that you can have the pods running inside it So this is a complete solution for your edge location like the smallest You know footprint that that is required to run your cloud native apps And these can be managed remotely using this elemental stack that you have so yep these so with this I end my talk, but This is just one use case that I've shown you and this is just single note k3s class k3s cluster you have but You can have more use cases because this is not tied to anything and it's it's all everything that I showed you here is open source and For the elemental stack these are the links that you can go and check out and for elemental toolkit, which is a CLI These are the links you there There's a slack channels as well where you can go and you know ask your questions or doubts So thank you so much