Certifications

Micro-Blog 2 of 3 – Read These Before You Take the CKA: Hack. Time.

Microblog #2: HACK. TIME.

Welcome back to the micro-series on preparing for the CKA exam. This series is going to equip you with several tips and tricks that will help you navigate the exam and its common pitfalls so you save time and get to answering questions.

Let’s kick off this second round by focusing on what we ought to do after we clear the exam space requirements with the proctor:

HACK. TIME.

Well, no. Not really. But we are going to have a six-step process that will immediately save us time over the course of the exam.

The first thing we’ll do is navigate to the cheatsheet provided in the kubernetes.io documentation. It has some commands we can copy-paste straight into the terminal to gain an advantage. Specifically, these four:

source <(kubectl completion bash) 
echo "source <(kubectl completion bash)" >> ~/.bashrc 
alias k=kubectl
complete -F __start_kubectl k

There are two more not listed above that will speed up yaml creation if we need to create a resource from scratch:

Echo ‘alias kdr=”kubectl --dry-run=client -o yaml”’ >>~/.bashrc
Echo ‘complete -F __start_kubectl kdr’ >>~/.bashrc

Let’s break these commands down:

The first enables auto-completion provided for Kubernetes in the current shell. And the second adds it to the bash profile for perpetuity in case you need to resource your shell.

The third sets up an alias for kubectl to be invoked as k.  And the fourth makes sure that autocompletion is enabled for that alias. Those four alone are great, and will work wonders for your imperative commands.

The fifth and sixth are two little flavors I use and enjoy in my Kubernetes environments. For example, the fifth adds the alias of kdr to be kubectl --dry-run=client -o yaml and puts it in the bash profile. So you can create any resource that has dry-runs supported with three letters. And the sixth ensures that if we start with kdr, we can autocomplete.

I typically source the profile, to be extra-sure everything is set up correctly before getting started:

Source ~/.bashrc

That’ll do it for this microblog. Our next microblog will focus on the hands-on practicality that the CKA is well-known for, and how we can get that practicality.

Tags: CKAhacks
Cloud Academy Team

Recent Posts

Get 50% off with the Cloud Academy’s Flash Sale!

It's Flash Sale time! Get 50% off your first year with Cloud Academy: all access to AWS, Azure, and Cloud…

3 weeks ago

New AWS Certified Data Engineer – Associate (DEA-C01) exam goes live on March 12th, 2024!

In this blog post, we're going to answer some questions you might have about the new AWS Certified Data Engineer…

2 months ago

Navigating the Vocabulary of Generative AI Series (3 of 3)

This is my 3rd and final post of this series ‘Navigating the Vocabulary of Gen AI’. If you would like…

3 months ago