From 3a49a65cc05bd3a0c7995608097d61220289b57a Mon Sep 17 00:00:00 2001 From: Teddy Andrieux Date: Wed, 19 Jul 2023 14:48:20 +0200 Subject: [PATCH] charts,salt: Bump fluent-bit chart to 0.36.0 Bump the fluent-bit chart to 0.36.0 and also bump the fluent-bit image to 2.1.7 Upgrade fluent-bit chart using: ``` rm -rf charts/fluent-bit helm repo add fluent https://fluent.github.io/helm-charts helm repo update helm fetch -d charts --untar fluent/fluent-bit ``` Re-render fluent-bit salt state using: ``` ./doit.sh codegen:chart_fluent-bit ``` --- CHANGELOG.md | 7 + buildchain/buildchain/versions.py | 4 +- charts/fluent-bit/Chart.yaml | 8 +- charts/fluent-bit/ci/ci-values.yaml | 3 + charts/fluent-bit/dashboards/fluent-bit.json | 1952 ++++++++++------- charts/fluent-bit/templates/_helpers.tpl | 32 + charts/fluent-bit/templates/_pod.tpl | 55 +- charts/fluent-bit/templates/clusterrole.yaml | 4 +- .../templates/configmap-dashboards.yaml | 8 +- .../templates/configmap-luascripts.yaml | 3 +- charts/fluent-bit/templates/configmap.yaml | 3 +- charts/fluent-bit/templates/daemonset.yaml | 17 +- charts/fluent-bit/templates/deployment.yaml | 17 +- charts/fluent-bit/templates/hpa.yaml | 3 +- charts/fluent-bit/templates/ingress.yaml | 1 + .../fluent-bit/templates/networkpolicy.yaml | 1 + charts/fluent-bit/templates/pdb.yaml | 1 + .../fluent-bit/templates/prometheusrule.yaml | 4 +- charts/fluent-bit/templates/scc.yaml | 16 +- charts/fluent-bit/templates/service.yaml | 1 + .../fluent-bit/templates/serviceaccount.yaml | 1 + .../fluent-bit/templates/servicemonitor.yaml | 8 +- .../templates/tests/test-connection.yaml | 3 +- charts/fluent-bit/templates/vpa.yaml | 1 + charts/fluent-bit/values.yaml | 125 +- .../logging/fluent-bit/deployed/chart.sls | 39 +- .../logging/fluent-bit/deployed/configmap.sls | 10 +- 27 files changed, 1341 insertions(+), 986 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca850ebfca..0c6b428007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,13 @@ [2.8.2](https://github.com/grafana/loki/releases/tag/v2.8.2) (PR[#4099](https://github.com/scality/metalk8s/pull/4099)) +- Bump fluent-bit chart version to + [0.36.0](https://github.com/fluent/helm-charts/releases/tag/fluent-bit-0.36.0) + The fluent-bit image has been bumped accordingly to + [2.1.7](https://github.com/fluent/fluent-bit/releases/tag/v2.1.7) + (PR[#4100](https://github.com/scality/metalk8s/pull/4100)) + + ## Release 125.0.6 (In development) diff --git a/buildchain/buildchain/versions.py b/buildchain/buildchain/versions.py index 4f0b40c5a1..3901267004 100644 --- a/buildchain/buildchain/versions.py +++ b/buildchain/buildchain/versions.py @@ -269,8 +269,8 @@ def _version_prefix(version: str, prefix: str = "v") -> str: ), Image( name="fluent-bit", - version="2.0.9", - digest="sha256:d370ad358bc8c392d157ed89eaf4555d49041bf86b29a6a8150981d04d286be8", + version="2.1.7", + digest="sha256:78be51c47514817393ed85b37f41960ae74d5b6b84f01298bd87e0b6bda692a1", ), ) diff --git a/charts/fluent-bit/Chart.yaml b/charts/fluent-bit/Chart.yaml index 187ca865a4..09c4743ba5 100644 --- a/charts/fluent-bit/Chart.yaml +++ b/charts/fluent-bit/Chart.yaml @@ -1,9 +1,9 @@ annotations: artifacthub.io/changes: | - - kind: changed - description: "Updated Fluent Bit image to v2.0.9." + - kind: added + description: "Set fluent-bit binary as command" apiVersion: v1 -appVersion: 2.0.9 +appVersion: 2.1.7 description: Fast and lightweight log processor and forwarder or Linux, OSX and BSD family operating systems. home: https://fluentbit.io/ @@ -24,4 +24,4 @@ maintainers: name: fluent-bit sources: - https://github.com/fluent/fluent-bit/ -version: 0.24.0 +version: 0.36.0 diff --git a/charts/fluent-bit/ci/ci-values.yaml b/charts/fluent-bit/ci/ci-values.yaml index 8f3d5dd757..d3e0979102 100644 --- a/charts/fluent-bit/ci/ci-values.yaml +++ b/charts/fluent-bit/ci/ci-values.yaml @@ -1 +1,4 @@ logLevel: debug + +dashboards: + enabled: true diff --git a/charts/fluent-bit/dashboards/fluent-bit.json b/charts/fluent-bit/dashboards/fluent-bit.json index 5dda4d606f..87e3271a9f 100644 --- a/charts/fluent-bit/dashboards/fluent-bit.json +++ b/charts/fluent-bit/dashboards/fluent-bit.json @@ -1,45 +1,12 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "7.2.1" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - } - ], "annotations": { "list": [ { "builtIn": 1, - "datasource": "${DS_PROMETHEUS}", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -48,17 +15,21 @@ } ] }, - "description": "Inspired by https://grafana.com/grafana/dashboards/7752", + "description": "Fluent Bit dashboard.", "editable": true, - "gnetId": 7752, + "fiscalYearStartMonth": 0, + "gnetId": null, "graphTooltip": 1, "id": null, - "iteration": 1612355253484, "links": [], + "liveNow": false, "panels": [ { "collapsed": false, - "datasource": null, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, "gridPos": { "h": 1, "w": 24, @@ -67,17 +38,27 @@ }, "id": 45, "panels": [], - "title": "Cluster Status", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Status", "type": "row" }, { - "cacheTimeout": null, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, + "description": "", "fieldConfig": { "defaults": { - "custom": {}, "mappings": [], - "nullValueMode": "connected", "thresholds": { "mode": "percentage", "steps": [ @@ -102,7 +83,6 @@ "y": 1 }, "id": 6, - "interval": null, "links": [], "maxDataPoints": 100, "options": { @@ -119,36 +99,53 @@ }, "textMode": "auto" }, - "pluginVersion": "7.2.1", + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(kube_pod_info{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\"})", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(kube_pod_info{job=\"kube-state-metrics\",namespace=\"$namespace\",created_by_kind=\"DaemonSet\",created_by_name=\"$release\"})", "format": "time_series", "interval": "", "intervalFactor": 1, - "legendFormat": "Active Fluent-bit", + "legendFormat": "Active Pods", + "range": true, "refId": "A" }, { - "expr": "sum(kube_node_status_condition{condition=\"Ready\",status=\"true\"})", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(kube_node_status_condition{job=\"kube-state-metrics\",condition=\"Ready\",status=\"true\"})", "interval": "", "legendFormat": "Ready Nodes", + "range": true, "refId": "B" }, { - "expr": "sum(kube_node_status_condition{condition!=\"Ready\",status=\"true\"})", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(kube_node_status_condition{job=\"kube-state-metrics\",condition!=\"Ready\",status=\"true\"})", "interval": "", "legendFormat": "Non-Ready Nodes", + "range": true, "refId": "C" } ], - "title": "", "transparent": true, "type": "stat" }, { "collapsed": false, - "datasource": null, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, "gridPos": { "h": 1, "w": 24, @@ -157,1080 +154,1309 @@ }, "id": 43, "panels": [], - "title": "FluentBit metrics", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Fluent Bit Metrics", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" }, "overrides": [] }, - "fill": 5, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 5 }, - "hiddenSeries": false, "id": 2, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "hideEmpty": false, - "hideZero": false, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_input_bytes_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_input_bytes_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}} pod {{"}}"}}/{{"{{"}}name{{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Input Bytes Processing Rate", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" }, "overrides": [] }, - "fill": 5, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 5 }, - "hiddenSeries": false, "id": 9, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_output_proc_bytes_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_output_proc_bytes_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}} pod {{"}}"}}/{{"{{"}}name{{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Output Bytes Processing Rate", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "rps" }, "overrides": [] }, - "fill": 5, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 11 }, - "hiddenSeries": false, "id": 40, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_input_records_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_input_records_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}} pod {{"}}"}}/{{"{{"}}name{{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Input Records Processing Rate", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "rps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "rps" }, "overrides": [] }, - "fill": 5, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 11 }, - "hiddenSeries": false, "id": 41, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "hideEmpty": false, - "hideZero": false, - "max": false, - "min": false, - "rightSide": false, - "show": false, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_output_proc_records_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_output_proc_records_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}} pod {{"}}"}}/{{"{{"}}name{{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Output Record Processing Rate", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "rps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 17 }, - "hiddenSeries": false, "id": 11, - "legend": { - "alignAsTable": false, - "avg": true, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": true, - "min": false, - "rightSide": false, - "show": false, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_output_retries_total{pod=~\"$pod\"}[1m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_output_retries_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}}pod{{"}}"}} Retries to {{"{{"}}name{{"}}"}}", + "legendFormat": "{{ `{{pod}} Retries to {{name}}` }}", + "range": true, "refId": "A" }, { - "expr": "sum(rate(fluentbit_output_retries_failed_total{pod=~\"$pod\"}[1m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_output_retries_failed_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}}pod{{"}}"}} Failed Retries to {{"{{"}} name {{"}}"}}", + "legendFormat": "{{ `{{pod}} Failed Retries to {{ name }}` }}", + "range": true, "refId": "B" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Output Retry/Failed Rates", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "errors/sec" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 17 }, - "hiddenSeries": false, "id": 10, - "legend": { - "alignAsTable": false, - "avg": false, - "current": true, - "hideEmpty": true, - "hideZero": true, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "sort": "current", - "sortDesc": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, "links": [], - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_output_errors_total{pod=~\"$pod\"}[1m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_output_errors_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{"{{"}} pod {{"}}"}}/{{"{{"}} name {{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Output Error Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "errors/sec", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 23 }, - "hiddenSeries": false, - "id": 47, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", + "id": 54, "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_filter_drop_records_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_filter_bytes_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}} / {{"{{"}} name {{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Filter Drop", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" + "title": "Filter Bytes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "rps" + }, + "overrides": [] }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 23 }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true + "id": 55, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.5.3", + "targets": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_filter_records_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", + "interval": "", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, + "refId": "A" } ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "Filter Records", + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, "overrides": [] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 12, - "x": 12, - "y": 23 + "x": 0, + "y": 31 }, - "hiddenSeries": false, "id": 48, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "sum(rate(fluentbit_filter_add_records_total{pod=~\"$pod\"}[5m])) by (pod, instance, name)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_filter_add_records_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}} / {{"{{"}} name {{"}}"}}", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, "refId": "A" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Filter Add", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" + "title": "Filter Add Records", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 31 }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.5.3", + "targets": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(rate(fluentbit_filter_drop_records_total{job=\"$release\",namespace=\"$namespace\"}[5m])) by (pod, name)", + "interval": "", + "legendFormat": "{{ `{{pod}}/{{name}}` }}", + "range": true, + "refId": "A" } ], - "yaxis": { - "align": false, - "alignLevel": null - } + "title": "Filter Drop Records", + "type": "timeseries" }, { "collapsed": false, - "datasource": null, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 31 + "y": 39 }, "id": 53, "panels": [], - "title": "Kubernetes metrics", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "refId": "A" + } + ], + "title": "Kubernetes Metrics", "type": "row" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, "fieldConfig": { "defaults": { - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.* request/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2CC0C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 32 + "y": 40 }, - "hiddenSeries": false, "id": 51, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/.* request/", - "color": "#F2CC0C", - "fill": 0 + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "container_memory_working_set_bytes{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\",pod=~\"$pod\", image!=\"\", container!=\"POD\"}\n", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "sum(container_memory_working_set_bytes{job=\"kubelet\",namespace=\"$namespace\",pod=~\"$pod\",container=\"fluent-bit\"}) by (pod)", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}}", + "legendFormat": "{{ `{{pod}}` }}", + "range": true, "refId": "A" }, { - "expr": "avg(kube_pod_container_resource_requests_memory_bytes{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\",pod=~\"$pod\"}) by (pod)", + "datasource": { + "uid": "$DS_PROMETHEUS" + }, + "editorMode": "code", + "expr": "avg(kube_pod_container_resource_requests{job=\"kube-state-metrics\",namespace=\"$namespace\",pod=~\"$pod\", container=\"fluent-bit\",resource=\"memory\"})", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}} request", + "legendFormat": "request", + "range": true, "refId": "B" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Memory Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$DS_PROMETHEUS", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, "fieldConfig": { "defaults": { - "custom": {} + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.* request/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2CC0C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] }, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 32 + "y": 40 }, - "hiddenSeries": false, "id": 50, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "7.2.1", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/.* request/", - "color": "#F2CC0C", - "fill": 0 + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + }, + "pluginVersion": "9.5.3", "targets": [ { - "expr": "rate(container_cpu_usage_seconds_total{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\",pod=~\"$pod\",image!=\"\",container!=\"POD\"}[5m])", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\",pod=~\"$pod\",container=\"fluent-bit\"}) by (pod)", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}}", + "legendFormat": "{{ `{{ pod }}` }}", + "range": true, "refId": "A" }, { - "expr": "avg(kube_pod_container_resource_requests_cpu_cores{pod=~\"$pod\"}) by (pod)", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "avg(kube_pod_container_resource_requests{job=\"kube-state-metrics\",namespace=\"$namespace\",pod=~\"$pod\",container=\"fluent-bit\",resource=\"cpu\"})", "interval": "", - "legendFormat": "{{"{{"}} pod {{"}}"}} request", + "legendFormat": "{{ `{{ pod }} request` }}", + "range": true, "refId": "B" } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "CPU Usage", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" } ], "refresh": "5s", - "schemaVersion": 26, + "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [ { "current": { - "selected": true, - "text": "prometheus", - "value": "prometheus" + "selected": false, + "text": "Prometheus", + "value": "Prometheus" }, "hide": 0, "includeAll": false, @@ -1246,31 +1472,64 @@ "type": "datasource" }, { - "allValue": null, - "current": {}, - "datasource": "$DS_PROMETHEUS", - "definition": "label_values(kube_pod_info{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\"}, pod)", + "allValue": "$fullname-.*", + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "$DS_PROMETHEUS" + }, + "definition": "label_values(kube_pod_info{job=\"kube-state-metrics\",namespace=\"$namespace\",created_by_kind=\"DaemonSet\",created_by_name=\"$release\"},pod)", "hide": 0, "includeAll": true, "label": "pod", "multi": false, "name": "pod", "options": [], - "query": "label_values(kube_pod_info{pod=~\".*{{ include "fluent-bit.fullname" . }}.*\"}, pod)", + "query": { + "query": "label_values(kube_pod_info{job=\"kube-state-metrics\",namespace=\"$namespace\",created_by_kind=\"DaemonSet\",created_by_name=\"$release\"},pod)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false + }, + { + "hide": 2, + "label": "Namespace", + "name": "namespace", + "query": "{{ .Release.Namespace }}", + "skipUrlSync": false, + "type": "constant" + }, + { + "hide": 2, + "label": "Release", + "name": "release", + "query": "{{ .Release.Name }}", + "skipUrlSync": false, + "type": "constant" + }, + { + "hide": 2, + "label": "Full Name", + "name": "fullname", + "query": "{{ include "fluent-bit.fullname" . }}", + "skipUrlSync": false, + "type": "constant" } ] }, "time": { - "from": "now-15m", + "from": "now-30m", "to": "now" }, "timepicker": { @@ -1300,6 +1559,7 @@ }, "timezone": "", "title": "{{ include "fluent-bit.fullname" . }}", - "uid": "{{ include "fluent-bit.fullname" . }}", - "version": 2 -} + "uid": "d557c8f6-cac1-445f-8ade-4c351a9076b1", + "version": 7, + "weekStart": "" +} \ No newline at end of file diff --git a/charts/fluent-bit/templates/_helpers.tpl b/charts/fluent-bit/templates/_helpers.tpl index f73daf9a70..84a3056365 100644 --- a/charts/fluent-bit/templates/_helpers.tpl +++ b/charts/fluent-bit/templates/_helpers.tpl @@ -62,6 +62,15 @@ Create the name of the service account to use {{- end -}} {{- end -}} +{{/* +Fluent-bit image with tag/digest +*/}} +{{- define "fluent-bit.image" -}} +{{- $tag := ternary "" (printf ":%s" (toString .tag)) (or (empty .tag) (eq "-" (toString .tag))) -}} +{{- $digest := ternary "" (printf "@%s" .digest) (empty .digest) -}} +{{- printf "%s%s%s" .repository $tag $digest -}} +{{- end -}} + {{/* Ingress ApiVersion according k8s version */}} @@ -104,3 +113,26 @@ policy/v1 policy/v1beta1 {{- end }} {{- end -}} + +{{/* +HPA ApiVersion according k8s version +Check legacy first so helm template / kustomize will default to latest version +*/}} +{{- define "fluent-bit.hpa.apiVersion" -}} +{{- if and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare "<1.23-0" .Capabilities.KubeVersion.GitVersion) -}} +autoscaling/v2beta2 +{{- else -}} +autoscaling/v2 +{{- end -}} +{{- end -}} + +{{/* +Create the name of OpenShift SecurityContextConstraints to use +*/}} +{{- define "fluent-bit.openShiftSccName" -}} +{{- if not .Values.openShift.securityContextConstraints.create -}} +{{- printf "%s" .Values.openShift.securityContextConstraints.existingName -}} +{{- else -}} +{{- printf "%s" (default (include "fluent-bit.fullname" .) .Values.openShift.securityContextConstraints.name) -}} +{{- end -}} +{{- end -}} diff --git a/charts/fluent-bit/templates/_pod.tpl b/charts/fluent-bit/templates/_pod.tpl index 4e94439c51..7f74f4a58c 100644 --- a/charts/fluent-bit/templates/_pod.tpl +++ b/charts/fluent-bit/templates/_pod.tpl @@ -38,7 +38,7 @@ containers: securityContext: {{- toYaml . | nindent 6 }} {{- end }} - image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" + image: {{ include "fluent-bit.image" (merge .Values.image (dict "tag" (default .Chart.AppVersion .Values.image.tag))) | quote }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if or .Values.env .Values.envWithTpl }} env: @@ -54,14 +54,17 @@ containers: envFrom: {{- toYaml .Values.envFrom | nindent 6 }} {{- end }} - {{- if .Values.args }} - args: - {{- toYaml .Values.args | nindent 6 }} - {{- end}} - {{- if .Values.command }} + {{- with .Values.command }} command: - {{- toYaml .Values.command | nindent 6 }} + {{- toYaml . | nindent 6 }} {{- end }} + {{- if or .Values.args .Values.hotReload.enabled }} + args: + {{- toYaml .Values.args | nindent 6 }} + {{- if .Values.hotReload.enabled }} + - --enable-hot-reload + {{- end }} + {{- end}} ports: - name: http containerPort: {{ .Values.metricsPort }} @@ -86,16 +89,11 @@ containers: {{- toYaml . | nindent 6 }} {{- end }} volumeMounts: - {{- toYaml .Values.volumeMounts | nindent 6 }} - {{- range $key, $val := .Values.config.extraFiles }} - name: config - mountPath: /fluent-bit/etc/{{ $key }} - subPath: {{ $key }} - {{- end }} - {{- range $key, $value := .Values.luaScripts }} + mountPath: /fluent-bit/etc/conf + {{- if or .Values.luaScripts .Values.hotReload.enabled }} - name: luascripts - mountPath: /fluent-bit/scripts/{{ $key }} - subPath: {{ $key }} + mountPath: /fluent-bit/scripts {{- end }} {{- if eq .Values.kind "DaemonSet" }} {{- toYaml .Values.daemonSetVolumeMounts | nindent 6 }} @@ -103,14 +101,31 @@ containers: {{- if .Values.extraVolumeMounts }} {{- toYaml .Values.extraVolumeMounts | nindent 6 }} {{- end }} - {{- if .Values.extraContainers }} - {{- toYaml .Values.extraContainers | nindent 2 }} - {{- end }} +{{- if .Values.hotReload.enabled }} + - name: reloader + image: {{ include "fluent-bit.image" .Values.hotReload.image }} + args: + - {{ printf "-webhook-url=http://localhost:%s/api/v2/reload" (toString .Values.metricsPort) }} + - -volume-dir=/watch/config + - -volume-dir=/watch/scripts + volumeMounts: + - name: config + mountPath: /watch/config + - name: luascripts + mountPath: /watch/scripts + {{- with .Values.hotReload.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} +{{- end }} +{{- if .Values.extraContainers }} + {{- toYaml .Values.extraContainers | nindent 2 }} +{{- end }} volumes: - name: config configMap: - name: {{ if .Values.existingConfigMap }}{{ .Values.existingConfigMap }}{{- else }}{{ include "fluent-bit.fullname" . }}{{- end }} -{{- if gt (len .Values.luaScripts) 0 }} + name: {{ default (include "fluent-bit.fullname" .) .Values.existingConfigMap }} +{{- if or .Values.luaScripts .Values.hotReload.enabled }} - name: luascripts configMap: name: {{ include "fluent-bit.fullname" . }}-luascripts diff --git a/charts/fluent-bit/templates/clusterrole.yaml b/charts/fluent-bit/templates/clusterrole.yaml index 94ff4ae4a8..01d4bb136a 100644 --- a/charts/fluent-bit/templates/clusterrole.yaml +++ b/charts/fluent-bit/templates/clusterrole.yaml @@ -29,13 +29,13 @@ rules: verbs: - use {{- end }} - {{- if and .Values.openShift.enabled .Values.openShift.securityContextConstraints.create }} + {{- if .Values.openShift.enabled }} - apiGroups: - security.openshift.io resources: - securitycontextconstraints resourceNames: - - {{ include "fluent-bit.fullname" . }} + - {{ include "fluent-bit.openShiftSccName" . }} verbs: - use {{- end }} diff --git a/charts/fluent-bit/templates/configmap-dashboards.yaml b/charts/fluent-bit/templates/configmap-dashboards.yaml index 7ab35ccc77..8047d51fe3 100644 --- a/charts/fluent-bit/templates/configmap-dashboards.yaml +++ b/charts/fluent-bit/templates/configmap-dashboards.yaml @@ -5,18 +5,16 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "fluent-bit.fullname" $ }}-dashboard-{{ trimSuffix ".json" (base $path) }} - {{- with $.Values.dashboards.namespace }} - namespace: {{ . }} - {{- end }} + namespace: {{ default $.Release.Namespace $.Values.dashboards.namespace }} {{- with $.Values.dashboards.annotations }} annotations: {{- toYaml . | nindent 4 -}} {{- end }} labels: {{- include "fluent-bit.labels" $ | nindent 4 }} - {{ $.Values.dashboards.labelKey }}: "1" + {{ $.Values.dashboards.labelKey }}: {{ $.Values.dashboards.labelValue | quote }} data: - {{ base $path }}: | + {{ include "fluent-bit.fullname" $ }}-{{ base $path }}: | {{- tpl ($.Files.Get $path) $ | nindent 4 }} --- {{- end }} diff --git a/charts/fluent-bit/templates/configmap-luascripts.yaml b/charts/fluent-bit/templates/configmap-luascripts.yaml index 0350b4f43a..c9d152c9b5 100644 --- a/charts/fluent-bit/templates/configmap-luascripts.yaml +++ b/charts/fluent-bit/templates/configmap-luascripts.yaml @@ -1,8 +1,9 @@ -{{- if gt (len .Values.luaScripts) 0 -}} +{{- if or .Values.luaScripts .Values.hotReload.enabled -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "fluent-bit.fullname" . }}-luascripts + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} data: diff --git a/charts/fluent-bit/templates/configmap.yaml b/charts/fluent-bit/templates/configmap.yaml index 5174d5d00c..37821d3cb6 100644 --- a/charts/fluent-bit/templates/configmap.yaml +++ b/charts/fluent-bit/templates/configmap.yaml @@ -1,8 +1,9 @@ -{{- if (empty .Values.existingConfigMap) -}} +{{- if not .Values.existingConfigMap -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} data: diff --git a/charts/fluent-bit/templates/daemonset.yaml b/charts/fluent-bit/templates/daemonset.yaml index 7afa004972..12570954c8 100644 --- a/charts/fluent-bit/templates/daemonset.yaml +++ b/charts/fluent-bit/templates/daemonset.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: DaemonSet metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.labels }} @@ -25,17 +26,23 @@ spec: {{- end }} template: metadata: + labels: + {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if or (not .Values.hotReload.enabled) .Values.podAnnotations }} annotations: + {{- if not .Values.hotReload.enabled }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- if .Values.luaScripts }} checksum/luascripts: {{ include (print $.Template.BasePath "/configmap-luascripts.yaml") . | sha256sum }} + {{- end }} + {{- end }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} spec: {{- include "fluent-bit.pod" . | nindent 6 }} {{- end }} diff --git a/charts/fluent-bit/templates/deployment.yaml b/charts/fluent-bit/templates/deployment.yaml index f42ac03bd1..7ba61b5fec 100644 --- a/charts/fluent-bit/templates/deployment.yaml +++ b/charts/fluent-bit/templates/deployment.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.labels }} @@ -28,17 +29,23 @@ spec: {{- end }} template: metadata: + labels: + {{- include "fluent-bit.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if or (not .Values.hotReload.enabled) .Values.podAnnotations }} annotations: + {{- if not .Values.hotReload.enabled }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- if .Values.luaScripts }} checksum/luascripts: {{ include (print $.Template.BasePath "/configmap-luascripts.yaml") . | sha256sum }} + {{- end }} + {{- end }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - labels: - {{- include "fluent-bit.selectorLabels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} spec: {{- include "fluent-bit.pod" . | nindent 6 }} {{- end }} diff --git a/charts/fluent-bit/templates/hpa.yaml b/charts/fluent-bit/templates/hpa.yaml index aceae6b56b..243459f87a 100644 --- a/charts/fluent-bit/templates/hpa.yaml +++ b/charts/fluent-bit/templates/hpa.yaml @@ -1,8 +1,9 @@ {{- if and ( eq .Values.kind "Deployment" ) .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta2 +apiVersion: {{ include "fluent-bit.hpa.apiVersion" . }} kind: HorizontalPodAutoscaler metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} spec: diff --git a/charts/fluent-bit/templates/ingress.yaml b/charts/fluent-bit/templates/ingress.yaml index a8acc1368e..6c01be5351 100644 --- a/charts/fluent-bit/templates/ingress.yaml +++ b/charts/fluent-bit/templates/ingress.yaml @@ -9,6 +9,7 @@ apiVersion: {{ include "fluent-bit.ingress.apiVersion" . }} kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} diff --git a/charts/fluent-bit/templates/networkpolicy.yaml b/charts/fluent-bit/templates/networkpolicy.yaml index 92c0bf3dbf..aee927cb0c 100644 --- a/charts/fluent-bit/templates/networkpolicy.yaml +++ b/charts/fluent-bit/templates/networkpolicy.yaml @@ -3,6 +3,7 @@ apiVersion: "networking.k8s.io/v1" kind: "NetworkPolicy" metadata: name: {{ include "fluent-bit.fullname" . | quote }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} spec: diff --git a/charts/fluent-bit/templates/pdb.yaml b/charts/fluent-bit/templates/pdb.yaml index be1acbb979..d073f6787d 100644 --- a/charts/fluent-bit/templates/pdb.yaml +++ b/charts/fluent-bit/templates/pdb.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "fluent-bit.pdb.apiVersion" . }} kind: PodDisruptionBudget metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.podDisruptionBudget.annotations }} diff --git a/charts/fluent-bit/templates/prometheusrule.yaml b/charts/fluent-bit/templates/prometheusrule.yaml index d8dd951e1a..26e92e5659 100644 --- a/charts/fluent-bit/templates/prometheusrule.yaml +++ b/charts/fluent-bit/templates/prometheusrule.yaml @@ -3,9 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: {{ include "fluent-bit.fullname" . }} - {{- with .Values.prometheusRule.namespace }} - namespace: {{ . }} - {{- end }} + namespace: {{ default $.Release.Namespace .Values.prometheusRule.namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- if .Values.prometheusRule.additionalLabels }} diff --git a/charts/fluent-bit/templates/scc.yaml b/charts/fluent-bit/templates/scc.yaml index 300a8ed1f0..5c59910662 100644 --- a/charts/fluent-bit/templates/scc.yaml +++ b/charts/fluent-bit/templates/scc.yaml @@ -2,11 +2,13 @@ apiVersion: security.openshift.io/v1 kind: SecurityContextConstraints metadata: - name: {{ include "fluent-bit.fullname" . }} -{{- if .Values.openShift.securityContextConstraints.annotations }} + name: {{ include "fluent-bit.openShiftSccName" . }} + labels: + {{- include "fluent-bit.labels" . | nindent 4 }} + {{- with .Values.openShift.securityContextConstraints.annotations }} annotations: - {{- toYaml .Values.openShift.securityContextConstraints.annotations | nindent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} allowPrivilegedContainer: true allowPrivilegeEscalation: true allowHostDirVolumePlugin: true @@ -18,10 +20,10 @@ allowHostPorts: false allowHostPID: false allowedCapabilities: [] forbiddenSysctls: -- "*" + - "*" readOnlyRootFilesystem: false requiredDropCapabilities: -- MKNOD + - MKNOD runAsUser: type: RunAsAny seLinuxContext: @@ -30,8 +32,10 @@ supplementalGroups: type: RunAsAny volumes: - configMap + - downwardAPI - emptyDir - hostPath - persistentVolumeClaim + - projected - secret {{- end }} diff --git a/charts/fluent-bit/templates/service.yaml b/charts/fluent-bit/templates/service.yaml index 4b8b9c6d1c..6ee9cda5e8 100644 --- a/charts/fluent-bit/templates/service.yaml +++ b/charts/fluent-bit/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.service.labels }} diff --git a/charts/fluent-bit/templates/serviceaccount.yaml b/charts/fluent-bit/templates/serviceaccount.yaml index 1be6e7490b..57c4eb991f 100644 --- a/charts/fluent-bit/templates/serviceaccount.yaml +++ b/charts/fluent-bit/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "fluent-bit.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/charts/fluent-bit/templates/servicemonitor.yaml b/charts/fluent-bit/templates/servicemonitor.yaml index b75315a1c8..2b79cdb80f 100644 --- a/charts/fluent-bit/templates/servicemonitor.yaml +++ b/charts/fluent-bit/templates/servicemonitor.yaml @@ -3,18 +3,14 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "fluent-bit.fullname" . }} - {{- with .Values.serviceMonitor.namespace }} - namespace: {{ . }} - {{- end }} + namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.selector }} {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if .Values.serviceMonitor.jobLabel }} - jobLabel: {{ .Values.serviceMonitor.jobLabel }} - {{- end }} + jobLabel: app.kubernetes.io/instance endpoints: - port: http path: /api/v1/metrics/prometheus diff --git a/charts/fluent-bit/templates/tests/test-connection.yaml b/charts/fluent-bit/templates/tests/test-connection.yaml index 659f970e11..9f2468313c 100644 --- a/charts/fluent-bit/templates/tests/test-connection.yaml +++ b/charts/fluent-bit/templates/tests/test-connection.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Pod metadata: name: "{{ include "fluent-bit.fullname" . }}-test-connection" + namespace: {{ default .Release.Namespace .Values.testFramework.namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} annotations: @@ -10,7 +11,7 @@ metadata: spec: containers: - name: wget - image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}" + image: {{ include "fluent-bit.image" .Values.testFramework.image | quote }} imagePullPolicy: {{ .Values.testFramework.image.pullPolicy }} command: ['wget'] args: ['{{ include "fluent-bit.fullname" . }}:{{ .Values.service.port }}'] diff --git a/charts/fluent-bit/templates/vpa.yaml b/charts/fluent-bit/templates/vpa.yaml index 7a5f20ffc7..58dfaa0991 100644 --- a/charts/fluent-bit/templates/vpa.yaml +++ b/charts/fluent-bit/templates/vpa.yaml @@ -3,6 +3,7 @@ apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: {{ include "fluent-bit.fullname" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.autoscaling.vpa.annotations }} diff --git a/charts/fluent-bit/values.yaml b/charts/fluent-bit/values.yaml index 0655bab75c..de66d7b478 100644 --- a/charts/fluent-bit/values.yaml +++ b/charts/fluent-bit/values.yaml @@ -9,15 +9,19 @@ replicaCount: 1 image: repository: cr.fluentbit.io/fluent/fluent-bit # Overrides the image tag whose default is {{ .Chart.AppVersion }} - tag: "" + # Set to "-" to not use the default value + tag: + digest: pullPolicy: Always testFramework: enabled: true + namespace: image: repository: busybox pullPolicy: Always tag: latest + digest: imagePullSecrets: [] nameOverride: "" @@ -41,13 +45,16 @@ podSecurityPolicy: create: false annotations: {} +# OpenShift-specific configuration openShift: - # Sets Openshift support enabled: false - # Creates SCC for Fluent-bit when Openshift support is enabled securityContextConstraints: + # Create SCC for Fluent-bit and allow use it create: true + name: "" annotations: {} + # Use existing SCC in cluster, rather then create new one + existingName: "" podSecurityContext: {} # fsGroup: 2000 @@ -95,31 +102,30 @@ service: serviceMonitor: enabled: false -# namespace: monitoring -# interval: 10s -# scrapeTimeout: 10s -# jobLabel: fluentbit -# selector: -# prometheus: my-prometheus -# ## metric relabel configs to apply to samples before ingestion. -# ## -# metricRelabelings: -# - sourceLabels: [__meta_kubernetes_service_label_cluster] -# targetLabel: cluster -# regex: (.*) -# replacement: ${1} -# action: replace -# ## relabel configs to apply to samples after ingestion. -# ## -# relabelings: -# - sourceLabels: [__meta_kubernetes_pod_node_name] -# separator: ; -# regex: ^(.*)$ -# targetLabel: nodename -# replacement: $1 -# action: replace -# scheme: "" -# tlsConfig: {} + # namespace: monitoring + # interval: 10s + # scrapeTimeout: 10s + # selector: + # prometheus: my-prometheus + # ## metric relabel configs to apply to samples before ingestion. + # ## + # metricRelabelings: + # - sourceLabels: [__meta_kubernetes_service_label_cluster] + # targetLabel: cluster + # regex: (.*) + # replacement: ${1} + # action: replace + # ## relabel configs to apply to samples after ingestion. + # ## + # relabelings: + # - sourceLabels: [__meta_kubernetes_pod_node_name] + # separator: ; + # regex: ^(.*)$ + # targetLabel: nodename + # replacement: $1 + # action: replace + # scheme: "" + # tlsConfig: {} ## Beare in mind if youn want to collec metrics from a different port ## you will need to configure the new ports on the extraPorts property. @@ -167,13 +173,14 @@ prometheusRule: dashboards: enabled: false labelKey: grafana_dashboard + labelValue: 1 annotations: {} namespace: "" lifecycle: {} - # preStop: - # exec: - # command: ["/bin/sh", "-c", "sleep 20"] +# preStop: +# exec: +# command: ["/bin/sh", "-c", "sleep 20"] livenessProbe: httpGet: @@ -196,15 +203,15 @@ resources: {} ## only available if kind is Deployment ingress: enabled: false - className: "" + ingressClassName: "" annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" hosts: [] # - host: fluent-bit.example.tld extraHosts: [] # - host: fluent-bit-extra.example.tld - ## specify extraPort number + ## specify extraPort number # port: 5170 tls: [] # - secretName: fluent-bit-example-tld @@ -239,17 +246,17 @@ autoscaling: minReplicas: 1 maxReplicas: 3 targetCPUUtilizationPercentage: 75 -# targetMemoryUtilizationPercentage: 75 - ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics + # targetMemoryUtilizationPercentage: 75 + ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics customRules: [] -# - type: Pods -# pods: -# metric: -# name: packets-per-second -# target: -# type: AverageValue -# averageValue: 1k - ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior + # - type: Pods + # pods: + # metric: + # name: packets-per-second + # target: + # type: AverageValue + # averageValue: 1k + ## see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior behavior: {} # scaleDown: # policies: @@ -347,8 +354,8 @@ config: Daemon Off Flush {{ .Values.flush }} Log_Level {{ .Values.logLevel }} - Parsers_File parsers.conf - Parsers_File custom_parsers.conf + Parsers_File /fluent-bit/etc/parsers.conf + Parsers_File /fluent-bit/etc/conf/custom_parsers.conf HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_Port {{ .Values.metricsPort }} @@ -410,7 +417,7 @@ config: Time_Key time Time_Format %Y-%m-%dT%H:%M:%S.%L - # This allows adding more files with arbitary filenames to /fluent-bit/etc by providing key/value pairs. + # This allows adding more files with arbitary filenames to /fluent-bit/etc/conf by providing key/value pairs. # The key becomes the filename, the value becomes the file content. extraFiles: {} # upstream.conf: | @@ -430,11 +437,7 @@ config: # The config volume is mounted by default, either to the existingConfigMap value, or the default of "fluent-bit.fullname" volumeMounts: - name: config - mountPath: /fluent-bit/etc/fluent-bit.conf - subPath: fluent-bit.conf - - name: config - mountPath: /fluent-bit/etc/custom_parsers.conf - subPath: custom_parsers.conf + mountPath: /fluent-bit/etc/conf daemonSetVolumes: - name: varlog @@ -458,9 +461,12 @@ daemonSetVolumeMounts: mountPath: /etc/machine-id readOnly: true -args: [] +command: + - /fluent-bit/bin/fluent-bit -command: [] +args: + - --workdir=/fluent-bit/etc + - --config=/fluent-bit/etc/conf/fluent-bit.conf # This supports either a structured array or a templatable string initContainers: [] @@ -478,3 +484,12 @@ initContainers: [] # command: ['kubectl', 'version'] logLevel: info + +hotReload: + enabled: false + image: + repository: ghcr.io/jimmidyson/configmap-reload + tag: v0.11.1 + digest: + pullPolicy: IfNotPresent + resources: {} diff --git a/salt/metalk8s/addons/logging/fluent-bit/deployed/chart.sls b/salt/metalk8s/addons/logging/fluent-bit/deployed/chart.sls index d997db32ef..25f3bb3393 100644 --- a/salt/metalk8s/addons/logging/fluent-bit/deployed/chart.sls +++ b/salt/metalk8s/addons/logging/fluent-bit/deployed/chart.sls @@ -15,8 +15,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s name: fluent-bit namespace: metalk8s-logging @@ -29,8 +29,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s name: fluent-bit namespace: metalk8s-logging @@ -53,8 +53,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s name: fluent-bit namespace: metalk8s-logging @@ -75,8 +75,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s name: fluent-bit namespace: metalk8s-logging @@ -99,8 +99,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s name: fluent-bit namespace: metalk8s-logging @@ -113,7 +113,6 @@ spec: metadata: annotations: checksum/config: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - checksum/luascripts: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 prometheus.io/path: /api/v1/metrics/prometheus prometheus.io/port: '2020' prometheus.io/scrape: 'true' @@ -122,7 +121,12 @@ spec: app.kubernetes.io/name: fluent-bit spec: containers: - - image: {% endraw -%}{{ build_image_name("fluent-bit", False) }}{%- raw %}:2.0.9 + - args: + - --workdir=/fluent-bit/etc + - --config=/fluent-bit/etc/conf/fluent-bit.conf + command: + - /fluent-bit/bin/fluent-bit + image: {% endraw -%}{{ build_image_name("fluent-bit", False) }}{%- raw %}:2.1.7 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -139,12 +143,8 @@ spec: port: http resources: {% endraw -%}{{ fluent_bit.spec.deployment.resources }}{%- raw %} volumeMounts: - - mountPath: /fluent-bit/etc/fluent-bit.conf + - mountPath: /fluent-bit/etc/conf name: config - subPath: fluent-bit.conf - - mountPath: /fluent-bit/etc/custom_parsers.conf - name: config - subPath: custom_parsers.conf - mountPath: /run/fluent-bit name: run - mountPath: /var/log @@ -191,8 +191,8 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: fluent-bit app.kubernetes.io/part-of: metalk8s - app.kubernetes.io/version: 2.0.9 - helm.sh/chart: fluent-bit-0.24.0 + app.kubernetes.io/version: 2.1.7 + helm.sh/chart: fluent-bit-0.36.0 heritage: metalk8s metalk8s.scality.com/monitor: '' name: fluent-bit @@ -201,6 +201,7 @@ spec: endpoints: - path: /api/v1/metrics/prometheus port: http + jobLabel: app.kubernetes.io/instance namespaceSelector: matchNames: - metalk8s-logging diff --git a/salt/metalk8s/addons/logging/fluent-bit/deployed/configmap.sls b/salt/metalk8s/addons/logging/fluent-bit/deployed/configmap.sls index 4a1dcce44a..0d41673689 100644 --- a/salt/metalk8s/addons/logging/fluent-bit/deployed/configmap.sls +++ b/salt/metalk8s/addons/logging/fluent-bit/deployed/configmap.sls @@ -19,13 +19,15 @@ Create fluent-bit ConfigMap: data: fluent-bit.conf: |- [SERVICE] + Daemon Off + Flush 1 + Log_Level warn + Parsers_File parsers.conf + Parsers_File conf/custom_parsers.conf HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_PORT 2020 - Flush 1 - Daemon Off - Log_Level warn - Parsers_File custom_parsers.conf + Health_Check On [INPUT] Name tail Tag kube.*