Medium1 markMultiple Choice
GCP ACE · Question 34 · Domain 4.2: Managing GKE resources
A developer reports that their application running in a GKE cluster is crashing on startup. You need to view the standard output (stdout) logs of the specific pod named 'frontend-app-xyz' to diagnose the issue.
Which command should you use?
A developer reports that their application running in a GKE cluster is crashing on startup. You need to view the standard output (stdout) logs of the specific pod named 'frontend-app-xyz' to diagnose the issue.
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.
kubectl get logs frontend-app-xyz
How to approach this question
Identify the kubectl command for viewing container logs.
Full Answer
C.kubectl logs frontend-app-xyz✓ Correct
kubectl logs frontend-app-xyz
The `kubectl logs [POD_NAME]` command is used to print the logs for a container in a pod. It retrieves the standard output and standard error streams from the container, which is essential for troubleshooting application crashes.
Common mistakes
Using `kubectl describe`, which is useful for scheduling issues but doesn't show application logs.
Practice the full GCP Associate Cloud Engineer Practice Exam 4
50 questions · hints · full answers · grading
More questions from this exam
Q01You have recently joined a new team and need to set up a new Google Cloud project for a developme...EasyQ02Your company uses Google Workspace. You need to grant a new developer, Alice, the ability to view...MediumQ03You have created a new GCP project and want to deploy a Compute Engine instance. However, when yo...MediumQ04Your startup has a strict monthly cloud budget of $500. You want to be notified via email when yo...EasyQ05Your finance team wants to analyze Google Cloud costs using standard SQL and build custom dashboa...Medium
Expert