3

I'm trying to setup the logging agent for StackDriver on a cos image but its reporting its an unsupported system. My thought is to create a "sidecar" container similar to how an AppEngine Flexible VM would bring its logs into stackdriver, however there is very little guidance on how to achieve this and the container images used by google via the gcr.io/ URLs aren't well documented (or even supposed to be used outside of Google?)

Does anyone have suggestions on how to do this? I'd like to be able to monitor and alert on certain logs my nginx container outputs as well as view the logs of the host VM itself.

For now, I have logs from my nginx container going to StackDriver Logging by utilizing the --log-driver=gcplogs flag on my docker run command.

someone1
  • 151
  • 1
  • 6

1 Answers1

2

At the moment COS images do not support the Stackdriver agent. There is a feature request to allow this functionality.

This discussion provides a workaround using “container_vm” image.

The image “container-vm-v20170214” is currently available in the project “google-containers”. You can spin a VM with this image using a command similar to this:

gcloud compute instances create VMName --image container-vm-v20170214 \
  --image-project=google-containers
  --zone us-central1-a \
  --machine-type f1-micro
Carlos
  • 1,385
  • 8
  • 15
  • I did see that but it's considered something Google wants to deprecate, and I'd rather not start a new project using something I know is being phased out. I think a sidecar approach is feasible, I'll have to do some digging to figure out how - possible a debian container that runs the logging agent installation and mount the host's /var/log/journal as a volume on the container? – someone1 Apr 13 '17 at 15:03
  • The approach you are proposing could work. There is some [Kubernetes documentation](https://kubernetes.io/docs/concepts/cluster-administration/logging/) pointing to a similar architecture. There are also some [other resources](http://queue.acm.org/detail.cfm?id=2965647) online but as you said it would need some research. – Carlos Apr 13 '17 at 20:28