CKA Tutorial with Killer.sh (Part 1) | Rawkode Live

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so hello and welcome to the newly branded rockwood academy this is my first ever video under this new name and i hope you're excited to join me on this journey remember if you're not subscribed already go ahead and do that now you can click thumbs up on the video this helps other people find it and now you can join for under a dollar as a monthly membership and get access to private live streams emojis although they don't work that great on my software but we'll fix that and there'll be courses launching in july also we have a discord server available at rocco.chat if you're watching this live and want to chat afterwards or you have more questions that is the best place to do it if you're not watching live and you still have questions that is also the best place to do it so hopefully we will see you in there soon now today's episode is a little bit different and that well it is just me and uh we're gonna do some cka exam preparation and i was really looking forward to this until i read that it's apparently harder than passing the cta you see here difficulty and this simulator is more difficult than the real certification so what is this simulator this is keller.sh this is now something that anyone who purchases an exam from the cncf will have access to this simulator and i believe they get two runs through the scenarios in order to prepare for setting the actual cka so of course it makes sense that this would be a little bit more difficult just to give you that extra bit of confidence when you go in for your exam so that's today's plan i have already started a a session and in order to do so if you want to you know do this in your own time you log in i authenticated with my linux foundation account and then from the dashboard you can see i've got my active session here and i have another one here it took around three minutes for the environment to spin up i haven't looked at anything i've not even clicked start i believe i've got 36 hours from the moment i started the environment to complete it so we're pretty much just going to dive straight in and see how prepared i am my cka and my ckad both expire in a couple of months so this will be really good preparation for resetting those exams so if you're watching say hello in the comments it's always good to get a little bit of feedback especially when i'm sitting here all on my own and let's get started uh actually nervous all right let's see let's make this really big hopefully that's oh it's difficult for me to read but let's see how we get on okay instructions you should avoid avoid using the deprecated cube control commands as these might not work in exam there are three kubernetes clusters and eight nodes in total cluster one cluster two cluster three got it um i'm only allowed to have one other browser tab open with the kubernetes documentation yeah i'm not going to read the docs uh notes you have a notepad 12 just like the exam and there's a difficulty thing all right using cube control from the terminal you can reach the api servers of all of them i just need to switch context all right good what'd that do oh next question first challenge done okay uh i have access to multiple clusters from my main terminal sure cube control context write all these context names into this fail you have access to multiple clusters from your main terminal all right keep control got it uh let's see config get context yep rate all those context names and to a fail all right [Music] one of these lane comma separated do you care not sure all right let's do a head dash m1 it should get rid of the header no that's only going to give me the header did i skip a line oh don't tell me i can't remember how to skip lane manhattan okay print the first number of lines no i want to skip a line skip a line let's get the land oh all right who just thought that would get me first get context i'm just going to arc open open print one why have i got a thingy here now zero would be the whole line one should be the star two should be the name all right uh write this to opt course one contest and i'm going to cheat because i can't remember how to skip a line on my output maybe i could do it with less of course one tail thanks alex that's always a weird things all right i think that's that's good enough so alex burris says yeah i should have used steel yeah i can because of your tail seems obvious now that you've said it and matt i'm a huge awk fan i love using all for pretty much anything on my terminal okay so now we want to write a command to just to display the cutting context and here i already did that all right so get context grab star yep and put it into this other fail sure thing i just want to name the app print to alt course one bring up my cli but no problem living thank you all right context default cubecontrol.sh oh wait it says write a command to display the current context then yeah all right so that's sort of a command in the file even though it's dot sh file yeah i want that essay trail to be a commander i could run right without the use of cube control really okay echo all of this i think that's what it wants i'm assuming the idea being i could run course one contact default i get the rate why did my awk not kick in oh because it was interpolated there we go uh that was funny okay now i need to do the same but without using cube control so i expect what this is trying to confirm is that i know that the config is here um that is your ammo i can always grab the file it has a default context line if i remember our current context line um correct current yeah there we go so we actually want to echo this to a fail and i know someone's going to tell me you don't need to use cat yeah that's going to bug me isn't it so okay so we're going to grab for current here ah okay so now our arc has to get fancy and because we do we want to print zero all one left hand side two right hand side only this time we're going to need and a field separator i'm getting nested quotes here now i wonder if i can do it without let's try and i'm going to have to run this to test before i start echoing it no all right okay i'll just feel separated going there we go all right so now i want to echo this to that location escaping these i don't know if i completely misunderstood uh this first task it seems a little weird but i should be able to run context to fall no my awk again it's a good thing i'm checking my work all right and we've got a cube control one make sure that works it does and we wrote our context done uh not what i was expecting for a first question uh i guess it's just trying to clarify you know where the cube thinks is you know roughly the format of what how the context works and how it stores the default and then i guess there's a little bit of knowledge there to test your cube control and alex with another great comment on the chat um cube control get contact no headers uh yeah there we go i always forget that's an option yeah i agree matt i'm not entirely sure uh it's a great first question but alex what you're saying to me how's it saying i don't think you did the context one correctly since i want you to know what the options are no i think that would be a shitty i don't think there's anything to do with the options i think it's just familiarity with the cubeconfig and enough linux knowledge to juggle it around i don't really think it matters how i get to it like knowing that you can do formatting of cube control nobody remembers those parameters ever everyone's always going to do thought i'll speak for myself not for everyone i'm always going to default to my linux tools rather than esoteric flags on code control so i disagree the outcome is what matters okay i switched context i create a single pod running this image and the name space default the pod should be in pod one and the container should be named pod one container this pod should only be scheduled on a control plane node do not add any new labels shortly write the reason on why the pods are by default not scheduled okay no do we have anything i'm going to start my alias have anything running to copy i always spend that just the best way to get started when i did my ck the first time like nobody expects you to remember pods back off the top of your head although the pods easy enough we probably could we probably could tape that um but there's already specs here and this is a one two one cluster was it let's find out uh which means if i do i get pod yaml there must be a one i don't know no no there we go no yeah it's not got all of the verbosie i would just bet so okay cool i didn't see managed which is good so this maybe is a 121 cluster and there used to be an export flag i don't think that works anymore yeah that was deprecated but it would try to remove all of that crap but you can just say pod.yaml and then tweak so you guys remember to remove metadata that is not particularly important and i also told us that there should be no labels do not add any new labels to the node okay means i don't need any the name is supposed to be our pod one and the default namespace we don't need that containers unfortunately i think that's actually the same one isn't it yep two no almost 3.4.41 dash alpine um policies not important the pod name was that wants it to be called pod one container uh we don't need any amounts did i delete too much nope there's my relative line numbers uh what else do we need nothing yet we all need the tolerations i'm going to leave them in and i can't comment about oh yeah i can't this is an actual local fail this is not cube control edit i'll never remember the toleration syntax and we'll delete all of that okay this is our polygamous spec right now i think it does everything it has to do here um it wants us to ensure that it is only scheduled on a control plane node which means i need to remember how all of this works but we can run key at nodes let me shut my phone up and describe cluster one master one and there is a label on this which will say that as a control plane node although we could just use a node selector if that's just easier tried to tolerate the labels but yeah we got this here so we can either add a toleration or this little label an affinity for this label um but i'm just going to use the node selector actually where was that was again cluster one master one okay in a while let's see what did i get wrong oh my notes letter is wrong all right we are going to use kubernetes docs node selector that's what i used i put it in the wrong place all right okay so yeah it's the node selector and then how to select it i don't think we need to use affinity here i'm going to just avoid it um can i just a name let's try what's the worst that can happen only people are watching me all right no it's later well that pending tells me hasn't worked zero three notes are available the pod tolerate uh okay it didn't matter so my selector is wrong let's describe this again fat our decay get knowledge um okay what we got how does this work again oh yeah good show rory's saying i can just use node name now i'm kind of i do kind of want to get it working so the node selector and then there's this is this this is the key value pair right of the labels that were attached because this is adding a label here where this type equals so i'm assuming we'll try one more thing and i'll use node name actually set the node name on the pod i believe the scheduler just ignores it and then the cubelet takes over so you don't it doesn't get scheduled per se but that's a good show actually okay so we did have control plane but it was set to kind of zero so i'm assuming control this plane here with an empty valve and i can't update pods those are immutable see if that may just take a lot longer now by just avoiding the affinity i think the affinity would have been a lot quicker but yeah okay that's not working delete pod pod one let's modify this one more time uh cluster one all right there we go so what was the chat saying to me it was kind of going kind of alistar saying hey and they've been telling me to use taints yeah i was avoiding that just because i felt like it was too much typing and then it ended up taking myself around in a couple of circles i'll start suggesting when you need a toleration for the no schedule not if i skip the scheduler and use node name um oh yeah actually i bet my selector was working and i just didn't tell it to tolerate the no schedule there we go in fact there we go okay if we get comments in the chat you forgot to add the toleration that message is quite difficult let's pop that over there let's just remove that opacity or transparency okay let's see all right yep the chat corrects me yes you're all correct awesome however we cheated well it's not cheating we got the end result maybe it's just not the way they were telling us to and the ck is not i i don't think they check to see how you implemented that they really just check the results so use whatever you can uh okay so switch can't ask the same context but let's type it anyway or copy and paste it anyway okay there are two pods and a namespace project c13 called o3db there are indeed c13 management asked just asked us to scale them down so that we only have one replica okay so the first thing we notice here is the naming convention of the pod it is not a triple with a replica set in the middle and like we see here so this this is the three part tuple and pods are generally like this this would be the higher level name probably the deployment the middle bit is the replica set id and then this is the pod id what we see here is that these are stable sets because we have numbered ordered pods or did i miss an action on question two um did i oh yeah sure thanks good catch so i'm gonna lie here the paws weren't scheduled with the affinity or selector because the pod was not configured to tolerate the taint that control plane nodes have i'm not sure how they check that if a human is involved or they just look for the keyword which is tolerate but there we go okay so we want to scale down the stateful set so if we enter namespace get sts you can see here edit o3 db replicas one and get pods watch and we'll wait for that to terminate and we'll move on i think we're good yeah more questions like that please okay same context i'm not going to copy and paste it again uh do the following do the following in namespace default create a single pod named ready of service ready with an nginx image configure a liveness probe which simply runs true configure readiness probe which does an http check start this part and confirm it isn't really because of the readiness probe all right well we already got a podcamo uh what question is this let's call it q4 it was naive of me to call it pod.yaml in the first place okay so pod name ready if service ready default name space doesn't need schedule image engine x1 16 1 dash i'll pain oh come on vim and let's just call this nginx okay so we need to add aliveness probe man oh i feel like i've never had to do this i'm going into the docs so there's two ones that can go here right there's http get blah blah and i think it is just exact and then true don't make it up dave okay remember when i said i wasn't going to use the docs well that was naive to exact command so close all right and this is just returning true okay and it wanted a readiness probe get url paste well it's actually telling me to just w get why should we get oh because that's only going to hit of course because you can't provide an absolute url here it only hits your actual plot of course it is okay so feeling to them as well today let's do the exact command and this is actually a list as is this and then we'll change syntax just to make it confusing for everyone get this okay so start the part confirm that it never gets ready because of this command here q4 okay so that is running and we should not really see any updates for that to change and may have been smart for me to set the interval really quickly so we can get those three additions but i'm pretty confident that is not going to update because i trust the exam question okay so now we want to create a second part called i am ready looks like the image is potentially the same we want to add a label uh they already existed service service i might read it should now have that second box okay so now we're just checking that we can add a new pod with the right label which is going to be in the selector in our service we'll call this q4 242 okay so what was different here am i ready yes um i ready assume the default namespace is correct and image is the same labels that's labels on that um yeah it's just apologize about deployment labels uh id cross server ready it doesn't ask for any probes running ready to scrape let's get the services first describe service how about complete let's get that enabled next and we have our end point looking good all right source cube control completion bash cool all right i like that one question five oh it says i've got 93 minutes left i'm only going to be streaming for another 30. so we'll see how far we get through and then i'll try and pick it up again um after i've had lunch with my daughter okay same context there are various pods and all name species no write a command and to find pods which lists all the pods started by their age who remembers this alex is going to give me a trouble if i don't use cube control commands but i'm more likely to do this through bash and sort and stuff so first thing we want to do is get all pods um wide do we even need we get the time already don't we yeah okay uh okay get pods help let's do this nice way so start by i don't think these flags are good for certification just that important work yeah they're not an alphabet quarter anymore all right and write the command into a fail okay hot course five [Music] oh of course i find all right write a second command which lists all the pods sorted by metadata uid using cube control sorting for both commands okay so it's actually making sure i used that so this is pause your id you ready thank you there's my other one uh thomaslav nice catch i forgot there all parts and my commands all right let's run off course five fine parts and vane pods ready all right maybe i messed something up there seems okay oh eight percent okay create a new persistent volume named safari pv i should have a capacity of two gibby bits access mode to read write once host path hey and no storage class name defined create a new persistent volume claim to claim the persistent volume all right let's see if we have any pvs pvcs definitely copy and paste on this at the docks then um okay so this is question six then q6 i just need to create them i don't need to store the ammo anywhere yeah nice okay so we'll just do this all and i want our q6 by ammo copy some yaml persistent volume show me the ammo got one with everything no all right okay one at a time that's my vs code editor which has auto complete and generation for all of this okay what are we calling this fatty pv to redraw it once don't need anything else you have a multi-lane and then we need to claim as such and we're calling this oh wait who's path here i'll fix that a second okay so oh no we're in a namespace safari pvc namespace project tiger nice name and [Music] don't define the storage class name i don't don't need volume either and how do we define hostpaths it's just okay volumes i don't know if that's supposed to be a joke for the slash volumes capital v maybe it's like trying to pretend it's a mac never seen that on a linux system before uh all right let's make sure i've not messed this up so we created a persistent volume called safari pv we've got two guppy bits we've got a host path for volumes data with an access mode to read write once we then want a pvc without a name space which we've got for the same size same mode no storage class oh and you want a deployment ugh am i going to type a deployment oh well i guess we're converting a pod to deployment okay um deploy and we want to call this safari and the same name space really i should have created some of these first yeah i should be using control explain uh okay now we need to convert this pod to deployment so that goes away we got spec template spec selector and oh too much set that foreign x3 all right okay um image i don't think it cares about the names so let's call this httpd because that's the image at least at once that one's httpd two four four one pain no commands it wants to mount our pv which we'll just leave it called well this is a host path and it's going to fix that and we're mounting to tamp valley data maybe it's a mac joke it's called safari all right this volume is i don't know fatty pvc i can't remember as claim name or for something else ah close persistent volume claim and then the claim name pair assistant volume claim this could blow up i have no idea straps it did blow up okay converting yellow to juice on lane 12. i've got any more than that i cannot find expected cool on uh anchor saying it feels good to watch someone else think thanks i'm doing my best uh okay debugging animal is not something i want to be doing this okay so this these are poor dashes come on chat all over that at least now it's something else but okay so it's telling me that my persistent volume and valid tight post path volume source got strength expected to map okay what did i get wrong with the host path let's use the explain so this is our persistent volume spec host path so we can do okay explain pvs back what's path and it just expects there to be a path easy when you know how and let's try ah silly apps v1 all right i was gonna say better i mean that was better um i didn't add a selector okay so labels name safari templates back select our match labels name fatty and i'm going to get something wrong name safari all right quickly what is that don't have much time but it's not labels on the top level right is that metadata labels select or match labels all right um so this is the selector match labels templates back metadata label yeah courses this is the we apply to the pods spacing looks wrong unknown failed metadata i just looked you up templates back puts back my idea template yeah just like because it's above that like i was actually taping a real part right all right let's check this was our namespace wasn't projected tiger project get pvp all right that is perfect um what i'm looking for here is just these status bounds that means they're connected they're working what i don't want to see is i get pods and something's sitting impending because it can't do anything that looks good running uh we can always describe it if we were cautious tiger that's great we should have autocomplete nope and we got our volume that's good okay i think that's all right okay so i wonder how many questions there are i really shall look that up because i'm not sure what to get through maybe maybe one or two more okay this is a one percenter so the metric server hasn't been nostalgic yet in the cluster but it's something that should be done soon your college would already like to know the cube control commands to show node resource usage show pod and they're continual i mean that's not going to work with the metric server i just want the command sure why of course steven i don't know if it wants me to install metro server i just want to commence okay so this will be cube control top node and pod i don't know if i'm over simplifying this one oh well we'll just keep moving uh yeah but before i get to the end well i think i can actually go on the actions here and just say like you know get my get my score and so if we don't fit whoa there's 25 questions i mean i've got plenty of time but not actually got plenty of time so maybe i think if i collect show answers and score uh i don't think i can come back and do it again but i do have 36 hours i'm tempted to just you know do the next question and then maybe just like drop out and then do a part two but i also kind of want to know if i'm getting right okay we'll see let's see where we are in five minutes okay so we want to sshn to the master why is this thing called a massive control plane node ssc channel control plane node with this i'm going to send the feedback to update that command we're past this now okay check how the control plane components cube ah see i love it when i get to deal with the control plane components that's a good deal that's a clustered episode right there check how the mass control plane components the cubelet the api server to schedule it and the cube controller manager and ssd are starting and installed on the control plate node also find out the name of the dns application and how it started and stopped awesome right this is just a health check of the components so what i would expect in fact we can check if this is a qbdm cluster um but just really taking a look here and whenever i see admin.conf usually a really good indicator this is a qbdm cluster which means we're going to have our kubelet started via systemd which we do next we check for the static manifest paths you can see here we've got hdd api server control manager scheduler scheduler special running and now we want to i think what it wants us to do here is to know that we can do admin.conf as a way to query cluster we can also do a get system get pods and we're looking for the core dns pod or maybe it's cube dns but i doubt yeah there we go core dns okay write your findings into this should be structured like so let's copy it so opt course 8 master component text all right so cubelet systemd pod static part password read the docs not installed process a static pod okay cool static part let's push let's put that support static port and pod coordinator even though the pods aren't actually called coordinates the deployment is i think that's okay [Music] [Music] great help um opt course uh is it because i'm doesn't want me to do it and the ssh or doesn't want me to do it on my yeah okay um let's grab my i think it wants me to come out of the ssh course eight master should make that more clear i could trip people up next okay so oh new context not the same context hello new cluster okay naveen says that my cubelet type is not systemdm processed [Music] thank you i mean i think i should get extra points for writing system d but let's leave it like this thank you for that good catch all right nine we've already switched context we're going to estimate into cluster two master one temporarily stop the cube scheduler all right is it a static manifest on this cluster it is so temporarily stopped the cube scheduler this means in a way that you can start it again afterwards so you don't want me to delete the file this is a just a part there stopped uh chris we should confirm this stopped really cube config kubernetes and coupe system pods and we have no scheduler okay create a single pod named manual schedule of the image confirm that it started but not scheduled on any node and now you're the scheduler and have all the power manually schedule a pod on that okay so now this is one node name this is just showing that if you put the node name the scheduler is removed from all scheduling decisions bypasses almost everything and just does its thing so um pod ammo i'm gonna tape this v1 tape scrappy back containers name image especially httpd metadata name manual schedule okay let's get our cube control we don't want to do it in that namespace supply or pod.ammo can i not even write a partner expecting a map but it got an array oh that's just me being silly okay so we should see it is pending and unscheduled the pods are immutable can you change the i wonder not everything's immutable most things are immutable so let's try yeah immutable so let's delete apply get running okay start the cube scheduler again and confirm oh wait did i miss a step no okay start a schedule again and confirm the scheduler is running and then create a second pod we call it manual two manual schedule the node name and it should run on a worker because it's been scheduled like a normal pod um okay so move here apply to get pots let me just have to wait a minute for the scheduler to come on and uh and schedule that there we go and it should be running on the whacker but we can do it all right i'm just going to affect the vocal synthetic okay we'll just turn the weight and we can see it is on worker one okay oh it's a six percenter and i've got a few minutes left oh it's decision time uh create a service account again everything i can do quickly and always come back to that question okay demon set create deployment yeah i mean i could do that pretty quickly give me something just a great part a lot of yammer being sung around on this okay you're asked to find out the following information about this context answer five questions uh yeah i'm not i'm not found in a question i can do it in a couple of minutes so i will let the chat decide do we want my answers and score or am i coming back to this later with another hour and an attempt to complete the last 10-ish questions yeah 6-8 minutes left i'm probably a little bit behind where i should be i think and hope that's just because i'm talking about it as i do it and not just heads down but uh i don't get a strong opinion who wants to see my score and who wants me to come back to this later i will give you 30 seconds oh thank you naveen for becoming a member i appreciate that man thanks all right nobody's feeling too chatty part two please thomas laugh all right you got it um can i pause this or once you start it you start it what happens if i just close it yeah let's let's find out i i'll just leave listen i'm worried because there's no explicit pause is that it's just going to time out all right i've got i've already spoken to the team at killer michelle i don't know what they call it colour.sh color shell they've given me um credits to stream this so what i'll do is i will get answers and score but i will do a full one completely i'll set aside the full two hours we'll do it start to finish um just because there's no pause this is going to time out in an hour i don't think coming back is actually going to work but i will do this again yes yes it just stops the countdown yeah i mean that's what's going to happen anyway because i don't have time to finish it just now where's my score i i got a low score because i never got through all the questions but scenario one tick tick tick tick tick tick what ah strats so why did i get the stateful state one wrong i didn't maybe i must read the question i didn't know it wanted a record of the skill then so i just went into the manifest and edu the replicas because i'm a bit of a cowboy that way i guess what i should have done was a proper skill done event using record which actually adds it to the audit log as a history or an event on the staples that's saying why this was scaled down you can actually add a message to it really good if you're not an amateur like myself okay so yeah i mess read that that's my fault and this one i have no idea scenario four pod one is ready did i not wait for it to be ready did i get something wrong i'm not sure but at least i did get the majority of the correct uh cube control top pod it did work i ran it although we didn't have a metric server working um maybe it wanted it as a plural not sure why i got that wrong we got scenario eight correct which was just understanding control plane components scenario name whoa did i miss an entire thing all right well i'm unhappy with that and then i didn't actually get through any of the others okay well that was our first attempt at the killer shell ck exam preps i will set aside a complete two hours at some point this week so that will be today tomorrow or friday and we will come back and do this from start to finish again and i will read the questions properly stop being an amateur but thank you for joining me today i hope this was useful um feel free to reach out to me on discord and twitter let me know what else you want to see but uh thank you to the people who joined the academy it is nice and cheap join early and more content is coming soon thanks a lot everyone i'll see you soon you
Info
Channel: Rawkode Academy
Views: 27,187
Rating: undefined out of 5
Keywords:
Id: KfrZd9YCftU
Channel Id: undefined
Length: 62min 8sec (3728 seconds)
Published: Wed Jun 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.