如何查看GKE中的容器日志

发布于 2025-02-09 21:05:12 字数 369 浏览 4 评论 0原文

在我的GKE群集(版本v1.21.10-gke.2000)中,我希望将POD/容器产生的输出作为日志Explorer中的日志产生。

但是,单击Workloads的“概述”选项卡中的容器日志链接使Logs Explorer返回“未找到数据”。云记录已启用(组件:系统,工作负载)。云记录API也已启用。

到目前为止,我尝试过的是: 在刚创建的群集(版本1.22.8-gke.201)中的另一个(测试)项目中,此功能正常,即在Logs Explorer中也可以看到什么kubectl logs返回。开头提到的群集是很久以前创建的,显然需要一些更改 - 我如何确定需要修改哪些群集(或也许是节点池)设置以便能够在日志探索器中看到容器日志?我想避免从头开始创建一个新的群集。

In my GKE cluster (version v1.21.10-gke.2000) I would like to see output produced by pods/containers as logs in Logs Explorer.

But clicking on Container Logs link in Workloads' Overview tab makes Logs Explorer return 'No data found'. Cloud Logging is enabled (Components: System, Workloads). Cloud Logging API is enabled as well.

What I have tried so far:
In another (test) project in a freshly created cluster (version 1.22.8-gke.201) this works correctly, i.e. what kubectl logs returns is also visible in Logs Explorer. The cluster mentioned at the beginning was created long ago and apparently requires some changes - how can I figure out what cluster (or maybe node pool) settings need to be modified to be able to see container logs in Logs Explorer? I would like to avoid creating a new cluster from scratch.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

却一份温柔 2025-02-16 21:05:12

如果您在云日志记录中看不到任何日志,可以在此处尝试此处的说明。 -logs“ rel =“ nofollow noreferrer”>文档关于如何查找和使用 - 使用云记录 并找到确保您正在收集GKE日志部分。

If you can't see any of your logs in Cloud Logging, you could try the instructions here in this document about How to find—and use—your GKE logs with Cloud Logging and find the Make sure you’re collecting GKE logs section.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文