Kubectl tips and tricks

Autocompletion for alias commands was supported on v1.10! You can enable it with the following steps:

# For bash
source /path/to/bash_completion
source <(kubectl completion bash)
alias k=kubectl
complete -o default -F __start_kubectl k

# For zsh
source <(kubectl completion zsh)
alias k=kubectl
complete -o default -F __start_kubectl k
7 Likes