Reputation: 586
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.
Upvotes: 2
Views: 1980
Reputation: 9885
First of all, autocompletion in kubectl
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.
kubectl
within zsh
environment:The kubectl completion script for Zsh can be generated with the command
kubectl completion zsh
. Sourcing the completion script in your shell enables kubectl autocompletion.To do so in all your shell sessions, add the following to your
~/.zshrc
file:$ source <(kubectl completion zsh)
Following above example:
Command $ source <(kubectl completion zsh)
:
~/.zshrc
file to be loaded each time user logs in After applying one of above solutions it should provide available options with TAB
keypress to type into terminal like below:
somefolder% kubectl get pod[TAB PRESSED HERE!]
poddisruptionbudgets.policy pods.metrics.k8s.io podsecuritypolicies.policy
pods podsecuritypolicies.extensions podtemplates
kubectl
within zsh
environment:As said above autocompletion is not enabled by default. It can be disabled:
zsh
) ~/.zshrc
file by:
source <(kubectl completion zsh)
from ~/.zshrc
file. zsh
) After that autocompletion for kubectl
should not work.
Please let me know if you have any questions to that.
Upvotes: 3