I was just looking at the Q&A of the CKA udemy course, and noticed that someone is saying that autocomplete and tmux are NOT allowed during the exam… Is this true?
It is normal that misinformation is passed around. We consume a lot of information from second hand. However, if we read the Candidate Handbook it says:
Only a single terminal console is available during the exam. Terminal multiplexers such as GNU Screen and tmux can be used to create virtual consoles.
Yeah - that’s what I had read, as well.
I wasn’t sure if it was misinformation, or possibly inconsistency with CKA exam proctors incorrectly enforcing rules.
I don’t, however, see any rules related to the use of kubectl autocomplete.
@Fernando Jimenez - do you have any information regarding the bash autocompletion in the exam environment? If it’s not available, will they allow us to use autocomplete, set an alias, and then modify complete -F to work with the alias?
I am the wrong person to answer that questions since I, personally, do not agree with the advice that you should use aliases and autocompletion in the exam. I trained myself to not rely on that. Therefore, I never care to investigate further nor did I asked or try.
@Grant Powers Auto completion works well in exam. Try to use/practice namespace at the beginning of the command (ie, k -n my-namespace get po) to work the auto completion. & use below commands from cheat sheet before you start your exam. source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
echo “source <(kubectl completion bash)” >> ~/.bashrc # add autocomplete permanently to your bash shell.
complete -F __start_kubectl k
@unnivkn - perfect answer! What you advise is what I typically do with my lab environments, and how I have my work kubectl environments setup.
@Fernando Jimenez - I completely understand that learning to not rely on these types of things while learning the fundamentals is really the only way to really learn the material (e.g., using the kubernetes dashboard or something like k9s for daily conveniences ), but the aliases and autocompletion have unfortunately become quite engrained into my muscle memory over the past two years… If it wasn’t allowed on the exam, I wanted to start working without the autocomplete and aliases to reverse that…but I do find them to be quite useful! As always, thanks so much for your help!
@Grant Powers What would be your level of discomfort if the day of the exam you find out that you can not do aliases and that auto-completion is not allowed because the proctor has not got the memo, oposite to what you might have been assured? It is just a rhetoric question.
@Fernando Jimenez - not terrible…just annoying and would perhaps cause me to take a trip back to the documentation a few times or kubectl -h more than normal. I’d probably survive…
@Grant Powers How do you use aliases and auto complete together? When I type
kubectl describe pod dep and press tab it suggests the list of pods available but this does not work when I have aliases set as
@Sidd - as @unnivkn stated above in this thread (which is covered in the http://kubernetes.io|kubernetes.io docs under the autocomplete section). I’m typically using bash (not sure how this works with zsh - I haven’t made the jump to zsh yet), and the steps are generally:
source <(kubectl completion bash) alias k=kubectl complete -F __start_kubectl k
Notice that the “complete -F” command has the alias that you want to perform the auto complete with - you can have multiple complete -F lines for each alias (I generally just use alias k=kubectl - I don’t have separate aliases for things like kubectl get <object>).
You can make this persistent by putting these commands in your ~/.bashrc file.
All of this is covered here in the docs: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-autocomplete
Hello, @Grant Powers
tmux is allowed during the exam. Please take a look into the point number 8.