becoming a certified kubernetes administrator
1674546583
i listened to the lovely sound of my space heater whirring while kubernetically kubernetting this kubernetes-infused post about kubernetes
yesterday i took my cka exam and passed with a score of 92, officially becoming a cncf-certified kubernetes guy(tm). you can peep the cert here if you're so inclined. somehow the number 92 is the answer to all hard questions in my life since that also happens to be my ccna and apprenticeship final scores (in percent). in this post i want to roughly outline my learning journey and hopefully give some valuable advice on how you, dear reader, can also become a kubernetes man(tm)
the origin
my previous boss was the one to put me on track originally. he trusted me enough to give me control over some kubernetes clusters and asked me to start experimenting with the infrastructure on the company clock. since my attention span had completely been decimated by tiktok and youtube, i opted to not get informed first and just dove right into the practical aspect of administration. it might be important to know that i had not the slightest idea what kubernetes or helm or really anything was, so every step was a struggle. ingress this, persistent volume claims that. it was a confusing mess
the first resource i consulted was edx's introduction to kubernetes to get an idea of what components there are and how they're laid out. another resource i highly recommend but didn't use is kubernetes in action. seems to be the gold standard when it comes to introductions to kubernetes. even without the book, - in typical fashion - things slowly fell into place, making the big picture a little clearer with each passing day, week or month. the process of becoming intimately familiar with the moving parts was pretty satisfying, in part due to how fantastic the kubernetes docs are. after fiddling with things a lot and even migrating some productive apps to kubernetes, i hit a wall due to the legacy on-prem nature of my workplace. i had been wanting to quit anyway, so i did. all in the hopes of proper transitioning into devops and finding happiness
the present
after switching companies, my employer granted me access to a cloud guru, so i enrolled in will boyd's course on the cka. it's essentially a quick primer that may or may not prepare you for your exam if you already know the basics. the experimentation stage at my previous company had paid off. i was already acquainted with the subject matter, making following along on 2x speed trivial. it's therefore somewhat difficult to judge how much of a quality course for beginners it really is, since it acted more as a refresher for me. though i did learn a lot of new things, specifically about kubeadm fundamentals, networking (specifically dns and network policies), what static pods are and how etcd backups are created/restored, so i'd say it's worth your time if you already have acg access
i finished the course after about 5 days of medium-intensity studying. the internet people(tm) recommended killer.sh exam simulations to further prepare for the cka, so i bought two tries for $30. the 25 scenarios included are crafted to be more difficult than the real deal so you can hone your skills and hopefully overshoot the passing score of 66%. my first try resulted in a score of 96/125 which is enough to pass but not enough to satisfy my massive ego and perfectionist complex. i left one scenario completely untouched and also ran out of time right after finishing the last one
my results got progressively better the more comfortable i was with the environment, scoring 116, then 124 and finally 125 in subsequent attempts. the last two were sponsored by the linux foundation who always give you access to two simulations with every exam purchase, so you technically don't have to purchase any on your own. the scenarios are also the same every time, so it becomes repetitive and stupid after a certain point, but for me it was still good practice and a decent confidence booster
the exam was scheduled on jan 19, 2023 by me and took place on the 23rd. i got my results 23 hours later. don't bother hoping to get them sooner. it will just make waiting miserable. from what i have read, they grading period of currently 24 hours is almost always exhausted
and that's it. that was the story all about how i became kubernetes lad(tm)
the bottom line
what essentially made everything click for me was using my tools i.e. kubectl on a daily basis to explore/solve real-world problems and hammering it into my head that containers are simply isolated linux processes running on a host equipped with a container runtime. all kubernetes does is interconnect these hosts, make them communicate in order to facilitate easy management of (potentially multiple replicas of the same or different) containers running on potentially multiple "physical" hosts, and keep the resulting state consistent. there's of course much more to it, but since the cka is actually quite surface level, you're not exactly shooting for surgical precision, so i won't either
i also shunned the traditional copy-paste style of writing manifests that mr. boyd employs in his videos and instead chose to type out every single definition by hand. i would recommend this approach if you really want to get a feel for how the yaml files are structured and what kind of resource requires which fields. you'll start to recognize recurring patterns which gave me a solid understanding of what kind of infrastructure i'm actually creating with each resource definition. i also typed out every single resource definition during the exam and had 52 minutes left by the end after(!) going over every single scenario again to double-check, so i used a little more than half the available time
some exam tips
- use a big screen. the killer.sh simulators look and feel a lot better than the real thing, at least in my opinion. i used a 13" macbook, the proctoring people recommend 15". the virtual environment that was provisioned for my actual exam had every desktop element scaled up, so i could only see the upper left area of everything which amounted to maybe 70% of the actual screen. this rendered the docs borderline unusable. terminal was fine, but the default font is huge and chances are you don't want to mess with it if you're the nervous sort
- check in 30 minutes early. the check-in process is relatively smooth but will take some time. if you're struggling with anxiety like i do, it's probably best to get it over with as soon as possible because your nerves might be somewhat calmer knowing that you're in the driver seat from that moment on
- use aliases.
alias k="kubectl"
is pre-configured - maybe don't use aliases if you're asked to write commands to accomplish
certain things into files. i'm not sure if your work is manually checked,
but the simulator won't accept
k
as a valid substitution forkubectl
when checking contents of files. probably best to type outkubectl
to be sure - get comfortable with (neo)vim. it will help immensely due to how much time
you save moving around files. some vim settings are pre-configured,
specifically
set sw=2
,set ts=2
andset et
. i recommend additionally usingset ai
- double-/triple-check that you're in the correct context. at the beginning
of every scenario, you are given a command that puts you in the proper
one. i repeatedly forgot to switch. use
k config current-context
if you're ever unsure - copy and paste names/paths. i've made stupid typos in three of my four simulation attempts trying to type out paths as well as container and image names. just be smarter than me
- learn how to check whether the resources you've created work the way the scenario specifies. this could apply to pvcs, services and network policies
- go over your work once you're done. doesn't have to be thorough but it might help you spot some spelling errors or other easily avoidable mistakes
that's it for now. good luck with your endeavors and godspeed
I’m a negative of a person. All I want is blackness, blackness and silence
- Sylvia Plath