You have just deployed a zonal GKE cluster named "analytics-cluster" in us-central1-b under the project ID "data-prod". A teammate is logged in to Cloud Shell on their own account and already has the Google Cloud SDK and kubectl installed. To enable kubectl to talk to the new cluster by default, which single command should they execute?
The gcloud command get-credentials retrieves the cluster's endpoint and authentication data, then updates the user's kubeconfig file, setting the current context to that cluster. The correct syntax requires the cluster name, its zone or region, and optionally the project ID. The other commands are either misspelled, use the wrong gcloud group, specify an invalid flag, or attempt manual context creation that will not pull credentials.
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 gcloud container clusters get-credentials?
Open an interactive chat with Bash
What is kubeconfig, and how is it used in Kubernetes?
Open an interactive chat with Bash
Why is specifying the correct zone/region important for GKE commands?
Open an interactive chat with Bash
What is 'get-credentials' in GCP?
Open an interactive chat with Bash
What is the 'kubeconfig' file, and why is it needed?
Open an interactive chat with Bash
Why is the zone important in GCP commands like 'get-credentials'?
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 .