Hard1 markMultiple Choice

GCP ACE · Question 24 · Domain 3.2: Deploying and implementing GKE resources

An application running on your GKE cluster is crashing. You need to view the application logs outputted by a specific pod named frontend-pod-123 to troubleshoot the issue.

Which TWO methods can you use to view these logs? (Select TWO)

Answer options:

A.

Use the command kubectl logs frontend-pod-123

B.

View the logs in the Google Cloud Console under Cloud Logging (Logs Explorer)

C.

SSH into the GKE node and read the /var/log/syslog file

D.

Use gcloud compute instances tail-serial-port-output

E.

View the logs in Cloud Trace

How to approach this question

Identify the two standard ways to view container logs in GCP: the native Kubernetes CLI and the GCP managed logging service.

Full Answer

Use the command kubectl logs frontend-pod-123, View the logs in the Google Cloud Console under Cloud Logging (Logs Explorer)
There are two primary ways to view pod logs in GKE. 1) Using the Kubernetes CLI: `kubectl logs [POD_NAME]`. 2) Because GKE has built-in integration with Google Cloud's operations suite, all stdout/stderr from containers is automatically ingested into Cloud Logging, where you can query it using the Logs Explorer.

Common mistakes

Selecting Cloud Trace (which is for latency, not logs) or trying to SSH into nodes (which is an anti-pattern in Kubernetes).

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam