What you will learn in this TP
- Install Loki and Fluent Bit
- Enrich with metadata
- Exclude a pod by annotation
Introduction #
What you will learn in this section
- Install Loki and Fluent Bit
- Enrich with metadata
- Exclude a pod by annotation
Context. The cluster is growing and container logs can only be seen with kubectl logs. You centralise all logs along with their Kubernetes context.
Prerequisites: kind, kubectl, helm · Estimated time: 45 min
All the cluster logs, with namespace and pod.Setup #
Guided steps, with their solutions.
1. Create the cluster and Loki
Why? Loki in monolithic mode is enough for this lab.
Create a kind cluster and install Loki (grafana/lokichart in single binary mode).2. Install Fluent Bit
Why? The chart deploys the DaemonSet, the RBAC permissions (for the kubernetes filter) and the configuration.
Install Fluent Bit with a Loki output and the kubernetes filter.3. Deploy a chatty application
Why? You need logs to check the enrichment.
Start a pod that writes one line per second in thedemonamespace.4. Query with metadata
Why? Namespace and pod labels make searching immediate.
Open a tunnel to Loki and search for the logs of thedemonamespace.5. Exclude by annotation
Why? Teams manage the noise of their own pods without changing the central configuration.
Annotate the pod withfluentbit.io/exclude: "true"and check that its new lines no longer arrive.6. Clean up
Why? To free up resources.
Delete the cluster.
Difficulty level : ●●●○○ (3/5)
My progress
Sign in to track your progress and take notes. Sign in
Recommended Articles
Fluent Bit sur Kubernetes : DaemonSet, multiline, tampon et supervision
Déployer Fluent Bit sur Kubernetes avec Helm, enrichir avec le filtre kubernetes, gérer les logs ...
Understanding the concept of score
The concept of score allows Elasticsearch to rank your documents by relevance during a search.
Understanding the Elastic Common Schema (ECS)
As always in our consulting engagements, we recommend that companies harmonise and standardise: k...
License consumption types
Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...
Grafana Alloy: The importance of Self-Monitoring
Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...
Grafana Alloy: Understanding and exploiting the User Interface (UI)
Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...
Grafana Alloy: Introduction and Architecture
Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...
Grafana Alloy: Syntax and Configuration (Alloy Language: River)
As part of a Grafana training or observability training, master the declarative syntax of Grafana...
Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)
Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...