Easy1 markMultiple Choice
GCP ACE · Question 35 · Domain 4.2: Managing GKE resources
A developer reports that their application deployed on GKE is crashing on startup. You need to view the standard output (stdout) of the container to see the error message.
Which command should you use?
A developer reports that their application deployed on GKE is crashing on startup. You need to view the standard output (stdout) of the container to see the error message.
Which command should you use?
Answer options:
A.
gcloud compute instances tail-serial-port-output [NODE_NAME]
B.
kubectl describe pod [POD_NAME]
C.
kubectl logs [POD_NAME]
D.
gcloud container logs read [POD_NAME]
How to approach this question
Identify the Kubernetes command used for viewing application logs.
Full Answer
C.kubectl logs [POD_NAME]✓ Correct
The `kubectl logs` command is used to print the logs (stdout and stderr) from a container in a pod. This is the primary way to troubleshoot application crashes or errors within Kubernetes.
Common mistakes
Using `kubectl describe`. While useful for troubleshooting why a pod won't start (e.g., ImagePullBackOff), it does not show the application's internal logs.
Practice the full GCP Associate Cloud Engineer Practice Exam 7
50 questions · hints · full answers · grading
More questions from this exam
Q01You are starting a new initiative and need to create a new Google Cloud project using the Cloud S...EasyQ02Your company is migrating to Google Cloud and wants to manage user identities centrally. They cur...MediumQ03You have just created a new Google Cloud project and want to deploy a containerized application u...MediumQ04Your finance team wants to perform complex SQL queries on your Google Cloud billing data to analy...MediumQ05You are managing a development project in Google Cloud. You want to ensure that you are notified ...Easy
Expert