2014-10-20 18:01:13 +00:00
|
|
|
## Logging
|
|
|
|
|
|
|
|
**Experimental work in progress.**
|
|
|
|
|
|
|
|
### Logging with Fluentd and Elastiscsearch
|
|
|
|
|
|
|
|
To enable logging of the stdout and stderr output of every Docker container in
|
2014-11-14 07:07:43 +00:00
|
|
|
a Kubernetes cluster set the shell environment variables
|
|
|
|
``ENABLE_NODE_LOGGING`` to ``true`` and ``LOGGING_DESTINATION`` to ``elasticsearch``.
|
|
|
|
|
|
|
|
e.g. in bash:
|
2014-10-20 18:01:13 +00:00
|
|
|
```
|
2014-11-14 07:07:43 +00:00
|
|
|
export ENABLE_NODE_LOGGING=true
|
|
|
|
export LOGGING_DESTINATION=elasticsearch
|
2014-10-20 18:01:13 +00:00
|
|
|
```
|
2014-11-14 07:07:43 +00:00
|
|
|
|
2014-10-20 18:01:13 +00:00
|
|
|
This will instantiate a [Fluentd](http://www.fluentd.org/) instance on each node which will
|
|
|
|
collect all the Dcoker container log files. The collected logs will
|
|
|
|
be targetted at an [Elasticsearch](http://www.elasticsearch.org/) instance assumed to be running on the
|
|
|
|
local node and accepting log information on port 9200. This can be accomplished
|
2014-11-24 17:51:13 +00:00
|
|
|
by writing a pod specification and service specification to define an
|
2015-03-14 06:49:31 +00:00
|
|
|
Elasticsearch service (more information to follow shortly in the contrib directory).
|
2014-10-21 00:37:58 +00:00
|
|
|
|
|
|
|
### Logging with Fluentd and Google Compute Platform
|
|
|
|
|
|
|
|
To enable logging of Docker contains in a cluster using Google Compute
|
2014-11-14 07:07:43 +00:00
|
|
|
Platform set the config flags ``ENABLE_NODE_LOGGING`` to ``true`` and
|
|
|
|
``LOGGING_DESTINATION`` to ``gcp``.
|