8 Driving logs with Docker and Kubernetes

 

This chapter covers

  • Setting Docker to use Fluentd as its log driver
  • Understanding components used for Kubernetes logging
  • Tailoring Kubernetes DaemonSets for Fluentd
  • Configuring Fluentd to collect Kubernetes component log events
  • Discovering how Kubernetes node monitoring works

Previous chapters have referred to Fluentd’s relationship with Docker and Kubernetes, but we have focused on running Fluentd independently of these technologies to minimize complexity. This has helped underpin the point that despite the association with CNCF, Fluentd certainly is not restricted to cloud-native use cases.

8.1 Fluentd out of the box from Docker Hub

8.1.1 Official Docker images

8.1.2 Docker log drivers

8.1.3 Getting set up for Docker log drivers

8.2 Using Docker log drivers

8.2.1 Docker drivers via the command line

8.2.2 A quick check of network connections

8.2.3 Running Docker command line

8.2.4 Switching to driver configuration through a configuration file

8.3 Kubernetes components logging and the use of Fluentd

8.3.1 Kubernetes components and structured logging

8.3.2 Kubernetes default log retention and log rotation

8.3.3 kubectl with logging

8.4 Demonstrating logging with Kubernetes

8.4.1 Kubernetes setup

8.4.2 Creating logs to capture

8.4.3 Understanding how Fluentd DaemonSets are put together

8.6.5 Tidying up