Kubernetes on GCP, Stackdriver logging after update to v1.15

4/7/2020

I have a Kubernetes cluster on GCP that hosts a Flask application and some more services.

Before upgrading the master node to version 1.15 (was 1.14.x) I saw every log from the flask application on Stackdriver's GKE Container logs, now I don't get any log.

Searching through the release notes I noticed that from 1.15 they:

disabled stackdriver logging agent to prevent node startup failures

I'm not entirely sure that's the reason but I'm sure that the logging stopped after upgrading the master and node versions to 1.15, there has been no code change in the application core.

My question is how can I reactivate the logs I saw before?

-- Nicolò Gasparini
google-cloud-platform
google-cloud-stackdriver
kubernetes

1 Answer

4/7/2020

I actually found the solution, as stated by the release notes, the stackdriver agent actually becomes disabled by default in 1.15.

To activate it again you need to edit the cluster following these instructions, setting "System and workload logging and monitoring" under "Stackdriver Kubernetes Engine Monitoring" After that, I could not use anymore the legacy Stackdriver Monitoring, so I found my logs weren't under the resource "GKE Container" but under "Kubernetes Container".

I also had to update every log-based metric that had a filter on resource.type="container", changing it to resource.type="k8s_container"

-- Nicolò Gasparini
Source: StackOverflow