on Bash
$ brew install bash-completion
$ kubectl completion ~/.kubectl-bash
$ echo ". /usr/local/etc/profile.d/bash_completion.sh" >> ~/.bash_profile
$ echo ". ~/.kubectl-bash" >> ~/.bash_profile
$ source ~/.bash_profile
on Bash
$ brew install bash-completion
$ kubectl completion ~/.kubectl-bash
$ echo ". /usr/local/etc/profile.d/bash_completion.sh" >> ~/.bash_profile
$ echo ". ~/.kubectl-bash" >> ~/.bash_profile
$ source ~/.bash_profile