Make a Fluentd sidecar image and example for sending logs from within a

pod's filesystem to Elasticsearch, copying liberally from the GCP version.
This commit is contained in:
Alex Robinson
2015-04-23 15:07:05 -07:00
parent 429534d6d5
commit c0956ae0ba
9 changed files with 175 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
# The environment variable that controls which log files are collected is
# FILES_TO_COLLECT. Files specified in the environment variable should be
# separated by whitespace, as in "/var/log/syslog /var/log/nginx/access.log".
# This configuration assumes that the host performning the collection is a VM
# This configuration assumes that the host performing the collection is a VM
# that has been created with a logging.write scope and that the Logging API
# has been enabled for the project in the Google Developer Console.

View File

@@ -1,4 +1,6 @@
# Collecting log files from within containers with Fluentd and sending to the Google Cloud Logging service.
# Collecting log files from within containers with Fluentd and sending them to the Google Cloud Logging service.
*Note that this only works for clusters running on GCE and whose VMs have the cloud-logging.write scope. If your cluster is logging to Elasticsearch instead, see [this guide](/contrib/logging/fluentd-sidecar-es/) instead.*
This directory contains the source files needed to make a Docker image that collects log files from arbitrary files within a container using [Fluentd](http://www.fluentd.org/) and sends them to GCP.
The image is designed to be used as a sidecar container as part of a pod.
It lives in the Google Container Registry under the name `gcr.io/google_containers/fluentd-sidecar-gcp`.

View File

@@ -1,11 +1,11 @@
apiVersion: v1beta3
kind: Pod
metadata:
labels:
metadata:
labels:
example: logging-sidecar
name: logging-sidecar-example
spec:
containers:
spec:
containers:
- name: synthetic-logger
image: ubuntu:14.04
command: ["bash", "-c", "i=\"0\"; while true; do echo \"`hostname`: $i \" >> /var/log/synthetic-count.log; date --rfc-3339 ns >> /var/log/synthetic-dates.log; sleep 4; i=$[$i+1]; done"]