You run hundreds of Kubernetes nodes. Choose between sidecar shippers and a node-level DaemonSet.
IntermediateScenarioLogging Pipelines
Answer
Situation read → Most apps log to stdout; a few legacy apps write to files inside the container.
What I'd do →
- Default to a DaemonSet (Alloy, Fluent Bit, Vector) reading
/var/log/podsand enriching with Kubernetes metadata. - Use a sidecar only for apps that write to files and cannot change, sharing an
emptyDirvolume. - Make apps log to stdout/stderr as the standard in the platform guidelines.
- Set resource requests and a PriorityClass on the DaemonSet so it is not evicted first.
Why → One agent per node is cheaper and simpler than one per pod; sidecars multiply CPU/memory and config.
Interview tip → Note that kubelet rotates container logs (containerLogMaxSize), so a slow shipper can miss rotated files.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?Intermediate