Google Cloud Associate Cloud Engineer — Question 180
You are assigned to maintain a Google Kubernetes Engine (GKE) cluster named 'dev' that was deployed on Google Cloud. You want to manage the GKE configuration using the command line interface (CLI). You have just downloaded and installed the Cloud SDK. You want to ensure that future CLI commands by default address this specific cluster What should you do?
Answer options
- A. Use the command gcloud config set container/cluster dev.
- B. Use the command gcloud container clusters update dev.
- C. Create a file called gke.default in the ~/.gcloud folder that contains the cluster name.
- D. Create a file called defaults.json in the ~/.gcloud folder that contains the cluster name.
Correct answer: A
Explanation
The correct answer is A because using the command gcloud config set container/cluster dev sets the default cluster for future CLI commands. Option B updates the cluster but does not set it as the default, while options C and D suggest creating files, which is not necessary for configuring the CLI to target a specific cluster.