我在GKE中运行着一个很小的(1-2节点)kubernetes集群,运行了±40个Pod。当前的问题是它没有正确登录到GCE控制台。我从流畅的容器中看到许多消息,格式如下:
$ kubectl logs fluentd-cloud-logging-gke-xxxxxxxx-node-xxxx
2016-02-02 23:30:09 +0000 [warn]: Dropping 10 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 1 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 3 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 41 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
2016-02-02 23:30:09 +0000 [warn]: Dropping 5 log message(s) error_class="Google::APIClient::ClientError" error="Project has not enabled the API. Please use Google Developers Console to activate the 'logging' API for your project."
...等等。我每秒看到约5条消息,所以我知道事情正在产生日志。但是,在计算引擎控制台中,我看到类似以下内容:
因此,介于两者之间的某处显然丢失了许多消息。不过奇怪的是,我没有失去所有这些信息!
根据GH问题#15727中的建议,为集群配置了Logging.write和Monitoring.all特权。
有些日志正在显示,这确实令人困惑。鉴于该错误消息,我希望您的所有日志都不会显示在查看器中,因为听起来好像尚未为您的项目启用日志记录API。
您可以从此处的开发人员控制台中进行操作。尝试去那里,单击Enable API
按钮,然后查看错误是否继续出现。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句