Google Associate Cloud Engineer Question 193
Single answerGoogle Cloud PlatformYou are a Google Cloud Associate Cloud Engineer tasked with auditing the current Google Kubernetes Engine (GKE) clusters running in your project. Which command should you use to list all the running GKE clusters in the project?
- A
gcloud container clusters list
- B
kubectl get clusters
- C
gcloud compute instances list
- D
kubectl get nodes
Show answer and explanation
Correct answer: A
Explanation
To view the current running GKE cluster inventory, you should use the 'gcloud container clusters list' command. This command provides a list of all the Kubernetes Engine clusters available in the specified project, allowing you to audit and manage the cluster resources effectively.
- A. Correct.
This command is used to list all the GKE clusters in the current project. It is the correct command for viewing the running GKE cluster inventory.
- B. Incorrect.
This command is incorrect because 'kubectl' is used for interacting with Kubernetes resources within a cluster, not for listing clusters themselves.
- C. Incorrect.
This command lists all the Compute Engine instances in a project, not the GKE clusters.
- D. Incorrect.
This command retrieves the nodes within a specific Kubernetes cluster but does not list the clusters themselves.