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)
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
Q01You are starting a new initiative and need to create a new Google Cloud project using the command...EasyQ02A developer on your team needs to manage App Engine applications, including deploying new version...MediumQ03You have created a new Google Cloud project. You need to allow a specific group of developers to ...MediumQ04Which statement best describes the relationship between Google Cloud projects and billing accounts?EasyQ05Your company wants to be notified immediately in their Slack channel whenever their monthly Googl...Medium
Expert