diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1 index 937c69dbe97..832c1560f39 100644 --- a/cluster/gce/windows/k8s-node-setup.psm1 +++ b/cluster/gce/windows/k8s-node-setup.psm1 @@ -1262,6 +1262,43 @@ $FLUENTD_CONFIG = @' remove_keys stream,log +# TODO: detect exceptions and forward them as one log entry using the +# detect_exceptions plugin + +# This section is exclusive for k8s_container logs. These logs come with +# 'raw.stderr' or 'raw.stdout' tags. + + @type google_cloud + # Try to detect JSON formatted log entries. + detect_json true + # Allow log entries from multiple containers to be sent in the same request. + split_logs_by_tag false + # Set the buffer type to file to improve the reliability and reduce the memory consumption + buffer_type file + buffer_path /var/log/fluentd-buffers/kubernetes.containers.buffer + # Set queue_full action to block because we want to pause gracefully + # in case of the off-the-limits load instead of throwing an exception + buffer_queue_full_action block + # Set the chunk limit conservatively to avoid exceeding the recommended + # chunk size of 5MB per write request. + buffer_chunk_limit 512k + # Cap the combined memory usage of this buffer and the one below to + # 512KiB/chunk * (6 + 2) chunks = 4 MiB + buffer_queue_limit 6 + # Never wait more than 5 seconds before flushing logs in the non-error case. + flush_interval 5s + # Never wait longer than 30 seconds between retries. + max_retry_wait 30 + # Disable the limit on the number of retries (retry forever). + disable_retry_limit + # Use multiple threads for processing. + num_threads 2 + use_grpc true + # Skip timestamp adjustment as this is in a controlled environment with + # known timestamp format. This helps with CPU usage. + adjust_invalid_timestamps false + + # Attach local_resource_id for 'k8s_node' monitored resource. @type record_transformer