mirror of https://github.com/k3s-io/k3s
Merge pull request #2379 from satnam6502/fluentd-ek-doc
Update logging documentation to reflect on by default loggingpull/6/head
commit
e3d75dbdf7
|
@ -39,6 +39,12 @@ logger-up:
|
||||||
logger-down:
|
logger-down:
|
||||||
-${KUBECTL} delete pods synthetic-logger-0.25lps-pod
|
-${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:
|
get:
|
||||||
${KUBECTL} get pods
|
${KUBECTL} get pods
|
||||||
${KUBECTL} get services
|
${KUBECTL} get services
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Logging Pods in a Kubernetes Cluster using Fluentd, Elasticsearch and Kibana
|
# 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.
|
We can verify that a Fluentd collector is running by ssh-ing into one of the nodes and looking at the running containers.
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue