LinuxCommandLibrary

kubectl-plugin

TLDR

List all available plugins on the system $PATH

$ kubectl plugin list
copy

List only the executable names of available plugins without full paths
$ kubectl plugin list --name-only
copy

Display help
$ kubectl plugin [[-h|--help]]
copy

SYNOPSIS

kubectl plugin <list|install|view> [OPTIONS]

PARAMETERS

list
    List installed kubectl plugins.
Aliases: ls

--include-not-found
    Include plugins kubectl does not recognize (for list)

install
    Install plugins from repository.
Aliases: i

--dry-run
    Print objects that would be installed (for install)

--group
    Plugin group, default plugins.k8s.io (for install, view)

--quiet
    Print only plugin names (for install)

--repo-url
    Repository URL, default Kubernetes SIGs Krew index (for install, view)

--version
    Specific plugin version (for install)

--manifest
    Path to YAML manifest (experimental, for install)

--skip-confirm
    Skip interactive confirmation (for install)

view
    Show information about a plugin

--kubeconfig
    Path to kubeconfig file

--context
    Kubeconfig context name

-v, --v
    Log level verbosity

--namespace
    Namespace scope

DESCRIPTION

The kubectl plugin command is a built-in tool in Kubernetes for discovering, installing, listing, and viewing information about kubectl plugins. Plugins extend kubectl's functionality, allowing users to add custom commands without modifying the core tool.

It interacts with plugin repositories like the Krew index on GitHub, enabling easy installation of community-maintained plugins. Key features include listing locally installed plugins (including unrecognized ones), installing plugins by name with optional version and group specification, and viewing manifest details for remote plugins.

This replaces or complements external managers like Krew, providing a native, secure way to manage plugins directly from kubectl. Plugins must be executable binaries placed in directories like $XDG_DATA_HOME/kubectl/plugins. It supports dry-run installs, quiet mode, and skips interactive prompts for automation.

Security note: Plugins run with user privileges, so only install trusted ones.

CAVEATS

Plugins run as user binaries; verify sources to avoid security risks.
Requires internet for installs. Not all Krew features supported yet.
Alpha in v1.22; check Kubernetes version compatibility.

EXAMPLES

kubectl plugin list
kubectl plugin install view-secret
kubectl plugin view tree --group plugins.k8s.io

PLUGIN LOCATION

Installed to $XDG_DATA_HOME/kubectl/plugins or ~/.local/share/kubectl/plugins.

HISTORY

Introduced as alpha in Kubernetes v1.22 (Dec 2021) via KEPs 2421/2904. Promoted to beta in v1.24. Developed by Kubernetes SIG CLI to provide native plugin management, reducing reliance on external tools like Krew.

SEE ALSO

kubectl(1), krew(1)

Copied to clipboard