Medium1 markMultiple Choice
Domain 4.2: Managing GKE resourcesGKEKuberneteskubectlTroubleshooting

GCP ACE · Question 34 · Domain 4.2: Managing GKE resources

A developer reports that their application running on a GKE cluster is crashing. You need to view the standard output (stdout) logs of a specific pod named 'frontend-app-xyz' to diagnose the error.

Which command should you use?

Answer options:

A.

gcloud container logs read frontend-app-xyz

B.

kubectl describe pod frontend-app-xyz

C.

kubectl logs frontend-app-xyz

D.

docker logs frontend-app-xyz

How to approach this question

Identify the standard Kubernetes command for viewing application logs.

Full Answer

C.kubectl logs frontend-app-xyz✓ Correct
To view the application logs (stdout/stderr) of a specific pod in a Kubernetes cluster, you use the `kubectl logs [POD_NAME]` command. While these logs are also sent to Cloud Logging (if enabled), `kubectl logs` is the quickest way to view real-time logs directly from the cluster during active troubleshooting. `kubectl describe` is useful for seeing Kubernetes events related to the pod, but not the application's internal logs.

Common mistakes

Choosing `kubectl describe`, which shows pod metadata and events, not the actual application logs.

Practice the full GCP Associate Cloud Engineer Practice Exam 6

50 questions · hints · full answers · grading

More questions from this exam