Install Kubernetes Cluster with kubeadm 2022 (Linux VM/Mac/Windows, x86/Arm)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today I'll be setting up a minimum viable kubernetes cluster on cubeadm and although everything is very well documented in the kubernetes page if you miss a step or two things might get a little weird so I'll just do a quick run through so that you don't make the same mistakes I did so you can come down to this page where it says installing cubeadm and before you begin make sure you have two gigabytes of RAM and two CPUs or more in this demo I'm using a virtual machine that I started up on Google Cloud and it's just using uh E2 standard machine type with Intel x86 CPU and it's Debian based but if you're using Mac or Windows or other types of Linux everything is going to be pretty much the same so you can still follow along so if you scroll down this page it starts with installing a container runtime and I'll be using docker so you first need to install container runtime as well as the corresponding CRI which stands for container runtime interface to interface with your chosen container runtime so this is pretty much like the adapter for your container runtime so that it works with your kubernetes cluster but you can click this link right here and then it gives you a list of container runtimes that you can work with but in our case we're going to be using docker engine so yep so we come to this page where it gives you a link to installing Docker engine and also the crr CRI for docker but first go into this page and since I'm using Debian I'm going to click this and it first starts with uninstalling the old versions but I can skip that because I'm really starting from scratch I don't have anything installed on my virtual machine so we first want to set up the repository and we're just going to simply just follow this instructions here so let me just fast forward [Music] so that's a quite a bit of time but once everything has been installed now the next step says to install a specific version but you can skip this part of course we just want to verify that docker is installed correctly so I'm just going to copy this line here and now it says hello from Docker so this message indicates that your installation appears to be working correctly so Docker is now installed and go back to this page here and now you want to install the CRI for the docker so scroll down here and first we want to do a git clone but if you're starting from scratch like me you probably don't have git so what you can do is sudo app get install git all now that git is installed uh we can now do a good clone so copy this line here and paste it here my bad I had to copy this line here and paste it there so now to build this code I'm going to follow these instructions here but before we proceed we want to build using the go language so we need to install go so you can follow this step here but if this doesn't work for you you can just go to the the official go documentation page and you can install the corresponding turbo for your operating system so go ahead and click this other downloads but to install this you need to First have wget so if you don't have that again you need to install wget and now that we have wget uh you can choose the corresponding turbo for me I'll be using this um for Linux AMD 64. for your Intel x86 CPU so you can just copy the link address come here and do W get and paste that link there so once you LS you can see the turbo is now installed so go back to this page and go to the main page here it's going to tell you how you can unzip it and I'm not removing the previous version so I'm just going to use the second part here so copy this line paste it here but now it says permission denied so you need to do sudo tart and once you've done that you want to add this uh use your local go bin to the path so you copy this line but if you just paste it there it's gonna be transient and it's not going to persist so if you want this export path to persist you have to do Echo and append it to the profile as such and in order to save that you have to do source profile so now when you type Go version you can see now go is installed in your machine so once you've done that I'm just going to copy line by line from here and again I'm going to fast forward [Music] so if you get any permission denied error of course you can just add a sudo in front of your command like this so once we are done with that let's actually go back to installing the cube the container runtime page so we're now done with this part here now let's move on to installing the cubeadm cubelet and Cube cuddle so again um just copying these line by line [Music] so we have now installed everything and the next step is configuring the C group driver so C group is the control group where you can limit the resource usage for each of your control group but this is this we don't need this right now so I'm going to skip to the next step to actually initialize our cubeadm and set up our cluster so if I scroll down a little bit it it talks about how you can initialize your control plane node and the first one is the control plane endpoint so if you ever intend to have multiple control plane nodes then you will need to set this to the IP address of your current node so you can just do ipaddr and then you can find your IP address here and then pass it as a flag and that way you're specifying the IP address for your single control plane when you have multiple control planes in the future but because I'm only using a single control plane for this demo I won't be specifying this but the most important flag here is the Pod Network cidr so this is something you have to pass in and this would be the cidr for the network add-on that you'll be using so it gives you a link to installing pod Network add-on here but um you first have to decide what add-on you want to use so what you can do is search pod Network add-on and there will be a page where it says installing add-ons and it gives you a list of different add-ons you can use but in this example I'll be using coleco I'm not sure if I'm pronouncing that right but uh go to the link that's um here and then in here you can look for pod Network cidr and it will tell you how you can init qbadm with this given cidr and if you're using a different network add-on it's going to be different of course but you can copy this here and now we can come back here and do K cubeadm but you need to do sudo Cube ADM init with pot Network cidr specified to that cidr but when you actually run this it's going to tell you um you found multiple CRI endpoints and you need to specify the CRS socket so we can actually just pass it as a flag so I'm going to do Cube init help and it's going to tell you how you can specify your uh CRI socket somewhere so it's right here so you can copy this here so I'm gonna do CRA socket equals to the the one that was specified here so we're using CII Docker D so I'm going to copy this entire thing here and pass it as our CRI socket and let that run so once that's done installing you can start up your cluster but you need to run this command so I'm going to copy this line by line and one thing you want to find here is the cube ADM join command so this is the command that you can run on your worker node to join that worker node to this control plane node um so it's better if you actually copy this line and paste it somewhere but even if you don't have this you can actually generate a new token and then join your worker node but I'll give you I'll show you that later uh towards the end so I'll just copy this line by line so now we're done um we're almost done so if we actually look at what pods are running we can see most of the pods are running except for core DNS and that's because we haven't set up the Pod networking with Calico so let's come back to this Calico page and I'll come to self-managed on premises and install coleco4 on-premises deployment scroll down a little bit and click this manifest to see how you can install this uh yemo file so you copy this entire line here yeah so now I have this coleco.yaml in the home directory now you can do Cube codal apply F this clicko EML file and once that's done we can do pods and let's watch how it changes now the clicko node pods are initializing containers are being created and now they are all running so if I get the pods again now we can see all of them are running and you can do pretty much the same thing for your worker node so if you're running uh your virtual machine you can create another virtual machine and install your cubeadm Cube cuddle and cubelet on your worker node and use that cubeadm join command to join your worker node to this control plane node and if you did not copy that Cube ADM join command earlier you can actually uh I'll leave leave this link to the stack Overflow answer here but it tells you how you can generate a token and then create a join command using your new token and this expires in 24 hours anyway so if you create worker note later you will need this command so that's pretty much everything you need to set up your kubernetes cluster thank you all for watching
Info
Channel: david hwang
Views: 49,371
Rating: undefined out of 5
Keywords:
Id: o6bxo0Oeg6o
Channel Id: undefined
Length: 14min 38sec (878 seconds)
Published: Sun Oct 02 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.