How to enable kubernetes commands autocomplete

11/23/2018

I'm tired of writing all kubectl and kubeadm commands by hand. Is there any way of enabling autocomplete on these commands?

-- Lukasz Dynowski
kubernetes

2 Answers

11/23/2018

Linux Solution

# Execut these commands
$ echo "source <(kubectl completion bash)" >> ~/.bashrc
$ echo "source <(kubeadm completion bash)" >> ~/.bashrc

# Reaload bash without logging out
$ source ~/.bashrc 
-- Lukasz Dynowski
Source: StackOverflow

11/23/2018

Yes, it's documented here: Enabling shell autocompletion.

-- rln
Source: StackOverflow