EKS Log Management (EKS Log MGMT)
This guide explains how EKS cluster logs (from nodes and pods) are collected, stored, and analyzed in AWS. Logs are ingested using Fluent Bit, stored in OpenSearch for real-time querying and in S3 for long-term retention, and analyzed using AWS Athena & Glue.1. Architecture Overview
2. Log Collection with Fluent Bit
- Deployment: Fluent Bit is deployed as a DaemonSet on all EKS nodes.
-
Sources:
- Container logs:
/var/log/containers/*.log - Node system logs:
/var/log/messages,/var/log/syslog
- Container logs:
-
Processing:
- Parse Kubernetes metadata (namespace, pod name, container)
- Apply filters (JSON formatting, timestamp correction)
-
Destinations:
- OpenSearch for real-time dashboards & alerts
- S3 for long-term retention
3. OpenSearch – Real-Time Log Analysis
- Purpose: Immediate insights and monitoring dashboards.
-
Setup:
- Create an OpenSearch cluster (multi-AZ recommended for production)
- Configure index policies and IAM roles for Fluent Bit access
-
Use Cases:
- Monitor application errors and latency
- Alerting with OpenSearch/Kibana dashboards
- Query by pod, namespace, or node
4. S3 – Long-Term Retention
- Purpose: Store logs for compliance, audits, and historic analysis
- Structure: Organize by year/month/day/hour or by cluster/namespace
- Example Key Structure:
- Retention: Lifecycle policies can archive old logs to Glacier or delete after N days
5. AWS Athena & Glue – Log Analytics
-
AWS Glue: Crawls the S3 bucket to create a metadata catalog
- Defines table schema (columns: timestamp, pod, namespace, message, log level)
- AWS Athena: SQL-like queries on logs in S3 without moving data
-
Benefits:
- Historical trend analysis
- Identify anomalies over long periods
- Cost-efficient analytics using S3 storage
6. Data Flow Summary
- EKS Nodes/Pods generate logs
- Fluent Bit collects and processes logs
-
Logs forwarded:
- OpenSearch: real-time queries and dashboards
- S3: long-term retention (organized by cluster/namespace/date)
- AWS Glue catalogs S3 logs
- AWS Athena queries S3 logs for historical analytics
- Use IAM roles for Fluent Bit to access OpenSearch and S3
- Enable S3 encryption (SSE-S3 or SSE-KMS)
- Configure OpenSearch retention policies to prevent storage bloat
- Consider Fluent Bit buffering to handle high log volumes
This layout provides a clear visual and step-by-step understanding of how logs are collected, processed, stored, and analyzed.

