From 7441e2f39bd5881509c7ed20c2886f407b4f889e Mon Sep 17 00:00:00 2001 From: Satnam Singh Date: Fri, 14 Nov 2014 11:21:36 -0800 Subject: [PATCH] Update logging documentation to reflect on by default logging --- contrib/logging/fluentd-ek/Makefile | 6 ++++ contrib/logging/fluentd-ek/README.md | 2 +- .../logging/fluentd-ek/synthetic_10lps.yml | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 contrib/logging/fluentd-ek/synthetic_10lps.yml diff --git a/contrib/logging/fluentd-ek/Makefile b/contrib/logging/fluentd-ek/Makefile index 4b7a0a941d..09ac60cdf5 100644 --- a/contrib/logging/fluentd-ek/Makefile +++ b/contrib/logging/fluentd-ek/Makefile @@ -39,6 +39,12 @@ logger-up: logger-down: -${KUBECTL} delete pods synthetic-logger-0.25lps-pod +logger10-up: + -${KUBECTL} create -f synthetic_10lps.yml + +logger10-down: + -${KUBECTL} delete pods synthetic-logger-10lps-pod + get: ${KUBECTL} get pods ${KUBECTL} get services diff --git a/contrib/logging/fluentd-ek/README.md b/contrib/logging/fluentd-ek/README.md index 708d1b19c0..d65d4ba0f5 100644 --- a/contrib/logging/fluentd-ek/README.md +++ b/contrib/logging/fluentd-ek/README.md @@ -1,6 +1,6 @@ # Logging Pods in a Kubernetes Cluster using Fluentd, Elasticsearch and Kibana -To enable logging of the activity inside a [pod](../../../docs/pods.md) using Elasticsearch set ``FLUENTD_ELASTICSEARCH=true`` in ``config-default.sh`` before launching the cluster. When a cluster is created a Docker container will be placed on each node which uses the [Fluentd](http://www.fluentd.org/) log collector to shovel all the container logs to an instance of [Elasticsearch](http://www.elasticsearch.org/) (or anything else that will listen to [Logstash](http://logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash) format JSON on port 9200). +When a GCE Kubernetes cluster is created a [pod](../../../docs/pods.md) will be placed on each node which uses the [Fluentd](http://www.fluentd.org/) log collector to collect all the Docker container logs and send them to an instance of [Elasticsearch](http://www.elasticsearch.org/) (or anything else that will listen to [Logstash](http://logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash) format JSON on port 9200). We can verify that a Fluentd collector is running by ssh-ing into one of the nodes and looking at the running containers. diff --git a/contrib/logging/fluentd-ek/synthetic_10lps.yml b/contrib/logging/fluentd-ek/synthetic_10lps.yml new file mode 100644 index 0000000000..2d5a782c46 --- /dev/null +++ b/contrib/logging/fluentd-ek/synthetic_10lps.yml @@ -0,0 +1,29 @@ +# This pod specification creates an instance of a synthetic logger. The logger +# is simply a program that writes out the hostname of the pod, a count which increments +# by one on each iteration (to help notice missing log enteries) and the date using +# a long format (RFC-3339) to nano-second precision. This program logs at a frequency +# of 0.25 lines per second. The shellscript program is given directly to bash as -c argument +# and could have been written out as: +# i="0" +# while true +# do +# echo -n "`hostname`: $i: " +# date --rfc-3339 ns +# sleep 4 +# i=$[$i+1] +# done + +apiVersion: v1beta1 +kind: Pod +id: synthetic-logger-10lps-pod +desiredState: + manifest: + version: v1beta1 + id: synth-logger-10lps + containers: + - name: synth-lgr + image: ubuntu:14.04 + command: ["bash", "-c", "i=\"0\"; while true; do echo -n \"`hostname`: $i: \"; date --rfc-3339 ns; sleep 0.1; i=$[$i+1]; done"] +labels: + name: synth-logging-source +