From 8040f75594292484db0fa0ee521211ba7ef84082 Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Fri, 11 Sep 2015 16:53:18 -0700 Subject: [PATCH] Update fluentd-gcp to use a new google-fluentd build with my recent changes to fluent-plugin-google-cloud to attach Kubernetes metadata to logs. Along with this, separate logs from containers in the cluster out from logs from the daemons running on the node by instantiating two instances of the output plugin, one which uses the new metadata (for containers) and one which doesn't (for things like docker and the kubelet). --- .../fluentd-gcp/fluentd-gcp-image/Makefile | 2 +- .../fluentd-gcp-image/google-fluentd.conf | 24 ++++++++++++++++--- .../salt/fluentd-gcp/fluentd-gcp.yaml | 2 +- docs/getting-started-guides/logging.md | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile b/cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile index cfbe2def814..a0a808b37ea 100644 --- a/cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile +++ b/cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile @@ -14,7 +14,7 @@ .PHONY: kbuild kpush -TAG = 1.12 +TAG = 1.13 # Rules for building the test image for deployment to Dockerhub with user kubernetes. diff --git a/cluster/addons/fluentd-gcp/fluentd-gcp-image/google-fluentd.conf b/cluster/addons/fluentd-gcp/fluentd-gcp-image/google-fluentd.conf index 89ea437e0f1..25a49850f01 100644 --- a/cluster/addons/fluentd-gcp/fluentd-gcp-image/google-fluentd.conf +++ b/cluster/addons/fluentd-gcp/fluentd-gcp-image/google-fluentd.conf @@ -123,16 +123,34 @@ tag kube-scheduler - +# We use 2 output stanzas - one to handle the container logs and one to handle +# the node daemon logs, the latter of which explicitly sends its logs to the +# compute.googleapis.com service rather than container.googleapis.com to keep +# them separate since most users don't care about the node logs. + type google_cloud # Set the chunk limit conservatively to avoid exceeding the GCL limit # of 2MB per write request. buffer_chunk_limit 512K - # Cap buffer memory usage to 512KB/chunk * 128 chunks = 65 MB - buffer_queue_limit 128 + # Cap the combined memory usage of this buffer and the one below to + # 512KB/chunk * (96 + 32) chunks = 65 MB + buffer_queue_limit 96 + # Never wait more than 5 seconds before flushing logs in the non-error case. 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 + +# Keep a smaller buffer here since these logs are less important than the user's +# container logs. + + type google_cloud + detect_subservice false + buffer_chunk_limit 512K + buffer_queue_limit 32 + flush_interval 5s + max_retry_wait 300 + disable_retry_limit + diff --git a/cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml b/cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml index 14fb2f8f045..510425b6ca3 100644 --- a/cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml +++ b/cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml @@ -6,7 +6,7 @@ metadata: spec: containers: - name: fluentd-cloud-logging - image: gcr.io/google_containers/fluentd-gcp:1.12 + image: gcr.io/google_containers/fluentd-gcp:1.13 resources: limits: cpu: 100m diff --git a/docs/getting-started-guides/logging.md b/docs/getting-started-guides/logging.md index 967fe9caaf3..dacc0fc21a9 100644 --- a/docs/getting-started-guides/logging.md +++ b/docs/getting-started-guides/logging.md @@ -169,7 +169,7 @@ metadata: spec: containers: - name: fluentd-cloud-logging - image: gcr.io/google_containers/fluentd-gcp:1.12 + image: gcr.io/google_containers/fluentd-gcp:1.13 resources: limits: cpu: 100m