Listing the Fluent Bit Files
First, let’s list the files related to Fluent Bit:DaemonSet for Fluent Bit
Thefluent-bit.yaml file creates a DaemonSet in the efk namespace. This DaemonSet deploys Fluent Bit on every node, ensuring that logs are collected consistently. Below is an excerpt from the file:
ConfigMap: Fluent Bit Configuration and Parsers
The ConfigMap (fluent-bit-configmap.yaml) defines how Fluent Bit processes logs, sets service parameters, and configures inputs, filters, and outputs. A custom parser docker_no_time is defined to correctly handle Docker JSON logs. Here is the consolidated configuration:
- The [SERVICE] section sets global properties such as flush intervals, log level, and HTTP server settings used for health checks.
- The [INPUT] sections define sources: one tailing container logs and one collecting systemd logs (filtered for
kubelet.service). - The [FILTER] section enriches logs with Kubernetes metadata and handles merging and parsing.
- The [OUTPUT] sections forward logs to Elasticsearch with proper formatting and connection parameters.
ServiceAccount for Fluent Bit
The ServiceAccount defined influent-bit-sa.yaml ensures that Fluent Bit can authenticate with the Kubernetes API for log metadata collection:
ClusterRole for Fluent Bit
To grant Fluent Bit the necessary permissions to access Kubernetes resources, a ClusterRole is defined influent-bit-clusterrole.yaml. This role grants comprehensive access to the required resources:
fluent-bit-clusterrolebinding.yaml) binds this role to the Fluent Bit ServiceAccount.
Deploying Fluent Bit
With all configuration files in place, deploy Fluent Bit with the following command:Since the Event Generator App is already deployed, only the Fluent Bit configuration is updated without redeploying the app.
Verifying Fluent Bit Logging
To ensure Fluent Bit is running and correctly processing logs, follow these steps:- Check the pods:
- View the logs of a Fluent Bit pod: