Rusty:
Have a question regarding setting autocomplete.
During the exam I did the basic two steps. alias k=kubectl
and complete -F ___start__kubectl k
and it didn’t work as it would in the labs. What did I miss?
Are these two steps required as well?
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.
Mohamed Ayman:
Yes, they are required.
Mohamed Ayman:
Go over to the Cheatsheet (https://kubernetes.io/docs/reference/kubectl/cheatsheet/) and copy / paste the first 4 lines:
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.
alias k=kubectl
complete -F __start_kubectl k
Rusty:
@Mohamed Ayman Thanks. I just did the last two nowonder I messed up. Thanks
Mohamed Ayman:
You’re welcome