<p>I followed the instructions for installing Bash completion as given by <code>kubectl completion -h</code>:</p>

<ol>
<li>I installed <code>bash-completion</code> via Homebrew</li>
<li>In my <code>~/.bashrc</code>, I first source <code>bash-completion</code> then output from the completion kubectl subcommand:

<ul>
<li><code>source $(brew --prefix)/etc/bash_completion</code></li>
<li><code>source &lt;(kubectl completion bash)</code></li>
</ul></li>
</ol>

<p>With these in place, I start up a new shell but the completion doesn't work. How do I get it working?</p>

<p>Once <code>bash-completion</code> is installed by Homebrew, it appears that its completions 
need to reside in <code>$(brew --prefix)/etc/bash_completion.d</code>. There you'll find a lot of other completions that come bundled. To add the completion for kubectl:</p>

<pre><code>$ kubectl completion bash &gt; $(brew --prefix)/etc/bash_completion.d/kubectl
</code></pre>

<p>That did the trick for me.</p>
