Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Add Fluent Bit chart. #895

Merged
merged 12 commits into from Jun 2, 2017
13 changes: 13 additions & 0 deletions stable/fluent-bit/Chart.yaml
@@ -0,0 +1,13 @@
name: fluent-bit
version: 0.11.2
description: Fluent Bit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a decription somewhere along their description on Github:

Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX

keywords:
- fluent
- bit
sources:
- http://fluentbit.io
maintainers:
- name: Eduardo Silva
email: eduardo@treasure-data.com
- name: Kevin Fox
email: Kevin.Fox@pnnl.gov
31 changes: 31 additions & 0 deletions stable/fluent-bit/README.md
@@ -0,0 +1,31 @@
# fluent-bit Chart

[Fluent Bit](http://fluentbit.io/) is an open source and multi-platform Log Forwarder.

## Chart Details
This chart will do the following:

* Install a configmap for fluent bit
* Install a daemonset that provisions the fluent bit [per-host architecture]

## Installing the Chart

To install the chart with the release name `my-release`:

```bash
$ helm install --name my-release stable/fluent-bit
```

## Configuration

Configurable values are documented in the `values.yaml`.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml stable/fluent-bit
```

> **Tip**: You can use the default [values.yaml](values.yaml)
16 changes: 16 additions & 0 deletions stable/fluent-bit/templates/_helpers.tpl
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add trimSuffix "-" at the end

{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 -}}
{{- end -}}
48 changes: 48 additions & 0 deletions stable/fluent-bit/templates/config.yaml
@@ -0,0 +1,48 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}-config
labels:
app: {{ template "fullname" . }}
namespace: {{ .Values.namespace }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be left out of the yamls and passed to helm install --namespace foo on the CLI.

data:
fluent-bit.conf: |-
[SERVICE]
Flush 1
Daemon Off
Log_Level info
Parsers_File parsers.conf

[INPUT]
Name tail
Path /var/log/containers/*.log
Parser docker
Tag kube.*
Refresh_Interval 5
Mem_Buf_Limit 5MB

[FILTER]
Name kubernetes
Match kube.*

{{ if eq .Values.backend.type "test" }}
[OUTPUT]
Name file
Match *
Path /tmp/fluent-bit.log
{{ else if eq .Values.backend.type "forward" }}
[OUTPUT]
Name forward
Match *
Host {{ .Values.backend.forward.host }}
Port {{ .Values.backend.forward.port }}
Retry_Limit False
{{ else if eq .Values.backend.type "es" }}
[OUTPUT]
Name es
Match *
Host ${FLUENT_ELASTICSEARCH_HOST}
Port ${FLUENT_ELASTICSEARCH_PORT}
Logstash_Format On
Retry_Limit False
{{- end }}
50 changes: 50 additions & 0 deletions stable/fluent-bit/templates/daemonset.yaml
@@ -0,0 +1,50 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: {{ .Values.namespace }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be left out of the yamls and passed to helm install --namespace foo on the CLI.

labels:
app: {{ template "fullname" . }}
spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: fluent-bit
image: "{{ .Values.image.fluent_bit.repository }}:{{ .Values.image.fluent_bit.tag }}"
env:
{{ toYaml .Values.env | indent 10 }}
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: config
mountPath: /fluent-bit/etc/fluent-bit.conf
subPath: fluent-bit.conf
{{ if .Values.on_minikube }}
- name: mnt
mountPath: /mnt
readOnly: true
{{ end }}
terminationGracePeriodSeconds: 10
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: config
configMap:
name: {{ template "fullname" . }}-config
{{ if .Values.on_minikube }}
- name: mnt
hostPath:
path: /mnt
{{ end }}
30 changes: 30 additions & 0 deletions stable/fluent-bit/values.yaml
@@ -0,0 +1,30 @@
# Minikube stores its logs in a seperate directory.
# enable if started in minikube.
on_minikube: false

namespace: kube-system
Copy link
Contributor

@linki linki Apr 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace should be kept out of the yamls.


image:
fluent_bit:
repository: fluent/fluent-bit
tag: 0.11.2
pullPolicy: IfNotPresent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullPolicy seems to be unused in this chart.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pullPolicy is not used in daemonset.yaml


backend:
type: forward
forward:
host: fluentd
port: 24284

env:
- name: FLUENT_ELASTICSEARCH_HOST
value: elasticsearch-logger
- name: FLUENT_ELASTICSEARCH_PORT
value: "9200"

resources:
limits:
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi