Kubernetes Cluster Installation - MANUALLY - CKA Exam Objective

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi guys from network nuts so in this video we are going to uh create a kubernetes cluster and we'll be doing the things manually we will not be using the ansible as we had done it in the last video and a small change that also i have done is that we will be using ubuntu machines not the centos in the realm ah the reason behind this is that in the ck certification also they gives you the ubuntu machine so we will be more comfortable right working on on that like that yes we are comfortable working with the ubuntu machine so we'll be using a machine and you are allowed to access the kubernetes.io documentation in the certification also and in your job also so we'll be taking the benefit of accessing the kubernetes dot io documentation and see how we can install a complete kubernetes cluster just referring the kubernetes dot io we need not to cram anything we need to mug up anything everything is mentioned there in the documentation all i have to do is that and all you have to do is that use your common sense read it carefully and do the job and one more thing that i am going to do here which is slightly different that we will be installing a slightly previous version of the kubernetes say 1.18 the latest one is 1.19 and once it is installed the 1. 1 8 is installed then might be down the line in the next video we will be seeing how to upgrade the transfer from 1.18 to 1.19 so these are going to be the objectives for this video but first we'll be doing the installation part so let's come and do the installation so here we are and the first thing that we need to do is that we need to have three virtual machines minimum guys you need three virtual machines so i have got these three my virtual machines already available i'll just show you the configurations so this is going to be my master and on all the machines i'm running ubuntu as the os there is a reason behind it which i'll tell you why i'm using ubuntu so i go to the settings so this is going to be by my master so it has got around 4 gb of ram and 2 core of cpu which is required and then i have got one lan card which is in the nat mode which is obviously going to connect my virtual machines to the internet and i have got the second lan card also which is in the internal network so this will be used to communicate with my kubernetes nodes on the local network and one thing which i am doing here is that or you can also do it if you wanted to do ssh from your base machine like my base machine which i'm using is elementary linux right so what i will be doing i'll be going onto the nat adapter go to the advanced click on the port forwarding so by default you will have nothing here so you should you can add a rule here give it any name say ssh host ips127.0.0.1 and say hostport i give 4 times 2 2 2 2 it can be any free port and the guest port is 22. that simply means guys if i hit my local machine my base machine on loop back on port number 4 times 2 it is going to hit me on this kubernetes master so this will make my life easier when i have to do a lot of copy paste from the kubernetes dot io website so i so that you should be doing i click here and i start this machine that's all it's a fresh machine nothing there only the ubuntu is installed in the same manner i will go to the second node sorry the first node the first node has got uh around 3 500 mb of ram and one core of processor same stuff here guys one will be in the nat mode and another will be in the internal network in the nat mode i will again go to the port forwarding you will have nothing here add it now you cannot use the same port so i give ssh 127.0.0.1 this will be 2 2 2 3 right 2 2 2 3 and the port number is 22. so when i hit my local machines port number triple 2 3 it's going to hit my node one click okay that's it just started meanwhile i'll show you the second node check the settings here i have got around 3 500 mb of ram and it has got two cores of cpu so i had intentionally added uh change the course here again nat and one internal the ips are already given i'll show it to you go here and here i will add it as ssh 127.0.0.1 and is 224 right and the guest board is 22. that's all okay and let me start this so all the three machines are ready i'll show you the configurations and all the things and what is the benefit of giving that nat thing which now i'm going to show it to you so if i wanted to access the master so i had to go to the master go to the console of this master right supply the password whatever the password is this is going to be a lendy topic but it's very interesting and i open the terminal and i do a pseudo su i want the root access so i i have to work like this right on control node i have to work like this then on the node one also i had to go this so to avoid this to avoid moving here we had that nat entries so the benefit is that i will just let these machines running i will click here my operating system my base machine terminal and i do a ssh of alloc at 127.0.0.1 and the port number is 4 times 2. two right so this is taking me to the control node wow see here it is control node i do a pseudo zoom i supply the password so that's my control node guys and i open one more tab i do a are look at 127.0.0.1 and the port number is 2223 right remember that again supply the password this is going to be my node one yes i do a sudo su supply the password wonderful so that makes my life easy i'll be easily moving from here to there and we'll be able to copy and paste from the browser here and the third machine i do ssh alook at 127.0.0.1 port number is two two two four wow that's wonderful i supply the password and again i do a sudo su so guys that's why we had uh given the nat rules i had supplied the nat rules that make my life easy now let me show you the ips and all the things so this uh make sure the swap should be off on all the machines so swap is on on control node and swap on hyphen s okay it is on so i need to off it swipe off hyphen a and please put up an entry remove the entry from the cfs tab right so that it should not be available after the reboot that's wonderful now check on the note 2 swap swap on hyphen s okay fine i don't have the swap so that means the entry is already being commented out in the at cfs tab it is wonderful so guys first thing that you need to do is that make sure that the swap is off i'm using ubuntu and the ip address let's check the ip address my control node is hundred my node one is one 10.0.0.1 and my node 2 is 10.0.0 so if you have got hardware more hardware feel free to add more machines and what i had done because we don't have the dns so i have the entry in the xc host file right so this file so 10.0.1 102. make sure all the machines should be able to talk to each other using the names so that you can copy the etsy host file from one machine to another machine and let me show it to you here also right wonderful so i will just check it i do a ping of node1 dot example.com yes i am able to access and i do a ping of node2.example.com i'm able to access i'm good with that now the network part is ready the machines are ready now we have to start with the kubernetes installation it's very simple guys it's very simple all you have to do is that you need not to remember all these things right you can simply open the kubernetes dot io website and refer the documentation from there why i am explaining you this because in the exam also you are allowed to open the kubernetes dot io right go to the documentation you should be very good in searching the things finding the things as it the document like the documentation of the kubernetes is huge so unless you have done the practice don't think that okay fine i'll just search it and do the things trust me you won't be able to do it you will be able to do it only at least you you have used the documentation and done the lab for a couple of times just merely thinking that oh yes everything is on the documentation i'll be able to do it trust me you won't be able to do it at least do it once and you should be good in search so i just do a cube adm install which what i'm going to do i'm going to install the kubernetes cluster installing the cube adm click here you're allowed to do this right so need not to stress yourself in remembering all these things it's very simple just follow the instructions now right the first thing that i had to do is that i need i need to have the bridging enable right so the commands are there all i have to do is that i need to enable the bridging so this is something that we learned in our red hat trainings rscsa and rsc i need to copy this now i need to do this on all the machines right so the reason of doing ssh is this i i can simply do a copy and paste here that's all wonderful sec second is i need to do the enable the cctl so i copy this here again i'm first accessing the control machine then i'll be repeating the same for the node 1 and node 2. job done so the bridging is enabled that's good so that the file that it has created is k8s.conf you will see there k8 s.conf is being accessed by it right so just supply this it's all done adding this see here applying k8s.com right now once it is done you can just simply scroll down i need not to check the firewall you can disable the firewall right ubuntu it's known as the firewall so it's disabled on the machines i check here also yes the firewall is disabled on all the machines the reason behind working on ubuntu is that it's good to you use it you will find the reason very soon why i'm focusing here on making a cluster using the ubuntu machines in the previous videos if you have remembered using the ansible i had used the rel machines or the centos right so i need not to go through this sports stuff now i need to install the runtime runtime means the right your docker or container d or c or crio i'll be installing the docker now the packages are required to see the kubereum cubelet and cubectl so what uh we can do we can just simply go go here first update it add the repository for the kubernetes and install it so just copy it right i'm updating myself copy this go to the control node paste it here it's easy you need to remember the steps you need to remember the logic you never need to cram the commands if you can look up don't cram and you are allowed to do this whether you are working or you are giving the certifications you are allowed to access kubernetes dot io so why not use it understand the logic what we are doing so i'm updating it perfect it's done successful the second step i need to do is that i need to have the gpg key added right i copy it i paste it here i need to do this steps on all the machines okay then add the repository right then finally install the package update it and then install it so follow the instructions read it you you should have a habit of reading the documentation and then okay what slight change i'm going to do i'm going to install a specific version of kubernetes of cubelet not if i just press enter here it's going to install the latest one 1.19 i don't want that i want a specific version say 1.118 the reason i am going for 1.18 is that then in the coming videos i'll show you how to upgrade the kubernetes cluster from say 1.182 1.19 which is the latest one so you can specify the versions like this cubelet is equal to 1.18 backslash asterisk means the latest one in the 1.18 right is equal to 1.18 you can also specify the version like but 1.17 or something but i'm using this 1.18 backslash asterisk so that's where you are specifying a specific version of the cube of the cubelet and the cube adm right i'm not going with the defaults one because then i'll be showing you how to upgrade from one point one eight to one point one nine press enter here yeah one point one eight eight hyphen zero zero is the one which it is going to install so if you have learned one more thing how do you to install a specific version wonderful let's move on let it finish and then we will proceed further so the packages are installed everything right i look what i'm doing i'm just following the instructions right you did not to hold it for the updates this is that means you don't want to update these packages when you are updating the os right so you can if if you wish you can hold it so when we are doing the upgrade we need to do a unhold right so we can safely skip it as currently we are not doing any updates right so this is installed but if you remember we forgot to install the docker the runtime so what i have to do i have to do a apt install docker dot io this is required runtime so i am using docker as the container runtime so this is installed see here just use common sense follow the instructions understand what you are doing that's more important rather than just cramming the commands right once it is done i have to just enable the services restart the daemon let it wait it's going to be very interesting one and this this can be your exam objective also uh because if you go through the new syllabus of the cka uh the upgrade is objective the installation of the kubernetes cluster is objective right so it is installed now all i have to do is that system ctl start docker and system ctl enable docker and then i do a system ctl daemon reload and i do a systemctl cubelet start right start cubelet and enable it obviously so enable cubelet right everything is done working fine now is my node ready so if i give a cube ctl get nodes no it's not ready right why because we had just installed the packages we hadn't initialized the cluster so next thing is that i need to create a cluster only the packages are installed so you need to go to the cube admin init command that is the command which is going to initialize the cluster so if you click there if i go back here that's the next step using cubed m to create cluster again don't remember it look up now you can use the cube adm in it it will show you here cube adm in it and the arguments can be given there right so i want you to focus uh on the arguments here a couple of things which we are we are going to use like the api server address advertise address why i have to use the api advertise address because if i you give where you ip address show i have got two interfaces so using the api advertise address i have to specify that which interface the kubernetes should be listening or talking with the nodes obviously i cannot use the one which is connected to the internet i have to use this one right so i have to use this option api server advertise address another thing which i can use it's not mandatory you should refer this always refer cube adm reference guide i open it in a new tab make it a habit guys cube adm in it so if i do a cube adm in it here that's the one so these are the options so i ha i will be using couple of them like api advertise address and the ip address right so that means i should be writing like this cube adm in it and i paste it from there that's the reason i had done the ssh it's easy for me i copy this i open the terminal here paste it and specify my ip 10.0.0.100 that is the ip on which the kubernetes should be talking to the nodes not the nat one right perfect one more thing which i want is to ignore any installation errors so this is the option ignore pre-flight errors so i copy this i'm just focusing on the one which are relevant for you at this stage that's all so you need to initialize the cluster in case you you your machine has got multiple lan cards only then you have to specify this though it is always good to like be very explicit and specify that which particular interface to use and ignore pre-flight error means just ignore all the things move forward press enter now this is actually going to configure your cluster so just wait for a while it won't take much time and within couple of minutes our kubernetes master should be ready and the command to check the cluster should be available it will take time as it's going to download the images from the internet fortunately i have a good internet speed here so it won't take much time so the if you are noticing what i'm doing i i'm i'm not uh like focusing on cramming these commands that you have to do this understand the logic read the documentation access the guides the documentation and then do the job you have to be smart you need not to like mug up the commands that's all it's going to be fast perfect right so all things are being done this is the address 10.0.0.100 and what i i want you to check is that you should understand the just read this create static pod manifest what is static pods we might discuss it late it later on but that's the location where the static part goes fine it's done my kubernetes control is being initialized successfully all i have to do is that create these directories and copy the files to make it work so copy it paste it no rocket science here it's very simple just follow the instructions i'm copying the config file in my home directory right and changing the ownership copy it paste it here and guys this is the command to deploy a pod network like uh we we also call it a overlay network right and see here this gives you the location also where you can find the kind of the overlay network or the pod networks available so with the version 1.19 uh kubernetes cncf recommend using calico though earlier you might have used the weave net and all like the flannel so i can either go here kubernetes io documentation click here and refer it and this is the join command this is the command which i had to execute on all the nodes but we will not be doing it right now let because if i show you here now see it if i do a cube ctl get nodes my node will never be ready your node will never be ready so if your node is not coming ready that means the pod network right the overlay network is not still configured so you need to configure a overlay network right pod network so i can either go here cluster administration add-ons or i can simply go here and if i write here say cube adm ha cluster right you can just remember certain keywords and you will find the overlay networks here here it is this is it so they are using the weave net but don't use the weave net right we will be following the calico so that's great so how to check it let me tell you so this is specifying the weave net but we can look for other ones like i will show you the networks so there are multiple uh plugins available cni network documentation you can go here and check it so calico is the one which is required or is being recommended so i click here and or i can search the calico here calico search for it kelly cluster network here it is so just these are the uh supported overlay networks you can use flannel and all that project calico just click here you will get it right and install it install calico kubernetes here it is so mine is a self-managed on-premise so i copy this click here install calico for on-premise deployments it's very simple guys just download this file this is the instruction set and paste it here because unless you have a pod network your node will never come up so i paste it here right i got a calico.yaml file the next thing that i have to do is that install it and they have the instructions here also copy and paste it all right so i again move there and i paste it that's all it's the calico is being installed successfully yes it's been created how can i check if you give a cube ctl get pods namespace is the cube system right you will see this calico is getting initialized it might take some time so i i can see it this pod has got three containers inside it right zero three right two are initialized so if i give the cube ctl get nodes yep it's ready so that's how you have successfully uh added or like configured your kubernetes master right without stressing yourself now we have the master of available and if i again show it this command is very important you should make sure that every container in the all the pods or in the cube system should be running so they will be running automatically right so need not to worry about it so the best part to check it is that my cube ctl get node should be running wonderful so it is version 1.18 so as i have told you we will be upgrading it to 1.19 how to install the node very simple go go go to the node you have to repeat the same steps why what you have done for the uh the control node right so search again for the cube adm install install here click here you know the things enable the bridging enable the bridging here copy it and now i'll be doing it on node one right okay my swap is off and my yes so enable the bridging configure it make sure your kts.com or whatever the file name is there it should be coming here now install the packages now i have to be careful i have to install the same version right so i will be updating it first you can also create a script for it copy the script it will automatically do it for you but it's good to do it manually right though we all already have uh video on how to do it using the ansible which is good if you are in a production setup and you and you have got huge number of machines a large number of machines but you need to learn to do it manually so you you also remember the concepts and why i am doing this what is the error how to troubleshoot it right so the update is done the next thing is that obviously i need to add the key and in case you are running on rel machine so you need not to worry just need to click here and follow these instructions that's all add the repository and install the packages all i have to do is that i need to make sure i will be using the version right 1.18 update it because you have added the repository now either you can copy and paste it from this machine remember this right on the node one or i kill sorry from the control sorry not on the node one you can copy this this one it's much more easier copy and paste it here big so that we don't do any typo for the versions and all the things 1.18.8 iphone 0 is the one which we are going to be installing that's the one one point one eight point eight hyphen zero zero so the naming convention is the major number the minor number the patch that is how the naming goes i also need to install the docker don't forget that right so all i will do is just i'll just do a apt install docker io install the docker it's good it's fast the documentation is real good and the idea is that objective is that you should understand it let's wait for a while it won't take much time so i hope all of you are working from home and i'm also working from home it's long since i had gone to office but it's fun exploring new ways of online things and talking to you all i hope you are also uh checking those updates that the daily updates which are coming on instagram and facebook and telegram on so we are also on the telegram i'll show it to you so why don't we join us on telegram also okay it's being done the docker is done just start the services system ctl start docker system ctl enable docker right system ctl daemon reload and system ctl start cubelet and enable the cubelet systemctl enable cubelet right that's one wonderful all i have to do is that i need to copy and paste that join command here right so the packages are installed i have done all the things of obviously it's not the master so i will not be going to the cluster part all i will be doing is and i don't need the pod network the pod network is supposed to be deployed only on the master if i scroll up on the mast on the control i just copy need to copy that join one yeah copy this you can keep it with you and just paste it here uh one thing which i recommend is that hyphen f1 ignore error stuff there it is so i want that i will request you to use the ignore preflight errors all while you are doing the setup paste it press enter that's all right so the node has joined the cluster right so i should be going to the node i will highly recommend to just do a system ctl daemon reload once everything is done and restart the cubelet right sometimes it takes time so just restart it go to the node and if i run the cube adm get nodes i should be getting both my nodes ready okay it's not just wait for a while it won't take much time but it's coming up so you can repeat the same steps on the note 2 so all the nodes will be ready so let's do that on node 2 also right okay i'll go to the node 2 mean while and i'll let's check it first what's the problem why do i need to do wine everything is fine i just need a demon reload once again no problem and let's check it oh something is not good it should be coming yeah it's ready it might it might have taken some time right so after 66 seconds so you can check the time also around after one one minute right it will be ready so both the nodes are ready so my cluster is running successfully with one control node and one node so let us repeat the same here right so it's very simple stuff now i need not to explain all these things to you enable the bridging i'm doing it so that we will have our full cluster ready for the future videos and now you know the benefit of configuring the nat otherwise i have to hop from machine to machine which can be really pain at wrong places in my body am i allowed to say this here i don't think so no problem just don't share this right at the key share the video guys please subscribe it share your comments i would love to have your comments ah girl command is not found okay no problem i'll do it wow let me clear this up and let me try it again oh could not get the lock what's the problem should i do a update here in just a minute i'll just try to do update if it get update okay let's try it again hey what's the problem waiting for the cache lock something is wrong it's held by the process unattended okay so i hope this is done successfully let me try it again i'll kill that not a big deal oh and i i unable to acquire is this another process running 1953 unattended upgrade this is the package one so i'll try to kill it one nine five three we know the stuff let me check it now yes the linux skills will always help you okay so we had installed it then i should just do the curl get the keys paste it here right and then finally add the repository it's so fast once you understand the concepts trust me it's so fast you will be able to do it very fast if you can safely ignore the whole one i'll tell you the importance of this when we'll be doing the upgrade from 1.18 to 1.19 not today okay the versions need to be specific so i'll copy the versions from here copy it from here install the docker also so see how we are syncing ourselves with a kubernetes dot io documentation which is very important for if you are aspiring for the cka certifications and a lot of our students had already cleared the certifications i'm so happy about that couple of them have scored around 96 marks also from out of 100 so it's wonderful feel good you feel good yes you feel good when your students are doing good in life you feel good right so ignore this whole one install the docker now it's very simple i i just need to install the docker start the service and then copy and paste that join command here again that's all our cluster will be ready done manually on ubuntu machines using everything from the legal authentic legit documentation which you are allowed to access in the exam also just wait for a while so how your uh quarantine things are going on share right in the comments what what new skills you are getting what are the rose moments for you and the thorn right moments rose means happy and thorn obviously means some sad things which you have gone through might be some injury like i had it i i had a very bad ligament injury on my uh i think left yes left knee and i was not able to walk for around two months but now i'm good okay what we had done we had just installed the docker right start the service system ctl start docker sometimes we deviate we take a detour from the topic which is good fine all right your life should not be boring system ctl what to do daemon reload and cube ctel right cubelet sorry start and enable it takes time don't worry don't panic right final thing right copy this command and paste it there that's all guys copy it oh i'll copy it again copy it paste it on note 2. wonderful and once it is done as a precaution just do a demon reload will take some time though it's not mentioned here but i will suggest you to do a daemon reload and do a restart of the cubelet that's all not mandatory but uh cubelet perfect if i go here i should be getting two nodes not ready not a problem i'll will wait for those genuines the last experience 66 seconds refresh it okay 31 seconds not ready let's see if it really comes after 66 seconds earlier it it was after 66 seconds right okay 42 yeah oh no it is ready at 42 seconds now right so no benchmark as such that it will always come after 66 seconds but yes our cluster is ready that is all i wanted you to share i hope this is going to give you a lot of confidence that you can create a cluster yourself and referring the documentation you this is an important exam objective if i share the new exam objectives just a minute so installation is one of the part if i go to this is uh this is just don't see all other stuff this is what i want you to focus so these are the new exam objectives so installing a cluster is a exam objectives and which has got a weightage of around 25 percent i hope you are able to see this i'll make it more bigger make it dry right that's it and then upgrading a cluster also is a part so which we will be covering so things have changed a bit from first of september that's our network nuts kubernetes training i'll make it 200 yeah she's not our students not student right so please don't so that's the course the exam objectives and yes obviously the solid knowledge of docker is required for all these things and these are the objectives so we had discovered the installation part that's all for this video i'll be seeing you in the next video we might be doing the version upgrade so thank you guys do subscribers if you hadn't done it this is not good right subscribe it share your comments share your rose moments on the thorn moments i'll be waiting it and how you like this video that's again very important and share it spread the good word bye-bye guys take care god bless i'll be seeing you soon
Info
Channel: networknutsdotnet
Views: 3,433
Rating: 4.9642859 out of 5
Keywords: cka certification, kubernetes training, cka training, ckad training, ckad certification, cka, ckad, kubernetes certification, cncf, networknuts, network nuts, alok srivastava, kubernetes cluster installation, installing kubernetes cluster, kubeadm install, kubeadm init
Id: bpgElM_sE-k
Channel Id: undefined
Length: 43min 37sec (2617 seconds)
Published: Thu Sep 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.