Medium1 markMultiple Choice
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?
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
Q01What is the primary purpose of a Google Cloud project?EasyQ02Your development team needs to manage Compute Engine instances in a specific project. They need t...MediumQ03You are automating the setup of a new Google Cloud project using a bash script. You need to enabl...EasyQ04Your startup has a strict monthly cloud budget of $500. You want to be notified immediately if yo...MediumQ05Your finance team wants to perform granular analysis of your Google Cloud spending using SQL. The...Hard
Expert