From 767a6faca7e5ec931b5d31df17e0f47a98e77ad0 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Fri, 3 Nov 2017 14:33:24 -0600 Subject: [PATCH] New repo structure and Manifess Signed-off-by: Eduardo Silva --- README.md | 35 ++++------- fluent-bit-daemonset-configmap.yaml | 83 ------------------------- fluent-bit-daemonset-elasticsearch.yaml | 59 ------------------ fluent-bit-rbac.yaml | 44 ------------- fluent-bit-role-binding.yaml | 12 ++++ fluent-bit-role.yaml | 10 +++ fluent-bit-service-account.yaml | 5 ++ output/elasticsearch/fluent-bit-ds.yaml | 49 +++++++++++++++ 8 files changed, 89 insertions(+), 208 deletions(-) delete mode 100644 fluent-bit-daemonset-configmap.yaml delete mode 100644 fluent-bit-daemonset-elasticsearch.yaml delete mode 100644 fluent-bit-rbac.yaml create mode 100644 fluent-bit-role-binding.yaml create mode 100644 fluent-bit-role.yaml create mode 100644 fluent-bit-service-account.yaml create mode 100644 output/elasticsearch/fluent-bit-ds.yaml diff --git a/README.md b/README.md index c6e1d90..b5835c3 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,26 @@ -# Help to Test! +# Kubernetes Logging with Fluent Bit -[Fluent Bit](http://fluentbit.io) v0.11 was just released at the end of March 2017 and it comes with support for Kubernetes logging needs: it can consume logs and enrich them with proper Kubernetes metadata, retrieved from the API server of course. +[Fluent Bit](http://fluentbit.io) is a lightweight and extensible __Log Processor__ that comes with full support for Kubernetes: -Our goal is to make logging cheaper in terms of memory consumption. In order to accomplish this we need to deal with different factors, not only processing incoming logs but also _formatting_ the data for our backends like Elasticsearch, which can be a little expensive as it requires a JSON representation. +- Read Kubernetes/Docker log files from the file system or through Systemd Journal +- Enrich logs with Kubernetes metadata +- Deliver logs to third party storage services like Elasticsearch, InfluxDB, HTTP, etc. -> Note: Fluent Bit uses a binary representation for logs, converting this to JSON requires enough memory for the process. +This repository contains a set of Yaml files to deploy Fluent Bit which consider namespace, RBAC, Service Account, etc. ## Getting started -Fluent Bit must be deployed as a DaemonSet, on that way it will be available on every node of your Kubernetes cluster. +[Fluent Bit](http://fluentbit.io) must be deployed as a DaemonSet, so on that way it will be available on every node of your Kubernetes cluster. To get started: -This repository contains two Yaml DaemonSet files: +__FIXME__ -| Yaml file | Description | -|-----------|-------------| -| [fluent-bit-daemonset-elasticsearch](fluent-bit-daemonset-elasticsearch.yaml) | deploys a stable release of Fluent Bit. | - -The current DaemonSet points to this specific Docker Hub image: - -[0.11](https://hub.docker.com/r/fluent/fluent-bit-kubernetes-daemonset/tags/) fluent/fluent-bit-kubernetes-daemonset:0.11 - -### Steps - -1. Make sure your Elasticsearch backend is running and can be reach through the hostname _elasticsearch-logging_. This value can be changed in the Yaml file - -2. Deploy the daemonset file from this repository: - -```bash -$ kubectl apply -f fluent-bit-daemonset-elasticsearch.yaml ``` +$ kubectl create namespace logging +$ kubectl create -f ./fluent-bit-service-account.yaml +$ kubectl create -f ./fluent-bit-role.yaml +$ kubectl create -f ./fluent-bit-role-binding.yaml +``` ## Details The default configuration of Fluent Bit makes sure of the following: diff --git a/fluent-bit-daemonset-configmap.yaml b/fluent-bit-daemonset-configmap.yaml deleted file mode 100644 index 0b85a2c..0000000 --- a/fluent-bit-daemonset-configmap.yaml +++ /dev/null @@ -1,83 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: fluent-bit-config-v1 - namespace: kube-system -data: - fluent-bit.conf: | - [SERVICE] - Flush 1 - Daemon Off - Log_Level info - Parsers_File parsers.conf - - [INPUT] - Name tail - Tag kubernetes.* - Path /var/log/containers/*.log - Parser docker - DB /var/log/flb_kube.db - Mem_Buf_Limit 5MB - - [FILTER] - Name kubernetes - Match kubernetes.* - Kube_URL https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT} - tls.verify False - Merge_JSON_Log On - - [OUTPUT] - Name es - Match * - Host ${FLUENT_ELASTICSEARCH_HOST} - Port ${FLUENT_ELASTICSEARCH_PORT} - Logstash_Format On - Retry_Limit False - - parsers.conf: | - - [PARSER] - Name apache - Format regex - Regex ^(?[^ ]*) [^ ]* (?[^ ]*) \[(?