You have installed Google Cloud SDK on a new Linux laptop to administer existing GKE clusters. When you attempt to run kubectl get pods you receive "command not found". You want the simplest supported way to add kubectl to the current SDK installation without using a package manager. Which command should you run?
The Google Cloud SDK includes an optional component that bundles the kubectl binary. The recommended way to install that binary when you are already using the Cloud SDK is the gcloud components command:
The install sub-command downloads and installs the specified component into the active SDK installation.
Specifying "kubectl" fetches the Kubernetes CLI component package maintained by Google.
Running gcloud components install kubectl therefore installs kubectl in place. The other options are incorrect because:
gcloud install kubectl is not a valid gcloud syntax.
gcloud components update kubectl would try to update a component that is not yet present and would fail.
sudo apt-get install kubectl uses the system package manager instead of the Cloud SDK and is not the simplest supported method for this scenario.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is kubectl and why is it needed for GKE?
Open an interactive chat with Bash
Why use `gcloud components install kubectl` instead of `sudo apt-get install kubectl`?
Open an interactive chat with Bash
What are `gcloud components` and how do they work?
Open an interactive chat with Bash
What is kubectl and what is it used for in GKE?
Open an interactive chat with Bash
What are gcloud components and how do they work?
Open an interactive chat with Bash
How does the gcloud CLI differ from system package managers?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Planning and implementing a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .