Medium1 markMultiple Choice
Domain 4.2: Managing GKE resourcesDomain 4.2GKEkubectlTroubleshooting

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?

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