19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 14 ■ Configuring Logging

Open the –json.log file in a vi editor. The JSON logs should be displayed as shown in Figure 14-9.

Figure 14-9. Docker container logs in JSON format

Logs of the system components are in the /var/log directory as shown in Figure 14-10.

Figure 14-10. System component logs

Cluster-Level Logging with Elasticsearch and Kibana

Cluster-level logging collects the standard output and standard error logs of applications running in

containers. For aggregating log files of applications running within containers, the Fluentd aggregator can be

used. In this section we shall configure and use cluster-level logging with Fluentd, Elasticsearch, and Kibana.

Fluentd is an open source data collector for a unified logging layer. Unified logging implies that Fluentd

decouples data sources from backend systems. The data source for the example would be logs generated in

a Kubernetes cluster, and the backend would be Elasticsearch. Elasticsearch is an open source distributed,

highly available, document-oriented, RESTful search engine designed for the cloud environment and built

on top of Lucene. Kibana is an open source analytics and search dashboard for Elasticsearch and is accessed

from a web browser. The three components of the cluster-level logging are shown in Figure 14-11.

314

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!