You provisioned a regional GKE cluster called analytics-cluster in region us-central1 in the acme-prod project. From Cloud Shell you want to set up kubectl so that you can manage the cluster immediately. You have not configured any Kubernetes contexts yet. Which single command will correctly create the kubeconfig entry and set the current context?
The gcloud container clusters get-credentials command writes the cluster's endpoint and authentication data to the kubeconfig file and switches kubectl to that context. For a regional cluster, you must specify the region flag rather than a zone. Including the --project flag ensures the command targets the correct project. The other commands are either syntactically incorrect, use the wrong flag, or rely on contexts that have not been created yet.
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 kubeconfig and why is it important?
Open an interactive chat with Bash
Why is the region flag necessary for a regional GKE cluster?
Open an interactive chat with Bash
How does the gcloud container clusters get-credentials command work?
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 .