- Drop executables named
PATHand invoke with
kubectl plugin listshows available plugins
Kubectl plugins are a lightweight mechanism to extend
kubectl with custom functionality to suit your needs.
As of version 1.12, kubectl has a simple plugin mechanism to expose binaries on your
PATH as kubectl subcommands.
When invoking an unknown subcommand
kubectl my-plugin, kubectl starts searching for an executable named
kubectl-my_plugin on your
Note how the dash is mapped to an underscore. This is to enable plugins that are invoked by multiple words, for example
kubectl my plugin would trigger a search for the commands
kubectl-my. The more specific match
always wins over the other, so if both
kubectl-my-plugin exist, the latter will be called.
When a matching executable is found, kubectl calls it, forwarding all extra arguments.
The reference on kubernetes.io knows more.
Windows compatibilityOn windows, the minimum required version to use the plugin mechanism is 1.14.
Listing installed plugins
kubectl plugin list
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.