Google Associate Cloud Engineer Question 194
Single answerGoogle Cloud PlatformAs a Google Cloud Associate Cloud Engineer, you need to view the current running Google Kubernetes Engine (GKE) clusters in your project to verify their configurations. Which command should you use to list all running GKE clusters in a specific project and region?
- A
gcloud container clusters list --project [PROJECT_ID] --region [REGION]
- B
kubectl get clusters --project [PROJECT_ID] --region [REGION]
- C
gcloud compute clusters list --project [PROJECT_ID] --region [REGION]
- D
gcloud container clusters describe [CLUSTER_NAME] --region [REGION]
Show answer and explanation
Correct answer: A
Explanation
To view the current running GKE clusters in a project and region, the 'gcloud container clusters list' command is used with the specific project and region as parameters. This command utilizes the Google Cloud SDK, which is the appropriate tool for managing GKE resources.
- A. Correct.
This command is correct. It lists all the GKE clusters in the specified project and region using the gcloud CLI, which is the standard tool for managing GKE clusters.
- B. Incorrect.
This command is incorrect. 'kubectl' is used for interacting with Kubernetes resources, not for listing GKE clusters.
- C. Incorrect.
This command is incorrect. 'gcloud compute clusters list' is not a valid command for listing GKE clusters.
- D. Incorrect.
This command is incorrect. 'gcloud container clusters describe' is used to describe a specific GKE cluster, not to list all clusters.