fluent-bit: create configmap for kubernetes nodes

The last step in replacing Loki with Victoria Logs is to ingest logs
from Kubernetes pods.  Like Promtail, Fluent Bit is capable of
augmenting log records with Kubernetes metadata, so we can search for
logs by pod name, namespace, etc.  This of course requires access to the
Kubernetes API, and the easiest way to provide that is to run Fluent Bit
as a Kubernetes pod, granting its service account the appropriate
permissions.

Since Fluent Bit also collects logs from the systemd journal, I want to
make sure the configuration for that function stays the same on
Kubernetes nodes as on all other servers.  One way to do that would be
to run two different instances of Fluent Bit: one managed by Ansible
that collects journal messages, and another managed by Kubernetes that
collects pod logs.  This seems like unnecessary overhead, so I have
chosen a hybrid approach.  Ansible manages the configuration for the
process running in Kubernetes.
This commit is contained in:
2025-11-28 21:25:19 -06:00
parent 719be9a4e9
commit 5dba0aec8f
7 changed files with 90 additions and 0 deletions

6
fluent-bit-configmap.yml Normal file
View File

@@ -0,0 +1,6 @@
- hosts: kubelet
run_once: true
gather_facts: false
become: false
roles:
- role: fluent-bit-configmap