You have a set of applications running on a Google Kubernetes Engine (GKE) cluster, and you are using Stackdriver Kubernetes Engine Monitoring. You are bringing a new containerized application required by your company into production. This application is written by a third party and cannot be modified or reconfigured. The application writes its log information to /var/log/app_messages.log, and you want to send these log entries to Stackdriver Logging. What should you do?
Suggested Answer: B, D
Get Premium Professional Cloud DevOps Engineer Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
33 comments · newest first
FL
Fletcher
11 months ago
Definitely not A, it won't handle that log file correctly.
ZA
Zack
11 months ago
Surprised that C is even an option, seems like overkill!
LA
Lashaunda
11 months ago
A won't capture those logs properly, just saying.
LE
Leanora
11 months ago
I think D could work too, but it seems a bit complex.
DA
Dalene
12 months ago
B is the way to go for custom logging!
KR
Kris
12 months ago
Option C seems off to me since it suggests using GCE instead of GKE, which we learned isn’t necessary for this scenario.
GE
Georgeanna
1 year ago
I feel like the default agent in option A wouldn’t capture custom logs like this one, but I can't recall the details of why that is.
DO
Dorinda
1 year ago
I remember something about using sidecar containers from a practice question, so option D might be the right approach, but I’m not confident about the shared volume part.
AD
Adelle
1 year ago
I think option B sounds familiar because we practiced deploying Fluentd in our labs, but I'm not entirely sure about the specifics of the configuration.
BR
Brinda
1 year ago
This question is testing our understanding of Kubernetes logging and monitoring. I'd start by reviewing the Stackdriver Kubernetes Engine Monitoring documentation to see if there are any built-in options I'm missing, but ultimately I think option B with Fluentd is the most robust solution.
KA
Kaitlyn
1 year ago
I think option B is the way to go here. Fluentd is a well-established solution for log forwarding in Kubernetes, and it should be able to handle this scenario without too much trouble.
SH
Sherly
1 year ago
Option D looks interesting, using a sidecar container to tail the logs. That could be a good approach if I'm not comfortable with Fluentd. I'll need to think through the implementation details, though.
TO
Tom
1 year ago
Hmm, I'm a bit unsure about this one. I'm not very familiar with Fluentd, so I'd need to do some research on how to properly configure it for this use case.
MA
Mabelle
1 year ago
This seems like a straightforward question. I'd go with option B and deploy a Fluentd daemonset to handle the log forwarding.
NO
Noah
1 year ago
Stackdriver Logging, huh? Sounds like a service that's about as reliable as a stack of drunk toddlers.
SI
Simona
1 year ago
Writing a script to tail the log file and run it as a sidecar container? That's a pretty clever idea. I like the use of a shared volume to access the log file.
AL
Aleta
1 year ago
Using a sidecar container to tail the log file is a practical solution for this scenario.
PH
Phuong
1 year ago
Another option could be to use a logging agent like Fluentd to collect and send the log entries.
TA
Tamie
1 year ago
Yes, that's a good approach to send the log entries to Stackdriver Logging.
KE
Keith
1 year ago
Installing Kubernetes on GCE and customizing the Stackdriver Logging configuration? That's overkill for this use case. We don't need to go that route.
HA
Hailey
1 year ago
Yes, that way the sidecar container can read the log file and forward the log entries to Stackdriver Logging without modifying the application.
MA
Maryann
1 year ago
That's a great idea! We can deploy the sidecar container alongside the application container in the same pod.
KI
Kimbery
1 year ago
You can use a sidecar container to collect the log entries from /var/log/app_messages.log and send them to Stackdriver Logging.
DE
Dell
1 year ago
Ah, using Fluentd to tail the log file and send it to Stackdriver Logging sounds like the way to go. It's a bit more involved, but it should get the job done.
SH
Shawnee
1 year ago
Yan: Once Fluentd is set up, you can view the log entries from the third-party application in Stackdriver Logging.
YA
Yan
1 year ago
User 2: That's right. Make sure to deploy Fluentd as a DaemonSet in your GKE cluster to collect the logs.
HY
Hyman
1 year ago
User 1: Yes, you can create a Fluentd configuration file to tail the log file and send it to Stackdriver Logging.
NO
Noel
2 years ago
Hmm, the default Stackdriver Kubernetes Engine Monitoring agent configuration doesn't seem to be the right solution here. We need to do some custom configuration to get the logs into Stackdriver Logging.
ST
Stefania
1 year ago
D) Write a script to tail the log file within the pod and write entries to standard output. Run the script as a sidecar container with the application's pod. Configure a shared volume between the containers to allow the script to have read access to /var/log in the application container.
TA
Tanesha
1 year ago
B) Deploy a Fluentd daemonset to GKE. Then create a customized input and output configuration to tail the log file in the application's pods and write to Slackdriver Logging.
ST
Stefania
2 years ago
I'm not sure, but I think option D could also work. Writing a script to tail the log file within the pod and configuring a shared volume seems like a feasible approach. It might require more manual setup, but it could be a good alternative.
VA
Vallie
2 years ago
I agree with Nobuko. Option B provides a clear solution without needing to redeploy applications or write custom scripts. It's the most efficient way to handle the log information.
NO
Nobuko
2 years ago
I think option B is the best choice. Deploying a Fluentd daemonset and creating a customized configuration seems like the most direct way to send the log entries to Stackdriver Logging.