<p>I installed kubectl and tried enable shell autocompletion for zsh.
When I'm using <code>kubectl</code> autocompletion works fine. Howewer when I'm trying use autocompletion with alias <code>k</code> then shell return me</p>
<pre><code>k g...(eval):1: command not found: __start_kubectl                                                                                                                            8:45 
(eval):1: command not found: __start_kubectl
(eval):1: command not found: __start_kubectl
</code></pre>
<p>In my <code>.zshrc</code> file I have:</p>
<pre><code>source &lt;(kubectl completion zsh)
alias k=kubectl
compdef __start_kubectl k
</code></pre>

Dawid Krok
<p>If you use Oh My Zsh, what fixed it for me was updating:</p>
<pre><code>omz update

... lots of output

source ~/.zshrc
</code></pre>
