Hello everyone, just wondering if we are allowed to setup certain aliases AND co . . .

Oliver Schoenborn:
Hello everyone, just wondering if we are allowed to setup certain aliases AND code completion in the exam? If every question is a new shell/terminal, then it’ll be impractical to setup aliases every time (unless I can cut/paste a script with a bunch of alias commands from my desktop).

BUT ALSO, once you setup aliases, you loose code completion when using the alias, unless you execute a couple lines of code to setup the code completion hook on each alias. Is this allowed? Should I just expect to have to type out every command for 2 hours?

Pranay:
you should never be typing full command - you must use autocomplete . Tab and d_ouble Tab_ is your best friends during exam

Setup autocomplete as soon exam starts - open ‘.bashrc’ and add your aliases there - I use ‘nano’ so I added alias for that , as well ‘grep’ and few other and obvious source <(kubectl completion bash) and one “echo” statement (at the end of file) so I know my bashrc file has been loaded

So my update to .bashrc file looked like this :

alias nano="nano -cmET4"
alias grep="grep -i --color"
alias c="clear"

source <(kubectl completion bash)

echo "Hello k8s" 

Practice adding that to .bashrc file multiple time - in all kodeKloud test I did that - so I just have muscle memory about it .
Without autocomplete it is going to be very difficult to get speed that you must have to finish exam and have time to recheck your answers .

BTW : Even if you use ‘tmux’ or ‘screen’ in exam (which I did not) - your .bashrc file will get loaded there as well so your aliases should work .

Linux emulator Linux foundation uses (gate one) is very friendly it is as good as linux terminal (even better than katakoda one)
Also you should never be writing YAML files manually - either use “kubectl … --dry-run -o yaml” to create it for you or ‘wget’ it from documentation/github .

Be fast with ‘vim’ or ‘nano’ text editor that is quintessential for getting speedy.

Oliver Schoenborn:
OK good to know, so basically I have to plan on customizing my .bashrc manually at the start of the exam (no copy/paste), so I should keep this to only the most essential. A few aliases, the kubectl auto-completion, feedback that .bashrc was processed.

Since you mention a few tricks, a useful one is to allow auto-completion on an alias of kubectl. To do this, add a completion hook after the one that sources kubectl completion command. Your .bashrc would look like this:

...aliases...
alias k=kubectl

source <(kubectl completion bash)
complete -o default -F __start_kubectl k

The complete command is the same as the one that appears at the end of the output of the kubectl completion bash command (which you can see if you don’t pipe it to the source command).

Vishal Mann:
@Pranay i thought the tab auto complete is always works in exam, just like how it does in kodekloud’s katakoda terminal!

Which editor do you recommend, vi or nano for the test? The solution videos showed vi, so i was sticking to it.

Why wget and not the browser to consult the documentation and copying the sample yaml files?

TIA :slight_smile:

Pranay:
@Vishal Mann Both in CKA & CKAD I found autocompletion was not working - did not try to find why it did not - I just added my autocompletion stuff to ~/.bashrc file and source it - I anyway needed to add my nano/grep/clear alias in bashrc file so I added autocompletion there as well
In all practice tests that I took at kodekloud/killer.sh I just did that - spend first ~2 min doing test / testing it etc .

It is very … very important to stick to editor that you know intimately (in your sleep) - you have no time to learn or experiment/improvise in exam - so stick to editor you like and than practice with it for month in advance - you should know all about - copy / paste / cut (one line/multi line) / indentation / find (search) / replace / block (un)comment / undeo etc . You should be able to do all of above without even thinking . If you have practice with vim than just go with that . I have been using nano for long time and it is mine go to editor.

In past there were lot of folks warned about web base linux shell that they had during exam having issue with “copy & paste” - as you know (by now) that YAML is too picky about indentation and you can’t mix and match tabs and spaces . So if you copy and paste it from doc and you miss the indentation and you need to fix that - you are loosing your precious time - best is just wget files and than edit it I guarantee you it will be fast and less error prone .

Sometime copy and paste is only way to move forward for example - some examples in doc (such as node affinity/liveness probe etc) are given for pod template - but in exam you will be asked to do it for deployment so in that case you will have to add extra spaces to block of yaml that you copy from documentation and paste it in your yaml - so there you must know how to add spaces to multiple line in one shot so you can indent them in bulk

Vishal Mann:
also saw your doc: https://medium.com/@pranay.shah/nano-text-editor-tricks-for-ckad-exam-3b07f80dfe77
Thanks

Vishal Mann:
@Pranay “copy-paste text from the browser into the nano text editor inside katacoda browser base shell you can see in below animation text gets mingled”

Did the above happen in the CKAD exam terminal as well?

Pranay:
@Vishal Mann No - Exam terminal copy paste is fine - this issue was only related to katacoda web terminal . Exam uses Gate one terminal emulation .