1

I'm migrating my cluster to GKE using autpilot mode, and I'm trying to apply fluentbit for logging (to be sent to Elasticsearch and then Kibana to be alerted on a slack channel).

But it seems that GKE Autopilot doesn't want me to do anything on the hostPath other than reading into files inside /var/log according to this documentation. However Fluentbit needs to access /var/lib/docker/containers which is different from /var/log and also access to write inside /var/log

Is there a way to get around this or how do you usually log in GKE Autopilot with alerts? Experience sharing is also welcome

MatsuzakaSteven
  • 197
  • 1
  • 16

1 Answers1

2

Citing the official documentation:

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

As you've already found the access to the /var/lib/docker/containers directory is not possible with the GKE in Autopilot mode.

As a workaround you could try to either:

I'd reckon you could also consider checking the guide for exporting logs to Elasticsearch from Cloud Logging:


Additional resources:

Dawid Kruk
  • 8,982
  • 2
  • 22
  • 45