Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 514 Bytes

018_setup_kubectl_auto_completion.md

File metadata and controls

23 lines (17 loc) · 514 Bytes

TASK: Set up kubectl autocompletion for bash

ANSWER

(Tested successfully)

This is directly from kubernetes.io

echo 'source <(kubectl completion bash)' >>~/.bashrc

If you have an alias for kubectl, you can extend shell completion to work with that alias:

echo 'alias k=kubectl' >>~/.bashrc

echo 'complete -F __start_kubectl k' >>~/.bashrc