Medium1 markMultiple Choice
GCP ACE · Question 22 · Domain 3.2: Deploying and implementing GKE resources
You have created a new Google Kubernetes Engine (GKE) cluster. You need to configure your local kubectl command-line tool to communicate with this cluster. Which command should you run?
You have created a new Google Kubernetes Engine (GKE) cluster. You need to configure your local kubectl command-line tool to communicate with this cluster. Which command should you run?
Answer options:
A.
kubectl config set-cluster [CLUSTER_NAME]
B.
gcloud container clusters get-credentials [CLUSTER_NAME]
C.
gcloud compute clusters connect [CLUSTER_NAME]
D.
kubectl auth login [CLUSTER_NAME]
How to approach this question
Remember the gcloud command used to fetch GKE credentials.
Full Answer
B.gcloud container clusters get-credentials [CLUSTER_NAME]✓ Correct
gcloud container clusters get-credentials [CLUSTER_NAME]
To interact with a GKE cluster using `kubectl`, you must first populate your local `~/.kube/config` file with the cluster's endpoint and authentication data. The `gcloud container clusters get-credentials` command does this automatically.
Common mistakes
Trying to use raw `kubectl` commands to set up authentication, which is complex and bypasses GCP's IAM integration.
Practice the full GCP Associate Cloud Engineer Practice Exam 1
50 questions · hints · full answers · grading
More questions from this exam
Q01What is the highest level of the Google Cloud resource hierarchy?EasyQ02You need to enable the Compute Engine API in a new project using the command line. Which command ...EasyQ03You are setting up a new GCP environment. You need to grant a group of developers access to view ...MediumQ04You want to receive an email notification when your GCP spending exceeds $1000 this month. What s...EasyQ05You need to analyze your GCP billing data using complex SQL queries to understand cost trends acr...Medium
Expert