GKE Autopilot 或替代品中的 FluentBit?

FluentBit in GKE Autopilot or alternatives?

我正在使用 autpilot 模式将我的集群迁移到 GKE,我正在尝试应用 fluentbit 进行日志记录(发送到 Elasticsearch,然后发送到 Kibana,以便在松弛通道上收到警报)。

但是 GKE Autopilot 似乎不希望我在 hostPath 上做任何事情,除了根据这个 documentation 读入 /var/log 中的文件。但是 Fluentbit 需要访问 /var/lib/docker/containers,这与 /var/log 不同,还需要访问写入 /var/log

有没有办法解决这个问题,或者您通常如何使用警报登录 GKE Autopilot? 也欢迎经验分享

引用官方文档:

External monitoring tools

Most external monitoring tools require access that is restricted. Solutions from several Google Cloud partners are available for use on Autopilot, however not all are supported, and custom monitoring tools cannot be installed on Autopilot clusters.

-- Cloud.google.com: Kubernetes Engine: Docs: Concepts: Autopilot overview: External monitoring tools


Host options restrictions

HostPort and hostNetwork are not permitted because node management is handled by GKE. Using hostPath volumes in write mode is prohibited, while using hostPath volumes in read mode is allowed only for /var/log/ path prefixes. Using host namespaces in workloads is prohibited.

-- Cloud.google.com: Kubernetes Engine: Docs: Concepts: Autopilot overview: Host options restrictions

正如您已经发现的,GKEAutopilot 模式下无法访问 /var/lib/docker/containers 目录。

作为解决方法,您可以尝试

我认为您还可以考虑查看将日志从 Cloud Logging 导出到 Elasticsearch 的指南:


其他资源: