Fluentd is an open source data collector for unified logging layer. You can read more about it here.
Fluentd is a great tool to ship logs from Kubernetes clusters. It centralizes logs before sending them to your logging system, here we’re using elasticSearch. All a microservice has to do is redirect its Logs to STDOUT and its errors to STDERR, these logs will be visible on a developer Terminal when he’s testing Locally, and available in KIBANA when the microservice is deployed on the Cloud Kubernetes Cluster.
Deploy Fluentd on Kubernetes
This will create fluentd as a Daemonset because it needs to run on each node of the Kubernetes cluster. In addition, it will create a service account with the right access to the mandatory Kubernetes resources to ship logs to Elastic Search. it will also use a custom index ‘my-index’, defaults to logstach-* index in ElasticSearch.
Logs Visualization
Looking into logs is possible by filtering by pod name using this query on KIBANA : kubernetes.pod_name: ‘podName’



