How to forward a kubernetes container log file into Stackdriver?

9/1/2017

I have a cluster in Google and the Stackdriver logging, and monitoring are enabled.

Question 1:

How can I forward file based logs into stackdriver?

I tried these steps:

  • change the fluentd config map in kube-system name space - I was unable to change
  • tried to install the stackdriver agent into a container and after forward it somehow to stackdriver. I gave some authorization error.
  • turn off the default Stackdriver logging, and create an own daemonset and config set for the logging.

As I found in kubernetes manual

Logging Using Stackdriver - Kubernetes in the Prerequests section

If you’re on GKE and Stackdriver Logging is enabled in your cluster, you cannot change its parameters

Question 2:

How to monitor free space on additional disk in kubernetes containers?

Another issue, the default Stackdriver monitoring doesn't know anything about the additional disks which attached to containers. That is my next problem, how to monitor the additional disk spaces.

That disks are a Persistent Volume Claims in kubernetes side, and provisioned automatically.

-- Gergely Tankovics
google-cloud-platform
kubernetes
logging
stackdriver

1 Answer

9/8/2017

How to monitor free space on additional disk in kubernetes containers?

Right now there is no way to find that out, but there is an open proposal and work will happen later on this. See the proposal here.

-- surajd
Source: StackOverflow