
Answer-first summary for fast verification
Answer: gcloud container clusters get-credentials dev-cluster kubectl get nodes
The correct answer is A. The gcloud container clusters get-credentials command updates the kubeconfig file with appropriate credentials and endpoint information to point kubectl at the dev-cluster. This ensures that subsequent kubectl commands will be executed against the dev-cluster. After setting the credentials, running kubectl get nodes will retrieve the node status for dev-cluster, showing the list of nodes in the cluster.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
As part of your role as a Google Associate Cloud Engineer, you previously used the gcloud container clusters command to create two Google Kubernetes Engine (GKE) clusters:
When you execute the kubectl get nodes command, it only displays the nodes from the prod-cluster. What specific commands should you execute to verify the node status in the dev-cluster?
A
gcloud container clusters get-credentials dev-cluster kubectl get nodes
B
gcloud container clusters update -generate-password dev-cluster kubectl get nodes
C
kubectl config set-context dev-cluster kubectl cluster-info
D
kubectl config set-credentials dev-cluster kubectl cluster-info