From 1a275ac620cf1c6ef09ec16519d3cc9405dac5ed Mon Sep 17 00:00:00 2001 From: Alexandre Peixoto Ferreira Date: Tue, 8 Nov 2022 15:48:17 -0600 Subject: [PATCH 1/3] Demo updates Signed-off-by: Alexandre Peixoto Ferreira --- charts/demo/Chart.yaml | 8 ++++---- charts/smarter-edge/Chart.yaml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/demo/Chart.yaml b/charts/demo/Chart.yaml index 0d73bf8..4e94642 100644 --- a/charts/demo/Chart.yaml +++ b/charts/demo/Chart.yaml @@ -32,19 +32,19 @@ dependencies: repository: https://fluent.github.io/helm-charts alias: fluent-bit - name: smarter-gstreamer - version: 0.0.2 + version: 0.0.4 repository: https://smarter-project.github.io/gstreamer - name: smarter-pulseaudio - version: 0.0.2 + version: 0.0.3 repository: https://smarter-project.github.io/pulseaudio - name: smarter-image-detector version: 0.0.2 repository: https://smarter-project.github.io/image-detector - name: smarter-audio-client - version: 0.0.2 + version: 0.0.4 repository: https://smarter-project.github.io/audio-client - name: smarter-inference - version: 0.0.2 + version: 0.0.4 repository: https://smarter-project.github.io/smarter-inference icon: https://gitlab.com/uploads/-/system/group/avatar/59012546/ARM1636_Project_Logo_ST2_RGB_V1.png sources: diff --git a/charts/smarter-edge/Chart.yaml b/charts/smarter-edge/Chart.yaml index e9dbb60..e885ce2 100644 --- a/charts/smarter-edge/Chart.yaml +++ b/charts/smarter-edge/Chart.yaml @@ -29,10 +29,10 @@ kubeVersion: ">=1.18.0-0" dependencies: - name: smarter-cni - version: 0.0.2 + version: 0.0.3 repository: https://smarter-project.github.io/smarter-cni - name: smarter-dns - version: 0.0.2 + version: 0.0.4 repository: https://smarter-project.github.io/smarter-dns - name: smarter-device-manager version: 0.0.7 From f33f83ed2cf72ef796b4ed518deecd281c73ede0 Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Tue, 8 Nov 2022 16:14:01 -0600 Subject: [PATCH 2/3] Add clone of fluent-bit chart with hostname change We need hostname in the daemonset tempalte, so we have to clone the entire fluent-bit helm chart to add one line. Signed-off-by: Eric Van Hensbergen --- charts/demo/Chart.yaml | 4 +- charts/smarter-fluent-bit/Chart.yaml | 31 + charts/smarter-fluent-bit/README.md | 57 + charts/smarter-fluent-bit/ci/ci-values.yaml | 1 + .../dashboards/fluent-bit.json | 1305 +++++++++++++++++ .../smarter-fluent-bit/fluent-bit/.helmignore | 23 + charts/smarter-fluent-bit/templates/NOTES.txt | 6 + .../smarter-fluent-bit/templates/_helpers.tpl | 106 ++ charts/smarter-fluent-bit/templates/_pod.tpl | 133 ++ .../templates/clusterrole.yaml | 42 + .../templates/clusterrolebinding.yaml | 16 + .../templates/configmap-dashboards.yaml | 23 + .../templates/configmap-luascripts.yaml | 12 + .../templates/configmap.yaml | 24 + .../templates/daemonset.yaml | 39 + .../templates/deployment.yaml | 41 + charts/smarter-fluent-bit/templates/hpa.yaml | 39 + .../smarter-fluent-bit/templates/ingress.yaml | 62 + .../templates/networkpolicy.yaml | 22 + charts/smarter-fluent-bit/templates/pdb.yaml | 20 + .../templates/prometheusrule.yaml | 20 + charts/smarter-fluent-bit/templates/psp.yaml | 42 + charts/smarter-fluent-bit/templates/scc.yaml | 37 + .../smarter-fluent-bit/templates/service.yaml | 39 + .../templates/serviceaccount.yaml | 12 + .../templates/servicemonitor.yaml | 52 + .../templates/tests/test-connection.yaml | 20 + charts/smarter-fluent-bit/values.yaml | 415 ++++++ 28 files changed, 2641 insertions(+), 2 deletions(-) create mode 100644 charts/smarter-fluent-bit/Chart.yaml create mode 100644 charts/smarter-fluent-bit/README.md create mode 100644 charts/smarter-fluent-bit/ci/ci-values.yaml create mode 100644 charts/smarter-fluent-bit/dashboards/fluent-bit.json create mode 100644 charts/smarter-fluent-bit/fluent-bit/.helmignore create mode 100644 charts/smarter-fluent-bit/templates/NOTES.txt create mode 100644 charts/smarter-fluent-bit/templates/_helpers.tpl create mode 100644 charts/smarter-fluent-bit/templates/_pod.tpl create mode 100644 charts/smarter-fluent-bit/templates/clusterrole.yaml create mode 100644 charts/smarter-fluent-bit/templates/clusterrolebinding.yaml create mode 100644 charts/smarter-fluent-bit/templates/configmap-dashboards.yaml create mode 100644 charts/smarter-fluent-bit/templates/configmap-luascripts.yaml create mode 100644 charts/smarter-fluent-bit/templates/configmap.yaml create mode 100644 charts/smarter-fluent-bit/templates/daemonset.yaml create mode 100644 charts/smarter-fluent-bit/templates/deployment.yaml create mode 100644 charts/smarter-fluent-bit/templates/hpa.yaml create mode 100644 charts/smarter-fluent-bit/templates/ingress.yaml create mode 100644 charts/smarter-fluent-bit/templates/networkpolicy.yaml create mode 100644 charts/smarter-fluent-bit/templates/pdb.yaml create mode 100644 charts/smarter-fluent-bit/templates/prometheusrule.yaml create mode 100644 charts/smarter-fluent-bit/templates/psp.yaml create mode 100644 charts/smarter-fluent-bit/templates/scc.yaml create mode 100644 charts/smarter-fluent-bit/templates/service.yaml create mode 100644 charts/smarter-fluent-bit/templates/serviceaccount.yaml create mode 100644 charts/smarter-fluent-bit/templates/servicemonitor.yaml create mode 100644 charts/smarter-fluent-bit/templates/tests/test-connection.yaml create mode 100644 charts/smarter-fluent-bit/values.yaml diff --git a/charts/demo/Chart.yaml b/charts/demo/Chart.yaml index 4e94642..223460d 100644 --- a/charts/demo/Chart.yaml +++ b/charts/demo/Chart.yaml @@ -29,8 +29,8 @@ kubeVersion: ">=1.18.0-0" dependencies: - name: fluent-bit version: 0.20.9 - repository: https://fluent.github.io/helm-charts - alias: fluent-bit + repository: file://../smarter-fluent-bit + alias: smarter-fluent-bit - name: smarter-gstreamer version: 0.0.4 repository: https://smarter-project.github.io/gstreamer diff --git a/charts/smarter-fluent-bit/Chart.yaml b/charts/smarter-fluent-bit/Chart.yaml new file mode 100644 index 0000000..f7d622d --- /dev/null +++ b/charts/smarter-fluent-bit/Chart.yaml @@ -0,0 +1,31 @@ +annotations: + artifacthub.io/changes: | + - kind: changed + description: "Extended with hostname in daemonset" +apiVersion: v2 +name: smarter-fluent-bit +appVersion: 1.9.9 +description: Fast and lightweight log processor and forwarder or Linux, OSX and BSD + family operating systems. +home: https://fluentbit.io/ +icon: https://fluentbit.io/assets/img/logo1-default.png +keywords: +- logging +- fluent-bit +- fluentd +maintainers: +- email: eduardo@calyptia.com + name: edsiper +- email: naseem@transit.app + name: naseemkullah +- email: towmeykaw@gmail.com + name: Towmeykaw +- email: steve.hipwell@gmail.com + name: stevehipwell +name: fluent-bit +sources: +- https://github.com/fluent/fluent-bit/ +version: 0.20.9 +artifacthub.io/signKey: | + fingerprint: 71EDA4E3D652DC73EB09E3A5387D298C169CF24E + url: https://smarter-project.github.io/documentation/pgp_keys.asc \ No newline at end of file diff --git a/charts/smarter-fluent-bit/README.md b/charts/smarter-fluent-bit/README.md new file mode 100644 index 0000000..bf95f3c --- /dev/null +++ b/charts/smarter-fluent-bit/README.md @@ -0,0 +1,57 @@ +# Fluent Bit Helm chart + +[Fluent Bit](https://fluentbit.io) is a fast and lightweight log processor and forwarder or Linux, OSX and BSD family operating systems. + +## Installation + +To add the `fluent` helm repo, run: + +```sh +helm repo add fluent https://fluent.github.io/helm-charts +``` + +To install a release named `fluent-bit`, run: + +```sh +helm install fluent-bit fluent/fluent-bit +``` + +## Chart values + +```sh +helm show values fluent/fluent-bit +``` + +## Using Lua scripts +Fluent Bit allows us to build filter to modify the incoming records using custom [Lua scripts.](https://docs.fluentbit.io/manual/pipeline/filters/lua) + +### How to use Lua scripts with this Chart + +First, you should add your Lua scripts to `luaScripts` in values.yaml, for example: + +```yaml +luaScripts: + filter_example.lua: | + function filter_name(tag, timestamp, record) + -- put your lua code here. + end +``` + +After that, the Lua scripts will be ready to be used as filters. So next step is to add your Fluent bit [filter](https://docs.fluentbit.io/manual/concepts/data-pipeline/filter) to `config.filters` in values.yaml, for example: + +```yaml +config: + filters: | + [FILTER] + Name lua + Match + script /fluent-bit/scripts/filter_example.lua + call filter_name +``` +Under the hood, the chart will: +- Create a configmap using `luaScripts`. +- Add a volumeMounts for each Lua scripts using the path `/fluent-bit/scripts/