Skip to content
Latchkey

gcloud components install: Add SDK Components

gcloud components install adds optional Cloud SDK components such as kubectl, gke-gcloud-auth-plugin, and beta.

Some workflows need extra components the base SDK does not ship. Installing the GKE auth plugin or kubectl is a one-liner, as long as it runs non-interactively.

What it does

gcloud components install downloads and installs named SDK components and their dependencies. It is the right way to add kubectl or gke-gcloud-auth-plugin to an image that has gcloud but not them.

Common usage

Terminal
gcloud components install gke-gcloud-auth-plugin --quiet
gcloud components install kubectl --quiet
# list what is available or installed
gcloud components list

Flags

FlagWhat it does
<COMPONENT>Component ID, e.g. kubectl, beta, gke-gcloud-auth-plugin
--quietInstall without the interactive confirmation prompt
list (subcommand)Show available and installed components
update (subcommand)Update installed components

In CI

Always pass --quiet so the installer does not prompt and hang the job. On Debian/Ubuntu images installed via apt, gcloud components install is disabled with a "managed by the packaging system" error; install the matching apt package (e.g. google-cloud-cli-gke-gcloud-auth-plugin) instead.

Common errors in CI

"You cannot perform this action because the Google Cloud CLI component manager is disabled for this installation" means an apt or snap install; use the OS package manager. A hang at "Do you want to continue (Y/n)?" means --quiet was omitted. "Could not fetch component listing" indicates a network or proxy problem reaching the SDK servers.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →