<p>How can I disable the kubectl autocompletions functionality on zsh. I'm running on osx and the autocompletions are slow(probably because they have to call the remote cluster API) and I don't want them no more.</p>

<p>First of all, autocompletion in <code>kubectl</code> command is not enabled by default. You needed to enable it beforehand. To disable it would be best just to reverse the steps you took to enable it. </p>

<h2>How to enable autocompletion for <code>kubectl</code> within <code>zsh</code> environment:</h2>

<hr>

<blockquote>
  <p>The kubectl completion script for Zsh can be generated with the command  <code>kubectl completion zsh</code>. Sourcing the completion script in your shell enables kubectl autocompletion.</p>
  
  <p>To do so in all your shell sessions, add the following to your  <code>~/.zshrc</code>  file:</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ source &lt;(kubectl completion zsh)
</code></pre>
  
  <p>--  <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion" rel="nofollow noreferrer">Kubernetes.io: Enabling shell autocompletion</a></p>
</blockquote>

<p>Following above example: </p>

<p>Command <code>$ source &lt;(kubectl completion zsh)</code>:</p>

<ul>
<li>can be run by itself in shell for autocompletion within current session</li>
<li><strong>can be put in  <code>~/.zshrc</code>  file to be loaded each time user logs in</strong> </li>
</ul>

<p>After applying one of above solutions it should provide available options with <code>TAB</code> keypress to type into terminal like below:</p>

<pre class="lang-sh prettyprint-override"><code>somefolder% kubectl get pod[TAB PRESSED HERE!]
poddisruptionbudgets.policy     pods.metrics.k8s.io             podsecuritypolicies.policy      
pods                            podsecuritypolicies.extensions  podtemplates
</code></pre>

<h2>How to disable autocompletion for <code>kubectl</code> within <code>zsh</code> environment:</h2>

<hr>

<p>As said above autocompletion is not enabled by default. It can be disabled: </p>

<ul>
<li>when created for current session by: 

<ul>
<li>creating a new session (example <code>zsh</code>) </li>
</ul></li>
<li><strong>when edited <code>~/.zshrc</code> file by:</strong> 

<ul>
<li>removing: <code>source &lt;(kubectl completion zsh)</code>  from <code>~/.zshrc</code> file. </li>
<li>creating a new session (example <code>zsh</code>) </li>
</ul></li>
</ul>

<p><strong>After that autocompletion for <code>kubectl</code> should not work.</strong></p>

<p>Please let me know if you have any questions to that. </p>
