Siva Guru Charan Goteti:
Hey guys those who’ve appeared for the CKA exam - could you help me with the commands for setting up of bash completion. Sorry for posting a basic question. I would not want to mess up the exam terminal.
Thanks in advance.
Siva Guru Charan Goteti:
Hey guys those who’ve appeared for the CKA exam - could you help me with the commands for setting up of bash completion. Sorry for posting a basic question. I would not want to mess up the exam terminal.
Thanks in advance.
Mohamed Ayman:
Check the following steps https://kubernetes.io/fr/docs/tasks/tools/install-kubectl/#configurations-kubectl-optionnelles|https://kubernetes.io/fr/docs/tasks/tools/install-kubectl/#configurations-kubectl-optionnelles
Richard:
Docs link above is useful as you can bookmark before exam for the completion part.
This is what I would use - you’d have to memorise this apart from the completion part though. The vim settings make indentation work better, plus case-insensitive search - there are longer versions that may be easier to memorise e.g. autoindent for ai.
alias kc=kubectl
# Ensure last argument here matches alias above
complete -F __start_kubectl kc
# Use this as suffix to generate template manifests
dry='-o yaml --dry-run=client'
echo 'set sw=2 ts=2 expandtab ai ic' >~/.vimrc
Siva Guru Charan Goteti:
Thank you Ayman and Richard
Richard:
My extract works for Kodekloud but you probably need the docs part (source kubectl completion command etc) for the CKA exam
Ravi Tripathi:
@Richard I have used this link and it works for me. https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-bash-linux/