Move the logging-related directories to where I think they belong.
1. Move fluentd-gcp to be a core cluster addon, rather than a contrib. 2. Get rid of the synthetic logger under contrib, since the exact same synthetic logger was also included in the logging-demo. 3. Move the logging-demo to examples, since it's effectively an example. We should also consider adding on a GCP section to the logging-demo example :)
This commit is contained in:
25
cluster/addons/fluentd-gcp/fluentd-gcp-image/Dockerfile
Normal file
25
cluster/addons/fluentd-gcp/fluentd-gcp-image/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# This Dockerfile will build an image that is configured
|
||||
# to use Fluentd to collect all Docker container log files
|
||||
# and then cause them to be ingested using the Google Cloud
|
||||
# Logging API. This configuration assumes that the host performning
|
||||
# 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.
|
||||
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER Satnam Singh "satnam@google.com"
|
||||
|
||||
# Disable prompts from apt.
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV OPTS_APT -y --force-yes --no-install-recommends
|
||||
|
||||
RUN apt-get -q update && \
|
||||
apt-get -y install curl && \
|
||||
apt-get clean && \
|
||||
curl -s https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh | sudo bash
|
||||
|
||||
# Copy the Fluentd configuration file for logging Docker container logs.
|
||||
COPY google-fluentd.conf /etc/google-fluentd/google-fluentd.conf
|
||||
|
||||
# Start Fluentd to pick up our config that watches Docker container logs.
|
||||
CMD /usr/sbin/google-fluentd -qq > /var/log/google-fluentd.log
|
16
cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile
Normal file
16
cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
# The build rule builds a Docker image that logs all Docker contains logs to
|
||||
# Google Compute Platform using the Cloud Logging API. The push rule pushes
|
||||
# the image to DockerHub.
|
||||
# Satnam Singh (satnam@google.com)
|
||||
|
||||
.PHONY: build push
|
||||
|
||||
|
||||
TAG = 1.2
|
||||
|
||||
build:
|
||||
docker build -t gcr.io/google_containers/fluentd-gcp:$(TAG) .
|
||||
|
||||
push:
|
||||
gcloud preview docker push gcr.io/google_containers/fluentd-gcp:$(TAG)
|
||||
|
8
cluster/addons/fluentd-gcp/fluentd-gcp-image/README.md
Normal file
8
cluster/addons/fluentd-gcp/fluentd-gcp-image/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Collecting Docker Log Files with Fluentd and sending to GCP.
|
||||
This directory contains the source files needed to make a Docker image
|
||||
that collects Docker container log files using [Fluentd](http://www.fluentd.org/)
|
||||
and sends them to GCP.
|
||||
This image is designed to be used as part of the [Kubernetes](https://github.com/GoogleCloudPlatform/kubernetes)
|
||||
cluster bring up process. The image resides at DockerHub under the name
|
||||
[kubernetes/fluentd-gcp](https://registry.hub.docker.com/u/kubernetes/fluentd-gcp/).
|
||||
|
@@ -0,0 +1,51 @@
|
||||
# This Fluentd configuration file specifies the colleciton
|
||||
# of all Docker container log files under /var/lib/docker/containers/...
|
||||
# followed by ingestion using the Google Cloud Logging API.
|
||||
# This configuration assumes the correct installation of the the
|
||||
# Google fluentd plug-in. Currently the collector uses a text format
|
||||
# rather than JSON (which is the format used to store the Docker
|
||||
# log files). When the fluentd plug-in can accept JSON this
|
||||
# configuraiton file should be changed by specifying:
|
||||
# format json
|
||||
# in the source section.
|
||||
# This configuration file assumes that the VM host running
|
||||
# this configuraiton has been created with a logging.write scope.
|
||||
# Maintainer: Satnam Singh (satnam@google.com)
|
||||
|
||||
<source>
|
||||
type tail
|
||||
format none
|
||||
time_key time
|
||||
path /var/lib/docker/containers/*/*-json.log
|
||||
pos_file /var/lib/docker/containers/gcp-containers.log.pos
|
||||
time_format %Y-%m-%dT%H:%M:%S
|
||||
tag docker.*
|
||||
read_from_head true
|
||||
</source>
|
||||
|
||||
<match docker.**>
|
||||
type google_cloud
|
||||
flush_interval 5s
|
||||
# Never wait longer than 5 minutes between retries.
|
||||
max_retry_wait 300
|
||||
# Disable the limit on the number of retries (retry forever).
|
||||
disable_retry_limit
|
||||
</match>
|
||||
|
||||
<source>
|
||||
type tail
|
||||
format none
|
||||
time_key time
|
||||
path /varlog/kubelet.log
|
||||
pos_file /varlog/gcp-kubelet.log.pos
|
||||
tag kubelet
|
||||
</source>
|
||||
|
||||
<match kubelet>
|
||||
type google_cloud
|
||||
flush_interval 5s
|
||||
# Never wait longer than 5 minutes between retries.
|
||||
max_retry_wait 300
|
||||
# Disable the limit on the number of retries (retry forever).
|
||||
disable_retry_limit
|
||||
</match>
|
Reference in New Issue
Block a user