简体   繁体   中英

GKE - Stackdriver

I am trying to get the output of my pod logs into Stackdriver, but I am running into an issue where they are not being sent to Stackdriver.

If I look at the GKE cluster details, it is showing this:

Stackdriver Logging - Disabled
Stackdriver Monitoring  - Enabled

I cannot find any information on how to enable Stackdriver on a running cluster.

There is a running heapster pod, and I have run this command as this wasn't set:

gcloud container clusters update <cluster> --monitoring-service=monitoring.googleapis.com

That is now showing the correct service, but this doesn't solve the logging issue. Is anyone able to shed any light on how to enable to logging?

Thanks

Currently there is no support for enabling logging in GKE cluster after it's been created. We are aware of the problem and we're going to introduce such possibility.

In the meantime you can try the following workarounds:

  • Create fluentd DaemonSet on your own using fluentd-gcp-ds.yaml . You need to change namespace there to avoid interaction with addon-manager . The disadvantage of this approach is that GKE won't manage/upgrade your fluentd DaemonSet.
  • Migrate to a new cluster with logging disabled if this works for your.

Please let me know if you have more questions. Apologies for the inconvenience.

Do you have the Strackdriver api enabled in your project?

https://console.cloud.google.com/apis/api/logging.googleapis.com/overview

I don't see an option anywhere to specifically enable Stackdriver logging after you've already created the cluster. When you create a new cluster the option is on by default, so I guess recreating it is one option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM