Easy1 markMultiple Choice
Domain 4.2: Managing GKE resourceskubectlGKETroubleshootingLogging

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?

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