From f1c181f185199e81eb7187a4a7f956e62d036f0e Mon Sep 17 00:00:00 2001 From: Moumoutaru Date: Thu, 30 Nov 2023 14:43:40 -0500 Subject: [PATCH] Add updated fluentd chart remove old fluentd chart (#27) ### PR Description This PR replaces the old unmaintained fluentd helm chart See: https://github.com/helm/charts/issues/21235 with an updated fluentd helm charm located here : https://github.com/fluent/helm-charts/tree/main/charts/fluentd. I've broken out changes into three separate commits: 1) Replaces old helm chart from stable with new chart 2) Updates version to phrg1 3) Add's support for nodeports (see: https://github.com/fluent/helm-charts/pull/231) --- charts/fluentd/.helmignore | 2 + charts/fluentd/Chart.yaml | 23 +- charts/fluentd/README.md | 262 +- charts/fluentd/dashboards/fluentd.json | 3185 +++++++++++++++++ charts/fluentd/templates/NOTES.txt | 9 +- charts/fluentd/templates/_helpers.tpl | 49 + charts/fluentd/templates/_pod.tpl | 130 + charts/fluentd/templates/clusterrole.yaml | 35 +- .../fluentd/templates/clusterrolebinding.yaml | 21 +- .../templates/configmap-dashboards.yaml | 18 + charts/fluentd/templates/configmap.yaml | 37 - charts/fluentd/templates/daemonset.yaml | 40 + charts/fluentd/templates/deployment.yaml | 160 +- .../templates/files.conf/prometheus.yaml | 25 + .../fluentd/templates/files.conf/systemd.yaml | 83 + .../templates/fluentd-configurations-cm.yaml | 38 + charts/fluentd/templates/hpa.yaml | 35 +- charts/fluentd/templates/ingress.yaml | 58 +- .../fluentd/templates/podsecuritypolicy.yaml | 42 + charts/fluentd/templates/prometheusrules.yaml | 21 + charts/fluentd/templates/pvc.yaml | 29 - charts/fluentd/templates/role.yaml | 17 - charts/fluentd/templates/rolebinding.yaml | 19 - charts/fluentd/templates/service.yaml | 47 +- charts/fluentd/templates/serviceaccount.yaml | 9 +- charts/fluentd/templates/servicemonitor.yaml | 43 +- charts/fluentd/templates/statefulset.yaml | 55 + .../templates/tests/test-connection.yaml | 15 + charts/fluentd/values.yaml | 563 ++- 29 files changed, 4422 insertions(+), 648 deletions(-) create mode 100644 charts/fluentd/dashboards/fluentd.json create mode 100644 charts/fluentd/templates/_pod.tpl create mode 100644 charts/fluentd/templates/configmap-dashboards.yaml delete mode 100644 charts/fluentd/templates/configmap.yaml create mode 100644 charts/fluentd/templates/daemonset.yaml create mode 100644 charts/fluentd/templates/files.conf/prometheus.yaml create mode 100644 charts/fluentd/templates/files.conf/systemd.yaml create mode 100644 charts/fluentd/templates/fluentd-configurations-cm.yaml create mode 100644 charts/fluentd/templates/podsecuritypolicy.yaml create mode 100644 charts/fluentd/templates/prometheusrules.yaml delete mode 100644 charts/fluentd/templates/pvc.yaml delete mode 100644 charts/fluentd/templates/role.yaml delete mode 100644 charts/fluentd/templates/rolebinding.yaml create mode 100644 charts/fluentd/templates/statefulset.yaml create mode 100644 charts/fluentd/templates/tests/test-connection.yaml diff --git a/charts/fluentd/.helmignore b/charts/fluentd/.helmignore index f0c1319..0e8a0eb 100644 --- a/charts/fluentd/.helmignore +++ b/charts/fluentd/.helmignore @@ -14,8 +14,10 @@ *.swp *.bak *.tmp +*.orig *~ # Various IDEs .project .idea/ *.tmproj +.vscode/ diff --git a/charts/fluentd/Chart.yaml b/charts/fluentd/Chart.yaml index 84cec87..24d2fd1 100644 --- a/charts/fluentd/Chart.yaml +++ b/charts/fluentd/Chart.yaml @@ -1,13 +1,16 @@ -apiVersion: v1 -description: DEPRECATED A Fluentd Elasticsearch Helm chart for Kubernetes. -icon: https://raw.githubusercontent.com/fluent/fluentd-docs/master/public/logo/Fluentd_square.png +apiVersion: v2 name: fluentd -version: 2.5.3-phrg1 -appVersion: v2.4.0 +description: A Helm chart for Kubernetes +# type: application +version: 0.5.0-phrg1 +appVersion: v1.16.2 +icon: https://www.fluentd.org/images/miscellany/fluentd-logo_2x.png home: https://www.fluentd.org/ sources: -- https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch/fluentd-es-image -- https://quay.io/repository/coreos/fluentd-kubernetes -- https://github.com/coreos/fluentd-kubernetes-daemonset -- https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html -deprecated: true + - https://github.com/fluent/fluentd/ + - https://github.com/fluent/fluentd-kubernetes-daemonset +maintainers: + - name: edsiper + email: eduardo@treasure-data.com + - name: dioguerra + email: diogo.filipe.tomas.guerra@cern.ch diff --git a/charts/fluentd/README.md b/charts/fluentd/README.md index 06cb698..ab103a3 100644 --- a/charts/fluentd/README.md +++ b/charts/fluentd/README.md @@ -1,121 +1,187 @@ -# ⚠️ Repo Archive Notice +# Fluentd Helm Chart -As of Nov 13, 2020, charts in this repo will no longer be updated. -For more information, see the Helm Charts [Deprecation and Archive Notice](https://github.com/helm/charts#%EF%B8%8F-deprecation-and-archive-notice), and [Update](https://helm.sh/blog/charts-repo-deprecation/). +[Fluentd](https://www.fluentd.org/) is an open source data collector for unified logging layer. Fluentd allows you to unify data collection and consumption for a better use and understanding of data. -# fluentd +## Installation -[Fluentd](https://www.fluentd.org/) collects events from various data sources and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on. Fluentd helps you unify your logging infrastructure (Learn more about the Unified Logging Layer). +To add the `fluent` helm repo, run: -## DEPRECATION NOTICE - -This chart is deprecated and no longer supported. +```sh +helm repo add fluent https://fluent.github.io/helm-charts +helm repo update +``` -## TL;DR; +To install a release named `fluentd`, run: -```console -$ helm install stable/fluentd +```sh +helm install fluentd fluent/fluentd ``` +## Upgrading -## Introduction +### To 0.4.0 -This chart bootstraps an fluentd deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +Although the services will deploy and generally work, version 0.4.0 introduces some changes that are considered _breaking changes_. To upgrade, you should do the following to avoid any potential conflicts or problems: -## Installing the Chart +- Add the `mountVarLogDirectory` and `mountDockerContainersDirectory` values and set them to the values you need; to follow the previous setup where these were mounted by default, set the values to `true`, e.g. `mountVarLogDirectory: true` +- If you have the `varlog` mount point defined and enabled under both `volumes` and `volumeMounts`, set `mountVarLogDirectory` to true +- If you have the `varlibdockercontainers` mount point defined and enabled under both `volumes` and `volumeMounts`, set `mountDockerContainersDirectory` to true +- Remove the previous default volume and volume mount definitions - `etcfluentd-main`, `etcfluentd-config`, `varlog`, and `varlibdockercontainers` +- Remove the `FLUENTD_CONF` entry from the `env:` list -To install the chart with the release name `my-release`: +## Chart Values -```console -$ helm install stable/fluentd --name my-release +```sh +helm show values fluent/fluentd ``` -The command deploys fluentd on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. +## Value Details + +### default-volumes + +The default configurations bellow are required for the fluentd pod to be able to read the hosts container logs. The second section is responsible for allowing the user to load the "extra" configMaps either defined by the `fileConfigs` contained objects or, in addition, loaded externally and indicated by `configMapConfigs`. + +```yaml +- name: varlog + hostPath: + path: /var/log +- name: varlibdockercontainers + hostPath: + path: /var/lib/docker/containers +--- +- name: etcfluentd-main + configMap: + name: fluentd-main + defaultMode: 0777 +- name: etcfluentd-config + configMap: + name: fluentd-config + defaultMode: 0777 +``` -## Uninstalling the Chart +### default-volumeMounts -To uninstall/delete the `my-release` deployment: +The default configurations bellow are required for the fluentd pod to be able to read the hosts container logs. They should not be removed unless for some reason your container logs are accessible through a different path -```console -$ helm delete my-release +```yaml +- name: varlog + mountPath: /var/log +- name: varlibdockercontainers + mountPath: /var/lib/docker/containers + readOnly: true ``` -The command removes all the Kubernetes components associated with the chart and deletes the release. - -## Autoscaling - -By enabling autoscaling the chart will use statefulset with hpa instead of deployment with PVC. -Please be noted to [statefulset limitation](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations) -The autoscaling is disabled by default for backward compatibility - -## Configuration - -The following table lists the configurable parameters of the fluentd chart and their default values. - -Parameter | Description | Default ---- | --- | --- -`useStatefulSet` | Deploy as a StatefulSet regardless of whether autoscaling is enabled | `nil` -`affinity` | node/pod affinities | `{}` -`configMaps` | Fluentd configuration | See [values.yaml](values.yaml) -`output.host` | output host | `elasticsearch-client.default.svc.cluster.local` -`output.port` | output port | `9200` -`output.scheme` | output scheme | `http` -`output.sslVersion` | output ssl version | `TLSv1` -`output.buffer_chunk_limit` | output buffer chunk limit | `2M` -`output.buffer_queue_limit` | output buffer queue limit | `8` -`deployment.labels` | Additional labels for pods | `{}` -`image.pullPolicy` | Image pull policy | `IfNotPresent` -`image.repository` | Image repository | `gcr.io/google-containers/fluentd-elasticsearch` -`image.tag` | Image tag | `v2.4.0` -`imagePullSecrets` | Specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) -`extraEnvVars` | Adds additional environment variables to the deployment (in yaml syntax) | `{}` See [values.yaml](values.yaml) -`extraVolumeMounts` | Mount extra volumes (in yaml syntax) | `` See [values.yaml](values.yaml) -`extraVolumes` | Extra volumes (in yaml syntax) | `` See [values.yaml](values.yaml) -`ingress.enabled` | enable ingress | `false` -`ingress.labels` | list of labels for the ingress rule | See [values.yaml](values.yaml) -`ingress.annotations` | list of annotations for the ingress rule | `kubernetes.io/ingress.class: nginx` See [values.yaml](values.yaml) -`ingress.hosts` | host definition for ingress | See [values.yaml](values.yaml) -`ingress.tls` | tls rules for ingress | See [values.yaml](values.yaml) -`nodeSelector` | node labels for pod assignment | `{}` -`replicaCount` | desired number of pods | `1` ??? -`resources` | pod resource requests & limits | `{}` -`plugins.enabled` | Enable Plugins Installation | `false` -`plugins.pluginsList` | List of plugins to install | `[]` -`rbac.create` | Specifies whether RBAC resources should be created | `true` -`serviceAccount.create` | Specifies whether a service account should be created. | `true` -`serviceAccount.name` | Name of the service account. -`priorityClassName` | priorityClassName | `nil` -`service.loadBalancerIP` | If `service.type` is `LoadBalancer` set custom IP load balancer IP address | `nil` -`service.ports` | port definition for the service | See [values.yaml](values.yaml) -`service.type` | type of service | `ClusterIP` -`service.annotations` | list of annotations for the service | `{}` -`tolerations` | List of node taints to tolerate | `[]` -`persistence.enabled` | Enable buffer persistence | `false` -`persistence.accessMode` | Access mode for buffer persistence | `ReadWriteOnce` -`persistence.size` | Volume size for buffer persistence | `10Gi` -`autoscaling.enabled` | Set this to `true` to enable autoscaling | `false` -`autoscaling.minReplicas` | Set minimum number of replicas | `2` -`autoscaling.maxReplicas` | Set maximum number of replicas | `5` -`autoscaling.metrics` | metrics used for autoscaling | See [values.yaml](values.yaml) -`terminationGracePeriodSeconds` | Optional duration in seconds the pod needs to terminate gracefully | `30` -`metrics.enabled` | Set this to `true` to enable Prometheus metrics HTTP endpoint | `false` -`metrics.service.port` | Prometheus metrics HTTP endpoint port | `24231` -`metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` -`metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` -`metrics.serviceMonitor.namespace` | Optional namespace in which to create ServiceMonitor | `nil` -`metrics.serviceMonitor.interval` | Scrape interval. If not set, the Prometheus default scrape interval is used | `nil` -`metrics.serviceMonitor.scrapeTimeout` | Scrape timeout. If not set, the Prometheus default scrape timeout is used | `nil` - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```console -$ helm install stable/fluentd --name my-release \ - --set=image.tag=v0.0.2,resources.limits.cpu=200m +The section bellow is responsible for allowing the user to load the "extra" configMaps either defined by the `fileConfigs` contained objects or otherwise load externally and indicated by `configMapConfigs`. + +```yaml +- name: etcfluentd-main + mountPath: /etc/fluent +- name: etcfluentd-config + mountPath: /etc/fluent/config.d/ + ``` + +### default-fluentdConfig + +The `fileConfigs` section is organized by sources -> filters -> destinations. Flow control must be configured using fluentd routing with tags or labels to guarantee that the configurations are executed as intended. Alternatively you can use numeration on your files to control the configurations loading order. + +```yaml +01_sources.conf: |- + + @type tail + @id in_tail_container_logs + @label @KUBERNETES + path /var/log/containers/*.log + pos_file /var/log/fluentd-containers.log.pos + tag kubernetes.* + read_from_head true + + @type multi_format + + format json + time_key time + time_type string + time_format "%Y-%m-%dT%H:%M:%S.%NZ" + keep_time_key false + + + format regexp + expression /^(? + + emit_unmatched_lines true + + +02_filters.conf: |- + + +03_dispatch.conf: |- + + +04_outputs.conf: |- + ``` -Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, +## Backwards Compatibility - v0.1.x -```console -$ helm install stable/fluentd --name my-release -f values.yaml -``` +The old fluentd chart used the ENV variables and the default fluentd container definitions to set-up automatically many aspects of fluentd. It is still possible to trigger this behaviour by removing this charts current `.Values.env` configuration and replace by: -> **Tip**: You can use the default [values.yaml](values.yaml) +```yaml +env: +- name: FLUENT_ELASTICSEARCH_HOST + value: "elasticsearch-master" +- name: FLUENT_ELASTICSEARCH_PORT + value: "9200" +``` diff --git a/charts/fluentd/dashboards/fluentd.json b/charts/fluentd/dashboards/fluentd.json new file mode 100644 index 0000000..1d19c67 --- /dev/null +++ b/charts/fluentd/dashboards/fluentd.json @@ -0,0 +1,3185 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "$DS_PROMETHEUS", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "fluentd 1.x deployed in kubernetes and scraped by prometheus", + "editable": true, + "gnetId": 13042, + "graphTooltip": 1, + "iteration": 1613145081841, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 19, + "panels": [], + "title": "General", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "If you see errors then you probbaly have serious issues with log processing, see https://docs.fluentd.org/buffer#handling-unrecoverable-errors\n\nRetries are normal but should occur only from time to time, otherwise check for network errors or destination is too slow and requires additional tuning per given provider.", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/Error.*/", + "color": "#E02F44" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_retry_count{pod=~\"$pod\"}[1m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Retry rate", + "refId": "A" + }, + { + "expr": "sum(rate(fluentd_output_status_num_errors{pod=~\"$pod\"}[1m]))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Error rate", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Fluentd output error/retry rate", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ops", + "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 + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "Input and output total rates", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 1 + }, + "hiddenSeries": false, + "id": 44, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m]))", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "input", + "refId": "A" + }, + { + "expr": "sum(rate(fluentd_output_status_write_count{pod=~\"$pod\"}[1m]))", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "output", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input / output rate", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "This should not reach 0 otherwise logs are blocked from processing or even dropped", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 1 + }, + "hiddenSeries": false, + "id": 20, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "min(fluentd_output_status_buffer_available_space_ratio)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "lowest across all hosts", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "fluentd output status buffer available space ratio", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "percent", + "label": null, + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "total flush time", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 6 + }, + "hiddenSeries": false, + "id": 21, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "count", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_flush_time_count{pod=~\"$pod\"}[1m]))", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "time", + "refId": "A" + }, + { + "expr": "sum(rate(fluentd_output_status_slow_flush_count[1m]))", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "count", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "fluentd output status flush time count rate", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "ms", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "Current total size of stage and queue buffers.\nfluentd_output_status_buffer_total_bytes", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 6 + }, + "hiddenSeries": false, + "id": 13, + "legend": { + "alignAsTable": false, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_total_bytes) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current total size of stage and queue buffers.", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "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 + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 6 + }, + "hiddenSeries": false, + "id": 15, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_queue_length)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "total", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Fluentd output buffer queue", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 17, + "panels": [], + "title": "Input details", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_input_status_num_records_total", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 12 + }, + "hiddenSeries": false, + "id": 39, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m])) ", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "total", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input entries rate (total)", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_input_status_num_records_total", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 12 + }, + "hiddenSeries": false, + "id": 47, + "interval": "", + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m])) by (hostname)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{hostname}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input entries rate per hostname", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_input_status_num_records_total", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 18 + }, + "hiddenSeries": false, + "id": 60, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m])) by (namespace)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{namespace}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input entries rate per namespace", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_input_status_num_records_total", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 18 + }, + "hiddenSeries": false, + "id": 48, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m])) by (instance)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{namespace}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input entries rate per instance", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 59, + "panels": [], + "title": "Input details (warning, very slow!)", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_input_status_num_records_total", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 25 + }, + "hiddenSeries": false, + "id": 49, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_input_status_num_records_total{pod=~\"$pod\"}[1m])) by (tag)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{tag}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Input entries rate per tag", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 41, + "panels": [], + "title": "Buffer Stage", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_stage_length", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 32 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_stage_length) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current length of stage buffers.", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_stage_byte_size", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 32 + }, + "hiddenSeries": false, + "id": 23, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_stage_byte_size) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current total size of stage buffers.", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "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 + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 43, + "panels": [], + "title": "Buffer Queue", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 39 + }, + "hiddenSeries": false, + "id": 50, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "max_over_time(fluentd_output_status_buffer_queue_length[1m])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Maximum buffer length in last 1min", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 39 + }, + "hiddenSeries": false, + "id": 25, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "max_over_time(fluentd_output_status_buffer_total_bytes[1m])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Maximum buffer bytes in last 1min", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "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 + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_queue_length", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 45 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_queue_length) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current length of queue buffers.", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_queue_byte_size", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 45 + }, + "hiddenSeries": false, + "id": 51, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_queue_byte_size) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current total size of queue buffers.", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "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 + } + }, + { + "collapsed": true, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 51 + }, + "id": 46, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_available_space_ratio", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 52 + }, + "hiddenSeries": false, + "id": 26, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_available_space_ratio) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Ratio of available space in buffer.", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percent", + "label": null, + "logBase": 1, + "max": "100", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Buffer Space", + "type": "row" + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 52 + }, + "id": 53, + "panels": [], + "title": "Buffer Retries", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_retry_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 53 + }, + "hiddenSeries": false, + "id": 30, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_retry_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current retry counts.", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_emit_records", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 53 + }, + "hiddenSeries": false, + "id": 33, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_emit_records{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current emit records", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_emit_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 59 + }, + "hiddenSeries": false, + "id": 32, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_emit_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current emit counts rate", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_rollback_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 59 + }, + "hiddenSeries": false, + "id": 35, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_rollback_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current rollback counts", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_write_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 65 + }, + "hiddenSeries": false, + "id": 34, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_write_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current write counts", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_slow_flush_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 65 + }, + "hiddenSeries": false, + "id": 37, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_slow_flush_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current slow flush counts", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_retry_wait", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 71 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_retry_wait{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current retry wait", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_flush_time_count", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 71 + }, + "hiddenSeries": false, + "id": 36, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_flush_time_count{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Total flush time", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "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 + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 77 + }, + "id": 57, + "panels": [], + "title": "Buffer Errors", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_num_errors", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 78 + }, + "hiddenSeries": false, + "id": 31, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(fluentd_output_status_num_errors{pod=~\"$pod\"}[1m])) by (type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current number of errors rate", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "$DS_PROMETHEUS", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 84 + }, + "id": 55, + "panels": [], + "title": "Buffer timekeys", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 85 + }, + "hiddenSeries": false, + "id": 29, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "fluentd_output_status_buffer_newest_timekey - fluentd_output_status_buffer_oldest_timekey", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Timekey diff", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_newest_timekey", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 85 + }, + "hiddenSeries": false, + "id": 27, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_newest_timekey) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Newest timekey in buffer.", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$DS_PROMETHEUS", + "description": "fluentd_output_status_buffer_oldest_timekey", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 91 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "alignAsTable": false, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(fluentd_output_status_buffer_oldest_timekey) by (pod, type)", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{pod}} {{ type }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Oldest timekey in buffer.", + "tooltip": { + "shared": true, + "sort": 2, + "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": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "10s", + "schemaVersion": 20, + "style": "dark", + "tags": [ + "fluentd", + "logging" + ], + "templating": { + "list": [ + { + "current": { + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": null, + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": "$DS_PROMETHEUS", + "definition": "label_values(kube_pod_info{pod=~\".*fluentd.*\"}, pod)", + "hide": 0, + "includeAll": true, + "label": "pod", + "multi": false, + "name": "pod", + "options": [], + "query": "label_values(kube_pod_info{pod=~\".*fluentd.*\"}, pod)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "utc", + "title": "Fluentd 1.x", + "uid": "bNn5LUtizs3", + "version": 1 +} diff --git a/charts/fluentd/templates/NOTES.txt b/charts/fluentd/templates/NOTES.txt index ab58dca..b248dcb 100644 --- a/charts/fluentd/templates/NOTES.txt +++ b/charts/fluentd/templates/NOTES.txt @@ -1,6 +1,5 @@ -To verify that Fluentd Elasticsearch has started, run: +Get Fluentd build information by running these commands: - kubectl --namespace={{ .Release.Namespace }} get all -l "app={{ template "fluentd.name" . }},release={{ .Release.Name }}" - -THIS APPLICATION CAPTURES ALL CONSOLE OUTPUT AND FORWARDS IT TO Elasticsearch. Anything that might be identifying, -including things like IP addresses, container images, and object names will NOT be anonymized. +export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fluentd.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 24231:24231 +curl http://127.0.0.1:24231/metrics diff --git a/charts/fluentd/templates/_helpers.tpl b/charts/fluentd/templates/_helpers.tpl index 557177f..72e878d 100644 --- a/charts/fluentd/templates/_helpers.tpl +++ b/charts/fluentd/templates/_helpers.tpl @@ -31,6 +31,26 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Common labels +*/}} +{{- define "fluentd.labels" -}} +helm.sh/chart: {{ include "fluentd.chart" . }} +{{ include "fluentd.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "fluentd.selectorLabels" -}} +app.kubernetes.io/name: {{ include "fluentd.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + {{/* Create the name of the service account to use */}} @@ -41,3 +61,32 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Shortened version of the releaseName, applied as a suffix to numerous resources. +*/}} +{{- define "fluentd.shortReleaseName" -}} +{{- .Release.Name | trunc 35 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Name of the configMap used for the fluentd.conf configuration file; allows users to override the default. +*/}} +{{- define "fluentd.mainConfigMapName" -}} +{{- if .Values.mainConfigMapNameOverride -}} + {{ .Values.mainConfigMapNameOverride }} +{{- else -}} + {{ printf "%s-%s" "fluentd-main" ( include "fluentd.shortReleaseName" . ) }} +{{- end -}} +{{- end -}} + +{{/* +Name of the configMap used for additional configuration files; allows users to override the default. +*/}} +{{- define "fluentd.extraFilesConfigMapName" -}} +{{- if .Values.extraFilesConfigMapNameOverride -}} + {{ printf "%s" .Values.extraFilesConfigMapNameOverride }} +{{- else -}} + {{ printf "%s-%s" "fluentd-config" ( include "fluentd.shortReleaseName" . ) }} +{{- end -}} +{{- end -}} diff --git a/charts/fluentd/templates/_pod.tpl b/charts/fluentd/templates/_pod.tpl new file mode 100644 index 0000000..e285e3a --- /dev/null +++ b/charts/fluentd/templates/_pod.tpl @@ -0,0 +1,130 @@ +{{- define "fluentd.pod" -}} +{{- $defaultTag := printf "%s-debian-%s-1.0" (.Chart.AppVersion) (.Values.variant) -}} +{{- with .Values.imagePullSecrets }} +imagePullSecrets: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if .Values.priorityClassName }} +priorityClassName: {{ .Values.priorityClassName }} +{{- end }} +serviceAccountName: {{ include "fluentd.serviceAccountName" . }} +securityContext: + {{- toYaml .Values.podSecurityContext | nindent 2 }} +{{- with .Values.terminationGracePeriodSeconds }} +terminationGracePeriodSeconds: {{ . }} +{{- end }} +{{- with .Values.initContainers }} +initContainers: + {{- toYaml . | nindent 2 }} +{{- end }} +containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 6 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default $defaultTag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.plugins }} + command: + - "/bin/sh" + - "-c" + - | + {{- range $plugin := .Values.plugins }} + {{- print "fluent-gem install " $plugin | nindent 6 }} + {{- end }} + exec /fluentd/entrypoint.sh + {{- end }} + env: + - name: FLUENTD_CONF + value: "../../../etc/fluent/fluent.conf" + {{- if .Values.env }} + {{- toYaml .Values.env | nindent 4 }} + {{- end }} + {{- if .Values.envFrom }} + envFrom: + {{- toYaml .Values.envFrom | nindent 4 }} + {{- end }} + ports: + - name: metrics + containerPort: 24231 + protocol: TCP + {{- range $port := .Values.service.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.containerPort }} + protocol: {{ $port.protocol }} + {{- end }} + {{- with .Values.lifecycle }} + lifecycle: + {{- toYaml . | nindent 6 }} + {{- end }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 6 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 6 }} + resources: + {{- toYaml .Values.resources | nindent 8 }} + volumeMounts: + - name: etcfluentd-main + mountPath: /etc/fluent + - name: etcfluentd-config + mountPath: /etc/fluent/config.d/ + {{- if .Values.mountVarLogDirectory }} + - name: varlog + mountPath: /var/log + {{- end }} + {{- if .Values.mountDockerContainersDirectory }} + - name: varlibdockercontainers + mountPath: /var/lib/docker/containers + readOnly: true + {{- end }} + {{- if .Values.volumeMounts -}} + {{- toYaml .Values.volumeMounts | nindent 4 }} + {{- end -}} + {{- range $key := .Values.configMapConfigs }} + {{- print "- name: " $key | nindent 4 }} + {{- print "mountPath: /etc/fluent/" $key ".d" | nindent 6 }} + {{- end }} + {{- if .Values.persistence.enabled }} + - mountPath: /var/log/fluent + name: {{ include "fluentd.fullname" . }}-buffer + {{- end }} +volumes: +- name: etcfluentd-main + configMap: + name: {{ include "fluentd.mainConfigMapName" . }} + defaultMode: 0777 +- name: etcfluentd-config + configMap: + name: {{ include "fluentd.extraFilesConfigMapName" . }} + defaultMode: 0777 +{{- if .Values.mountVarLogDirectory }} +- name: varlog + hostPath: + path: /var/log +{{- end }} +{{- if .Values.mountDockerContainersDirectory }} +- name: varlibdockercontainers + hostPath: + path: /var/lib/docker/containers +{{- end }} +{{- if .Values.volumes -}} +{{- toYaml .Values.volumes | nindent 0 }} +{{- end -}} +{{- range $key := .Values.configMapConfigs }} +{{- print "- name: " $key | nindent 0 }} + configMap: + {{- print "name: " $key "-" ( include "fluentd.shortReleaseName" $ ) | nindent 4 }} + defaultMode: 0777 +{{- end }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.affinity }} +affinity: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end -}} diff --git a/charts/fluentd/templates/clusterrole.yaml b/charts/fluentd/templates/clusterrole.yaml index ccdf142..bc0a572 100644 --- a/charts/fluentd/templates/clusterrole.yaml +++ b/charts/fluentd/templates/clusterrole.yaml @@ -1,21 +1,28 @@ {{- if .Values.rbac.create -}} -kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole metadata: name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "fluentd.labels" . | nindent 4 }} rules: -- apiGroups: - - "" - resources: - - "namespaces" - - "pods" - verbs: - - "get" - - "watch" - - "list" + - apiGroups: + - "" + resources: + - pods + - namespaces + verbs: + - get + - list + - watch + {{- if and .Values.podSecurityPolicy.enabled (semverCompare "<1.25-0" .Capabilities.KubeVersion.GitVersion) }} + - apiGroups: + - policy + resourceNames: + - {{ include "fluentd.fullname" . }} + resources: + - podsecuritypolicies + verbs: + - use + {{- end }} {{- end -}} diff --git a/charts/fluentd/templates/clusterrolebinding.yaml b/charts/fluentd/templates/clusterrolebinding.yaml index 7d4b85c..dff8cae 100644 --- a/charts/fluentd/templates/clusterrolebinding.yaml +++ b/charts/fluentd/templates/clusterrolebinding.yaml @@ -1,19 +1,16 @@ {{- if .Values.rbac.create -}} -kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding metadata: - name: {{ template "fluentd.fullname" . }} + name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -subjects: -- kind: ServiceAccount - name: {{ template "fluentd.fullname" . }} - namespace: {{ .Release.Namespace }} + {{- include "fluentd.labels" . | nindent 4 }} roleRef: - kind: ClusterRole - name: {{ template "fluentd.fullname" . }} apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "fluentd.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ include "fluentd.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} {{- end -}} diff --git a/charts/fluentd/templates/configmap-dashboards.yaml b/charts/fluentd/templates/configmap-dashboards.yaml new file mode 100644 index 0000000..de0d5cf --- /dev/null +++ b/charts/fluentd/templates/configmap-dashboards.yaml @@ -0,0 +1,18 @@ +{{- if .Values.dashboards.enabled -}} +{{- range $path, $_ := .Files.Glob "dashboards/*.json" }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: dashboard-{{ trimSuffix ".json" (base $path) }}-{{ include "fluentd.shortReleaseName" $ }} + namespace: {{ $.Values.dashboards.namespace | default $.Release.Namespace }} + labels: + {{- include "fluentd.labels" $ | nindent 4 }} + {{- range $key, $val := $.Values.dashboards.labels }} + {{ $key }}: {{ $val }} + {{- end }} +data: + {{ base $path }}: |- + {{- $.Files.Get $path | nindent 4 }} +--- +{{- end }} +{{- end -}} diff --git a/charts/fluentd/templates/configmap.yaml b/charts/fluentd/templates/configmap.yaml deleted file mode 100644 index 81d52c0..0000000 --- a/charts/fluentd/templates/configmap.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fluentd.fullname" . }} - labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{- range $key, $value := .Values.configMaps }} - {{ $key }}: |- -{{ $value | indent 4 }} -{{- end }} -{{- if .Values.metrics.enabled }} - metrics.conf: | - - @type prometheus - port {{ .Values.metrics.service.port }} - - - - @type prometheus_monitor - - - - @type prometheus_output_monitor - -{{- end }} -{{- if and (.Values.plugins.enabled) (gt (len .Values.plugins.pluginsList) 0) }} - install-plugins.sh: |- - #!/bin/sh - {{- range $plugin := .Values.plugins.pluginsList }} - fluent-gem install {{ $plugin }} - {{- end }} - exec /run.sh -{{- end }} diff --git a/charts/fluentd/templates/daemonset.yaml b/charts/fluentd/templates/daemonset.yaml new file mode 100644 index 0000000..1fb6f76 --- /dev/null +++ b/charts/fluentd/templates/daemonset.yaml @@ -0,0 +1,40 @@ +{{- if eq .Values.kind "DaemonSet" }} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "fluentd.fullname" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "fluentd.selectorLabels" . | nindent 6 }} + {{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.minReadySeconds }} + minReadySeconds: {{ . }} + {{- end }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "fluentd.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- include "fluentd.pod" . | nindent 6 }} +{{- end }} diff --git a/charts/fluentd/templates/deployment.yaml b/charts/fluentd/templates/deployment.yaml index 7afd466..431d2a0 100644 --- a/charts/fluentd/templates/deployment.yaml +++ b/charts/fluentd/templates/deployment.yaml @@ -1,151 +1,41 @@ -{{- $statefulSet := or (.Values.autoscaling.enabled) (.Values.useStatefulSet) -}} +{{- if eq .Values.kind "Deployment" }} apiVersion: apps/v1 -{{- if $statefulSet }} -kind: StatefulSet -{{- else}} kind: Deployment -{{- end}} metadata: - name: {{ template "fluentd.fullname" . }} + name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: -{{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} -{{- end }} -{{- if .Values.autoscaling.enabled }} - serviceName: {{ template "fluentd.name" . }} -{{- end }} + {{- with .Values.updateStrategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} selector: matchLabels: - app: {{ template "fluentd.name" . }} - release: {{ .Release.Name }} - {{- if and .Values.persistence.enabled (not .Values.autoscaling.enabled) }} - strategy: - type: Recreate + {{- include "fluentd.selectorLabels" . | nindent 6 }} + {{- with .Values.minReadySeconds }} + minReadySeconds: {{ . }} {{- end }} template: metadata: - labels: - app: {{ template "fluentd.name" . }} - release: {{ .Release.Name }} -{{- with .Values.deployment.labels }} -{{ toYaml . | indent 8 }} -{{- end }} annotations: - checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} - {{- if .Values.annotations }} - {{- toYaml .Values.annotations | nindent 8 }} + checksum/config: {{ include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} {{- end }} - spec: -{{- if .Values.image.pullSecrets }} - imagePullSecrets: - {{- range $pullSecret := .Values.image.pullSecrets }} - - name: {{ $pullSecret }} - {{- end }} -{{- end }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if and (.Values.plugins.enabled) (gt (len .Values.plugins.pluginsList) 0) }} - command: ["/bin/sh", "-c", "/etc/fluent/config.d/install-plugins.sh"] - {{- end }} - env: - - name: OUTPUT_HOST - value: {{ .Values.output.host | quote }} - - name: OUTPUT_PORT - value: {{ .Values.output.port | quote }} - - name: OUTPUT_SCHEME - value: {{ .Values.output.scheme | quote }} - - name: OUTPUT_SSL_VERSION - value: {{ .Values.output.sslVersion | quote }} - - name: OUTPUT_BUFFER_CHUNK_LIMIT - value: {{ .Values.output.buffer_chunk_limit | quote }} - - name: OUTPUT_BUFFER_QUEUE_LIMIT - value: {{ .Values.output.buffer_queue_limit | quote }} - {{- range $key, $value := .Values.env }} - - name: {{ $key | quote }} - value: {{ $value | quote }} - {{- end }} - {{- if .Values.extraEnvVars }} -{{ toYaml .Values.extraEnvVars | indent 10 }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - ports: -{{- range $port := .Values.service.ports }} - - name: {{ $port.name }} - containerPort: {{ $port.containerPort }} - protocol: {{ $port.protocol }} -{{- end }} -{{- if .Values.metrics.enabled }} - - name: metrics - containerPort: {{ .Values.metrics.service.port }} - protocol: TCP -{{- end }} - - name: http-input - containerPort: 9880 - protocol: TCP - livenessProbe: - httpGet: - # Use percent encoding for query param. - # The value is {"log": "health check"}. - # the endpoint itself results in a new fluentd - # tag 'fluentd.pod-healthcheck' - path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D - port: 9880 - initialDelaySeconds: 5 - timeoutSeconds: 1 - volumeMounts: - - name: config-volume-{{ template "fluentd.fullname" . }} - mountPath: /etc/fluent/config.d - - name: buffer - mountPath: "/var/log/fluentd-buffers" -{{- if .Values.extraVolumeMounts }} -{{ toYaml .Values.extraVolumeMounts | indent 8 }} -{{- end }} - serviceAccountName: {{ template "fluentd.fullname" . }} - volumes: - - name: config-volume-{{ template "fluentd.fullname" . }} - configMap: - name: {{ template "fluentd.fullname" . }} - defaultMode: 0777 - {{- if and .Values.persistence.enabled (not $statefulSet) }} - - name: buffer - persistentVolumeClaim: - claimName: {{ template "fluentd.fullname" . }} - {{- else if (not .Values.persistence.enabled) }} - - name: buffer - emptyDir: {} + labels: + {{- include "fluentd.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} {{- end }} -{{- if .Values.extraVolumes }} -{{ toYaml .Values.extraVolumes | indent 8 }} -{{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} -{{- if and .Values.persistence.enabled ($statefulSet) }} - volumeClaimTemplates: - - metadata: - name: buffer spec: - accessModes: [{{ .Values.persistence.accessMode }}] - storageClassName: {{ .Values.persistence.storageClass }} - resources: - requests: - storage: {{ .Values.persistence.size }} + {{- include "fluentd.pod" . | nindent 6 }} {{- end }} diff --git a/charts/fluentd/templates/files.conf/prometheus.yaml b/charts/fluentd/templates/files.conf/prometheus.yaml new file mode 100644 index 0000000..e063d10 --- /dev/null +++ b/charts/fluentd/templates/files.conf/prometheus.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "fluentd.labels" . | nindent 4 }} + name: fluentd-prometheus-conf-{{ include "fluentd.shortReleaseName" . }} +data: + prometheus.conf: |- + + @type prometheus + @id in_prometheus + bind "0.0.0.0" + port 24231 + metrics_path "/metrics" + + + + @type prometheus_monitor + @id in_prometheus_monitor + + + + @type prometheus_output_monitor + @id in_prometheus_output_monitor + diff --git a/charts/fluentd/templates/files.conf/systemd.yaml b/charts/fluentd/templates/files.conf/systemd.yaml new file mode 100644 index 0000000..aedf345 --- /dev/null +++ b/charts/fluentd/templates/files.conf/systemd.yaml @@ -0,0 +1,83 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "fluentd.labels" . | nindent 4 }} + name: fluentd-systemd-conf-{{ include "fluentd.shortReleaseName" . }} +data: + systemd.conf: |- + + @type systemd + @id in_systemd_internal_kubernetes + @label @KUBERNETES_SYSTEM + matches [{"_SYSTEMD_UNIT":"kubelet.service"},{"_SYSTEMD_UNIT":"kube-apiserver.service"},{"_SYSTEMD_UNIT":"kube-controller-manager.service"},{"_SYSTEMD_UNIT":"kube-proxy.service"},{"_SYSTEMD_UNIT":"kube-scheduler.service"}] + read_from_head true + tag "internal-kubernetes.systemd" + + @type "local" + persistent true + path "/var/log/fluentd-journald-internal_kubernetes-cursor.json" + + + fields_strip_underscores true + field_map {"MESSAGE": "message", "_TRANSPORT": "stream", "_SYSTEMD_UNIT": "systemd_unit", "_HOSTNAME": "hostname"} + field_map_strict true + + + + + @type systemd + @id in_systemd_etcd + @label @KUBERNETES_SYSTEM + matches [{"_SYSTEMD_UNIT":"etcd.service"}] + read_from_head true + tag "etcd.systemd" + + @type "local" + persistent true + path "/var/log/fluentd-journald-internal_etcd-cursor.json" + + + fields_strip_underscores true + field_map {"MESSAGE": "message", "_TRANSPORT": "stream", "_SYSTEMD_UNIT": "systemd_unit", "_HOSTNAME": "hostname"} + field_map_strict true + + + + diff --git a/charts/fluentd/templates/fluentd-configurations-cm.yaml b/charts/fluentd/templates/fluentd-configurations-cm.yaml new file mode 100644 index 0000000..289af6b --- /dev/null +++ b/charts/fluentd/templates/fluentd-configurations-cm.yaml @@ -0,0 +1,38 @@ +{{- if not .Values.extraFilesConfigMapNameOverride }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluentd-config-{{ include "fluentd.shortReleaseName" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} +data: +{{- range $key, $value := .Values.fileConfigs }} + {{$key }}: |- + {{- $value | nindent 4 }} +{{- end }} +{{- end }} + +{{- if not .Values.mainConfigMapNameOverride }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluentd-main-{{ include "fluentd.shortReleaseName" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} +data: + fluent.conf: |- + # do not collect fluentd logs to avoid infinite loops. + + + @include config.d/*.conf + {{- range $key := .Values.configMapConfigs }} + {{- print "@include " $key ".d/*" | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/fluentd/templates/hpa.yaml b/charts/fluentd/templates/hpa.yaml index 3ffd699..b2e8282 100644 --- a/charts/fluentd/templates/hpa.yaml +++ b/charts/fluentd/templates/hpa.yaml @@ -1,20 +1,39 @@ -{{- if and .Values.autoscaling.enabled}} +{{- if and ( eq .Values.kind "Deployment" ) .Values.autoscaling.enabled }} apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "fluentd.labels" . | nindent 4 }} spec: + {{- if .Values.autoscaling.behavior }} + behavior: + {{- toYaml .Values.autoscaling.behavior | nindent 4 }} + {{- end }} scaleTargetRef: apiVersion: apps/v1 - kind: StatefulSet + kind: Deployment name: {{ include "fluentd.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: - {{- toYaml .Values.autoscaling.metrics | nindent 4 }} -{{- end }} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + type: Utilization + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + type: Utilization + {{- end }} + {{- if .Values.autoscaling.customRules -}} + {{- toYaml .Values.autoscaling.customRules | nindent 4}} + {{- end -}} +{{- end }} \ No newline at end of file diff --git a/charts/fluentd/templates/ingress.yaml b/charts/fluentd/templates/ingress.yaml index 4ed5891..e837713 100644 --- a/charts/fluentd/templates/ingress.yaml +++ b/charts/fluentd/templates/ingress.yaml @@ -1,36 +1,44 @@ {{- if .Values.ingress.enabled -}} -{{- $serviceName := include "fluentd.fullname" . -}} -apiVersion: extensions/v1beta1 +{{- $fullName := include "fluentd.fullname" . -}} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ template "fluentd.fullname" . }} + name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- if .Values.ingress.labels }} -{{ toYaml .Values.ingress.labels | indent 4 }} -{{- end }} -{{- if .Values.ingress.annotations }} + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} annotations: -{{ tpl ( toYaml .Values.ingress.annotations | indent 4 ) . }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + {{- with .secretName }} + secretName: {{ . }} + {{- end }} + {{- end }} + {{- end }} rules: - {{- range $host := .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} - http: paths: - - path: {{ $host.path | default "/" }} + - path: / + pathType: Prefix backend: - serviceName: {{ $serviceName }} - servicePort: {{ $host.servicePort }} - {{- if (not (empty $host.name)) }} - host: {{ $host.name }} - {{- end -}} + service: + name: {{ $fullName }} + port: + number: {{ .port }} + {{ if .host -}} + host: {{ .host | quote }} + {{- end -}} {{- end -}} - {{- if .Values.ingress.tls }} - tls: -{{ toYaml .Values.ingress.tls | indent 4 }} - {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/fluentd/templates/podsecuritypolicy.yaml b/charts/fluentd/templates/podsecuritypolicy.yaml new file mode 100644 index 0000000..f0ebc0a --- /dev/null +++ b/charts/fluentd/templates/podsecuritypolicy.yaml @@ -0,0 +1,42 @@ +{{- if and .Values.podSecurityPolicy.enabled (semverCompare "<1.25-0" .Capabilities.KubeVersion.GitVersion) -}} +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: {{ include "fluentd.fullname" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} +{{- if .Values.podSecurityPolicy.annotations }} + annotations: +{{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }} +{{- end }} +spec: + privileged: false + allowPrivilegeEscalation: false + requiredDropCapabilities: + - ALL + hostNetwork: false + hostIPC: false + hostPID: false + volumes: + - 'configMap' + - 'secret' + - 'hostPath' + {{- if .Values.persistence.enabled }} + - 'persistentVolumeClaim' + {{- end }} + runAsUser: + rule: 'RunAsAny' + seLinux: + rule: 'RunAsAny' + supplementalGroups: + rule: 'MustRunAs' + ranges: + - min: 1 + max: 65535 + fsGroup: + rule: 'MustRunAs' + ranges: + - min: 1 + max: 65535 + readOnlyRootFilesystem: false +{{- end }} \ No newline at end of file diff --git a/charts/fluentd/templates/prometheusrules.yaml b/charts/fluentd/templates/prometheusrules.yaml new file mode 100644 index 0000000..26361b7 --- /dev/null +++ b/charts/fluentd/templates/prometheusrules.yaml @@ -0,0 +1,21 @@ +{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.metrics.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ template "fluentd.fullname" . }} + {{- if .Values.metrics.prometheusRule.namespace }} + namespace: {{ .Values.metrics.prometheusRule.namespace }} + {{- end }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.metrics.prometheusRule.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.metrics.prometheusRule.rules }} + groups: + - name: {{ template "fluentd.fullname" $ }} + rules: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/fluentd/templates/pvc.yaml b/charts/fluentd/templates/pvc.yaml deleted file mode 100644 index 694967b..0000000 --- a/charts/fluentd/templates/pvc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- $statefulSet := or (.Values.autoscaling.enabled) (.Values.useStatefulSet) -}} -{{- if and .Values.persistence.enabled (not $statefulSet) -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "fluentd.fullname" . }} - labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- if .Values.persistence.annotations }} - annotations: -{{ toYaml .Values.persistence.annotations | indent 4 }} -{{- end }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end -}} diff --git a/charts/fluentd/templates/role.yaml b/charts/fluentd/templates/role.yaml deleted file mode 100644 index c65a1f5..0000000 --- a/charts/fluentd/templates/role.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.rbac.create }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: {{ template "fluentd.fullname" . }} - labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -rules: -- apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - verbs: ['use'] - resourceNames: - - {{ template "fluentd.fullname" . }} -{{- end }} diff --git a/charts/fluentd/templates/rolebinding.yaml b/charts/fluentd/templates/rolebinding.yaml deleted file mode 100644 index 50f47c1..0000000 --- a/charts/fluentd/templates/rolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.rbac.create }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ template "fluentd.fullname" . }} - labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -roleRef: - kind: Role - name: {{ template "fluentd.fullname" . }} - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: {{ template "fluentd.fullname" . }} - namespace: {{ .Release.Namespace }} -{{- end }} diff --git a/charts/fluentd/templates/service.yaml b/charts/fluentd/templates/service.yaml index 1590cb5..4d5d60f 100644 --- a/charts/fluentd/templates/service.yaml +++ b/charts/fluentd/templates/service.yaml @@ -1,35 +1,38 @@ +{{- if .Values.service.enabled -}} apiVersion: v1 kind: Service metadata: - name: {{ template "fluentd.fullname" . }} + name: {{ include "fluentd.fullname" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.service.annotations }} annotations: -{{ toYaml .Values.service.annotations | indent 4 }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} - {{ if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + {{- if .Values.service.loadBalancerIP }} loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{ end }} + {{- end }} + {{- if .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} + {{- end }} ports: + - port: 24231 + targetPort: metrics + protocol: TCP + name: metrics + {{- if .Values.service.ports }} {{- range $port := .Values.service.ports }} - - name: {{ $port.name }} - port: {{ $port.containerPort }} - targetPort: {{ $port.containerPort }} - protocol: {{ $port.protocol }} + - name: {{ $port.name }} + port: {{ $port.containerPort }} + targetPort: {{ $port.containerPort }} + protocol: {{ $port.protocol }} + {{- if and ( eq $.Values.service.type "NodePort" ) $port.nodePort }} + nodePort: {{ $port.nodePort }} + {{- end }} {{- end }} - {{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} - nodePort: {{ .Values.service.nodePort }} - {{ end }} - {{- if .Values.metrics.enabled }} - - name: metrics - port: {{ .Values.metrics.service.port }} - targetPort: metrics - protocol: TCP {{- end }} selector: - app: {{ template "fluentd.name" . }} - release: {{ .Release.Name }} + {{- include "fluentd.selectorLabels" . | nindent 4 }} +{{- end -}} diff --git a/charts/fluentd/templates/serviceaccount.yaml b/charts/fluentd/templates/serviceaccount.yaml index f1db1da..2ff3384 100644 --- a/charts/fluentd/templates/serviceaccount.yaml +++ b/charts/fluentd/templates/serviceaccount.yaml @@ -4,8 +4,9 @@ kind: ServiceAccount metadata: name: {{ include "fluentd.serviceAccountName" . }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} {{- end -}} diff --git a/charts/fluentd/templates/servicemonitor.yaml b/charts/fluentd/templates/servicemonitor.yaml index 76c55b7..521b6c5 100644 --- a/charts/fluentd/templates/servicemonitor.yaml +++ b/charts/fluentd/templates/servicemonitor.yaml @@ -1,33 +1,44 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.metrics.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ include "fluentd.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} + name: {{ template "fluentd.fullname" . }} + {{- with .Values.metrics.serviceMonitor.namespace }} + namespace: {{ . }} {{- end }} labels: - app: {{ template "fluentd.name" . }} - chart: {{ template "fluentd.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} -{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.metrics.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} {{- end }} spec: + jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | default .Release.Name }} endpoints: - port: metrics - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} + path: /metrics + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- with .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} {{- end }} +{{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ tpl (toYaml .Values.metrics.serviceMonitor.metricRelabelings | indent 6) . }} +{{- end }} +{{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: +{{ toYaml .Values.metrics.serviceMonitor.relabelings | indent 6 }} +{{- end }} + {{- if .Values.metrics.serviceMonitor.namespaceSelector }} + namespaceSelector: + {{ toYaml .Values.metrics.serviceMonitor.namespaceSelector | indent 4 -}} + {{ else }} namespaceSelector: matchNames: - {{ .Release.Namespace }} + {{- end }} selector: matchLabels: - app: {{ include "fluentd.name" . }} - release: {{ .Release.Name }} + {{- include "fluentd.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/charts/fluentd/templates/statefulset.yaml b/charts/fluentd/templates/statefulset.yaml new file mode 100644 index 0000000..5bc2248 --- /dev/null +++ b/charts/fluentd/templates/statefulset.yaml @@ -0,0 +1,55 @@ +{{- if eq .Values.kind "StatefulSet" }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "fluentd.fullname" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + serviceName: {{ include "fluentd.fullname" . }} + {{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} + {{- end }} + selector: + matchLabels: + {{- include "fluentd.selectorLabels" . | nindent 6 }} + {{- with .Values.minReadySeconds }} + minReadySeconds: {{ . }} + {{- end }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/fluentd-configurations-cm.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "fluentd.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- include "fluentd.pod" . | nindent 6 }} + {{- if or .Values.persistence.enabled }} + volumeClaimTemplates: + {{- if or .Values.persistence.enabled }} + - metadata: + name: {{ include "fluentd.fullname" . }}-buffer + spec: + accessModes: [{{ .Values.persistence.accessMode }}] + resources: + requests: + storage: {{ .Values.persistence.size }} + storageClassName: {{ .Values.persistence.storageClass }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/fluentd/templates/tests/test-connection.yaml b/charts/fluentd/templates/tests/test-connection.yaml new file mode 100644 index 0000000..7c0f815 --- /dev/null +++ b/charts/fluentd/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "fluentd.fullname" . }}-test-connection" + labels: + {{- include "fluentd.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "fluentd.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/fluentd/values.yaml b/charts/fluentd/values.yaml index 6023fee..59a6653 100644 --- a/charts/fluentd/values.yaml +++ b/charts/fluentd/values.yaml @@ -1,224 +1,393 @@ -# Default values for fluentd. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 +nameOverride: "" +fullnameOverride: "" + +# DaemonSet, Deployment or StatefulSet +kind: "DaemonSet" +# azureblob, cloudwatch, elasticsearch7, elasticsearch8, gcs, graylog , kafka, kafka2, kinesis, opensearch +variant: elasticsearch7 +# # Only applicable for Deployment or StatefulSet +# replicaCount: 1 image: - repository: gcr.io/google-containers/fluentd-elasticsearch - tag: v2.4.0 - pullPolicy: IfNotPresent - # pullSecrets: - # - secret1 - # - secret2 - -output: - host: elasticsearch-client.default.svc.cluster.local - port: 9200 - scheme: http - sslVersion: TLSv1 - buffer_chunk_limit: 2M - buffer_queue_limit: 8 - -env: {} - -# Extra Environment Values - allows yaml definitions -extraEnvVars: -# - name: VALUE_FROM_SECRET -# valueFrom: -# secretKeyRef: -# name: secret_name -# key: secret_key - -# extraVolumes: -# - name: es-certs -# secret: -# defaultMode: 420 -# secretName: es-certs -# extraVolumeMounts: -# - name: es-certs -# mountPath: /certs -# readOnly: true - -plugins: + repository: "fluent/fluentd-kubernetes-daemonset" + pullPolicy: "IfNotPresent" + tag: "" + +## Optional array of imagePullSecrets containing private registry credentials +## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] + +serviceAccount: + create: true + annotations: {} + name: null + +rbac: + create: true + +# from Kubernetes 1.25, PSP is deprecated +# See: https://kubernetes.io/blog/2022/08/23/kubernetes-v1-25-release/#pod-security-changes +# We automatically disable PSP if Kubernetes version is 1.25 or higher +podSecurityPolicy: + enabled: true + annotations: {} + +## Security Context policies for controller pods +## See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for +## notes on enabling and using sysctls +## +podSecurityContext: {} + # seLinuxOptions: + # type: "spc_t" + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# Configure the livecycle +# Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ +lifecycle: {} + # preStop: + # exec: + # command: ["/bin/sh", "-c", "sleep 20"] + +# Configure the livenessProbe +# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: /metrics + port: metrics + # initialDelaySeconds: 0 + # periodSeconds: 10 + # timeoutSeconds: 1 + # successThreshold: 1 + # failureThreshold: 3 + +# Configure the readinessProbe +# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +readinessProbe: + httpGet: + path: /metrics + port: metrics + # initialDelaySeconds: 0 + # periodSeconds: 10 + # timeoutSeconds: 1 + # successThreshold: 1 + # failureThreshold: 3 + +resources: {} + # requests: + # cpu: 10m + # memory: 128Mi + # limits: + # memory: 128Mi + +## only available if kind is Deployment +autoscaling: enabled: false - pluginsList: [] + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + ## 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 + # behavior: + # scaleDown: + # policies: + # - type: Pods + # value: 4 + # periodSeconds: 60 + # - type: Percent + # value: 10 + # periodSeconds: 60 + +# priorityClassName: "system-node-critical" + +nodeSelector: {} + +## Node tolerations for server scheduling to nodes with taints +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +## +tolerations: [] +# - key: null +# operator: Exists +# effect: "NoSchedule" + +## Affinity and anti-affinity +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Annotations to be added to fluentd DaemonSet/Deployment +## +annotations: {} + +## Labels to be added to fluentd DaemonSet/Deployment +## +labels: {} + +## Annotations to be added to fluentd pods +## +podAnnotations: {} + +## Labels to be added to fluentd pods +## +podLabels: {} + +## How long (in seconds) a pods needs to be stable before progressing the deployment +## +minReadySeconds: + +## How long (in seconds) a pod may take to exit (useful with lifecycle hooks to ensure lb deregistration is done) +## +terminationGracePeriodSeconds: + +## Deployment strategy / DaemonSet updateStrategy +## +updateStrategy: {} +# type: RollingUpdate +# rollingUpdate: +# maxUnavailable: 1 + +## Additional environment variables to set for fluentd pods +env: [] + # - name: "FLUENTD_CONF" + # value: "../../../etc/fluent/fluent.conf" + # - name: FLUENT_ELASTICSEARCH_HOST + # value: "elasticsearch-master" + # - name: FLUENT_ELASTICSEARCH_PORT + # value: "9200" + +envFrom: [] + +initContainers: [] + +## Name of the configMap containing a custom fluentd.conf configuration file to use instead of the default. +# mainConfigMapNameOverride: "" +## Name of the configMap containing files to be placed under /etc/fluent/config.d/ +## NOTE: This will replace ALL default files in the aforementioned path! +# extraFilesConfigMapNameOverride: "" + +mountVarLogDirectory: true +mountDockerContainersDirectory: true + +volumes: [] + +volumeMounts: [] + +## Only available if kind is StatefulSet +## Fluentd persistence +## +persistence: + enabled: false + storageClass: "" + accessMode: ReadWriteOnce + size: 10Gi + +## Fluentd service +## service: + enabled: true + type: "ClusterIP" annotations: {} - type: ClusterIP # loadBalancerIP: - # type: NodePort - # nodePort: - # Used to create Service records - ports: - - name: "monitor-agent" - protocol: TCP - containerPort: 24220 + # externalTrafficPolicy: Local + ports: [] + # - name: "forwarder" + # protocol: TCP + # containerPort: 24224 +## Prometheus Monitoring +## metrics: - enabled: false - service: - port: 24231 serviceMonitor: + enabled: false + additionalLabels: + release: prometheus-operator + namespace: "" + namespaceSelector: {} + ## metric relabel configs to apply to samples before ingestion. + ## + metricRelabelings: [] + # - sourceLabels: [__name__] + # separator: ; + # regex: ^fluentd_output_status_buffer_(oldest|newest)_.+ + # replacement: $1 + # action: drop + ## relabel configs to apply to samples after ingestion. + ## + relabelings: [] + # - sourceLabels: [__meta_kubernetes_pod_node_name] + # separator: ; + # regex: ^(.*)$ + # targetLabel: nodename + # replacement: $1 + # action: replace + ## Additional serviceMonitor config + ## + # jobLabel: fluentd + # scrapeInterval: 30s + # scrapeTimeout: 5s + # honorLabels: true + + prometheusRule: enabled: false additionalLabels: {} - # namespace: monitoring - # interval: 30s - # scrapeTimeout: 10s + namespace: "" + rules: [] + # - alert: FluentdDown + # expr: up{job="fluentd"} == 0 + # for: 5m + # labels: + # context: fluentd + # severity: warning + # annotations: + # summary: "Fluentd Down" + # description: "{{ $labels.pod }} on {{ $labels.nodename }} is down" + # - alert: FluentdScrapeMissing + # expr: absent(up{job="fluentd"} == 1) + # for: 15m + # labels: + # context: fluentd + # severity: warning + # annotations: + # summary: "Fluentd Scrape Missing" + # description: "Fluentd instance has disappeared from Prometheus target discovery" -annotations: {} -# prometheus.io/scrape: "true" -# prometheus.io/port: "24231" +## Grafana Monitoring Dashboard +## +dashboards: + enabled: "true" + namespace: "" + labels: + grafana_dashboard: '"1"' -# Pod Labels -deployment: - labels: {} +## Fluentd list of plugins to install +## +plugins: [] +# - fluent-plugin-out-http -ingress: - enabled: false - annotations: - kubernetes.io/ingress.class: nginx -# kubernetes.io/tls-acme: "true" -# # Depending on which version of ingress controller you may need to configure properly - https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target -# nginx.ingress.kubernetes.io/rewrite-target: / - labels: [] - # If doing TCP or UDP ingress rule don't forget to update your Ingress Controller to accept TCP connections - https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/ - hosts: -# - name: "http-input.local" -# protocol: TCP -# servicePort: 9880 -# path: / - tls: {} - # Secrets must be manually created in the namespace. -# - secretName: http-input-tls -# hosts: -# - http-input.local - -configMaps: - general.conf: | - # Prevent fluentd from handling records containing its own logs. Otherwise - # it can lead to an infinite loop, when error in sending one message generates - # another message which also fails to be sent and so on. - - @type null - - - # Used for health checking - - @type http - port 9880 - bind 0.0.0.0 - +## Add fluentd config files from K8s configMaps +## +configMapConfigs: [] +# - fluentd-prometheus-conf +# - fluentd-systemd-conf - # Emits internal metrics to every minute, and also exposes them on port - # 24220. Useful for determining if an output plugin is retryring/erroring, - # or determining the buffer queue length. - - @type monitor_agent - bind 0.0.0.0 - port 24220 - tag fluentd.monitor.metrics - - system.conf: |- - - root_dir /tmp/fluentd-buffers/ - - forward-input.conf: | +## Fluentd configurations: +## +fileConfigs: + 01_sources.conf: |- + ## logs from podman - @type forward - port 24224 - bind 0.0.0.0 + @type tail + @id in_tail_container_logs + @label @KUBERNETES + path /var/log/containers/*.log + pos_file /var/log/fluentd-containers.log.pos + tag kubernetes.* + read_from_head true + + @type multi_format + + format json + time_key time + time_type string + time_format "%Y-%m-%dT%H:%M:%S.%NZ" + keep_time_key false + + + format regexp + expression /^(? + + emit_unmatched_lines true - output.conf: | - - @id elasticsearch - @type elasticsearch - @log_level info - include_tag_key true - # Replace with the host/port to your Elasticsearch cluster. - host "#{ENV['OUTPUT_HOST']}" - port "#{ENV['OUTPUT_PORT']}" - scheme "#{ENV['OUTPUT_SCHEME']}" - ssl_version "#{ENV['OUTPUT_SSL_VERSION']}" - logstash_format true - - @type file - path /var/log/fluentd-buffers/kubernetes.system.buffer - flush_mode interval - retry_type exponential_backoff - flush_thread_count 2 - flush_interval 5s - retry_forever - retry_max_interval 30 - chunk_limit_size "#{ENV['OUTPUT_BUFFER_CHUNK_LIMIT']}" - queue_limit_length "#{ENV['OUTPUT_BUFFER_QUEUE_LIMIT']}" - overflow_action block - - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 500m - # memory: 200Mi - # requests: - # cpu: 500m - # memory: 200Mi - -rbac: - # Specifies whether RBAC resources should be created - create: true + 02_filters.conf: |- + -nodeSelector: {} + 03_dispatch.conf: |- + -affinity: {} + 04_outputs.conf: |- + -# Enable autoscaling using HorizontalPodAutoscaler -autoscaling: +ingress: enabled: false - minReplicas: 2 - maxReplicas: 5 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 60 - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: 60 - -# Consider to set higher value when using in conjuction with autoscaling -# Full description about this field: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#pod-v1-core -terminationGracePeriodSeconds: 30 + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + # - host: fluentd.example.tld + - port: 9880 + + tls: [] + # - secretName: fluentd-tls + # hosts: + # - fluentd.example.tld