Home Explore Blog CI



kubernetes

1st chunk of `content/en/blog/_posts/2015-06-00-Cluster-Level-Logging-With-Kubernetes.md`
a28c64e674820fa48eb4f88d162d235e9378ea66ed8d63a5000000010000090b
---
title: " Cluster Level Logging with Kubernetes "
date: 2015-06-11
slug: cluster-level-logging-with-kubernetes
url: /blog/2015/06/Cluster-Level-Logging-With-Kubernetes
---


A Kubernetes cluster will typically be humming along running many system and application pods. How does the system administrator collect, manage and query the logs of the system pods? How does a user query the logs of their application which is composed of many pods which may be restarted or automatically generated by the Kubernetes system? These questions are addressed by the Kubernetes cluster level logging services.


Cluster level logging for Kubernetes allows us to collect logs which persist beyond the lifetime of the pod’s container images or the lifetime of the pod or even cluster. In this article we assume that a Kubernetes cluster has been created with cluster level logging support for sending logs to [Google Cloud Logging](https://cloud.google.com/logging/docs/). This is an option when creating a [Google Container Engine](https://cloud.google.com/container-engine/) (GKE) cluster, and is enabled by default for the open source [Google Compute Engine](https://cloud.google.com/compute/) (GCE) Kubernetes distribution. After a cluster has been created you will have a collection of system [pods](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/pods.md) running that support monitoring, logging and DNS resolution for names of Kubernetes services:

```
$ kubectl get pods
```
```
NAME                                           READY     REASON    RESTARTS   AGE

fluentd-cloud-logging-kubernetes-minion-0f64   1/1       Running   0          32m

fluentd-cloud-logging-kubernetes-minion-27gf   1/1       Running   0          32m

fluentd-cloud-logging-kubernetes-minion-pk22   1/1       Running   0          31m

fluentd-cloud-logging-kubernetes-minion-20ej   1/1       Running   0          31m

kube-dns-v3-pk22                               3/3       Running   0          32m


monitoring-heapster-v1-20ej                    0/1       Running   9          32m
```
Here is the same information in a picture which shows how the pods might be placed on specific nodes.


[![](https://1.bp.blogspot.com/-FSXnrHLDMJs/Vxfzx2rsreI/AAAAAAAAAbk/PaDTpksKEZk4e8YQff5-JhGPoEpgyWaHgCLcB/s400/cloud-logging.png)

Title: Cluster Level Logging with Kubernetes
Summary
This blog post introduces cluster level logging in Kubernetes, which allows collecting logs that persist beyond the lifetime of pods, containers, or the cluster itself. It assumes a Kubernetes cluster created with cluster level logging support, like Google Cloud Logging, and demonstrates how to view the system pods supporting monitoring, logging, and DNS resolution using `kubectl get pods`.