diff --git a/charts/kubezero-logging/Chart.yaml b/charts/kubezero-logging/Chart.yaml index f030c77..e0f27b1 100644 --- a/charts/kubezero-logging/Chart.yaml +++ b/charts/kubezero-logging/Chart.yaml @@ -23,7 +23,7 @@ dependencies: repository: https://helm.elastic.co condition: eck-operator.enabled - name: fluentd - version: 2.5.3 + version: 0.2.2 condition: fluentd.enabled - name: fluent-bit version: 0.12.3 diff --git a/charts/kubezero-logging/charts/fluentd/.helmignore b/charts/kubezero-logging/charts/fluentd/.helmignore index f0c1319..0e8a0eb 100644 --- a/charts/kubezero-logging/charts/fluentd/.helmignore +++ b/charts/kubezero-logging/charts/fluentd/.helmignore @@ -14,8 +14,10 @@ *.swp *.bak *.tmp +*.orig *~ # Various IDEs .project .idea/ *.tmproj +.vscode/ diff --git a/charts/kubezero-logging/charts/fluentd/Chart.yaml b/charts/kubezero-logging/charts/fluentd/Chart.yaml index 90be6be..3fcba93 100644 --- a/charts/kubezero-logging/charts/fluentd/Chart.yaml +++ b/charts/kubezero-logging/charts/fluentd/Chart.yaml @@ -1,12 +1,13 @@ -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 -name: fluentd -version: 2.5.3 -appVersion: v2.4.0 +apiVersion: v2 +appVersion: v1.12.0 +description: A Helm chart for Kubernetes home: https://www.fluentd.org/ +icon: https://www.fluentd.org/assets/img/miscellany/fluentd-logo_2x.png +maintainers: +- email: eduardo@treasure-data.com + name: edsiper +name: fluentd 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 +- https://github.com/fluent/fluentd/ +- https://github.com/fluent/fluentd-kubernetes-daemonset +version: 0.2.2 diff --git a/charts/kubezero-logging/charts/fluentd/README.md b/charts/kubezero-logging/charts/fluentd/README.md index 06cb698..2156a9b 100644 --- a/charts/kubezero-logging/charts/fluentd/README.md +++ b/charts/kubezero-logging/charts/fluentd/README.md @@ -1,121 +1,176 @@ -# ⚠️ 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. - -## TL;DR; - -```console -$ helm install stable/fluentd +```sh +helm repo add fluent https://fluent.github.io/helm-charts +helm repo update ``` -## Introduction +To install a release named `fluentd`, run: -This chart bootstraps an fluentd deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -## Installing the Chart - -To install the chart with the release name `my-release`: - -```console -$ helm install stable/fluentd --name my-release +```sh +helm install fluentd 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. +## Chart Values -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -$ helm delete my-release +```sh +helm show values fluent/fluentd ``` -The command removes all the Kubernetes components associated with the chart and deletes the release. +## Value Details -## Autoscaling +### default-volumes -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 +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`. -## 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 +```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 ``` -Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, +### default-volumeMounts -```console -$ helm install stable/fluentd --name my-release -f values.yaml +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 + +```yaml +- name: varlog + mountPath: /var/log +- name: varlibdockercontainers + mountPath: /var/lib/docker/containers + readOnly: true ``` -> **Tip**: You can use the default [values.yaml](values.yaml) +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: |- + +``` + +## Backwards Compatibility - v0.1.x + +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: + +```yaml +env: +- name: FLUENT_ELASTICSEARCH_HOST + value: "elasticsearch-master" +- name: FLUENT_ELASTICSEARCH_PORT + value: "9200" +``` diff --git a/charts/kubezero-logging/charts/fluentd/dashboards/fluentd.json b/charts/kubezero-logging/charts/fluentd/dashboards/fluentd.json new file mode 100644 index 0000000..1d19c67 --- /dev/null +++ b/charts/kubezero-logging/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/kubezero-logging/charts/fluentd/templates/NOTES.txt b/charts/kubezero-logging/charts/fluentd/templates/NOTES.txt index ab58dca..62664d8 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/NOTES.txt +++ b/charts/kubezero-logging/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}") +echo "curl http://127.0.0.1:24231/metrics for Fluentd metrics" +kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 24231:24231 diff --git a/charts/kubezero-logging/charts/fluentd/templates/_helpers.tpl b/charts/kubezero-logging/charts/fluentd/templates/_helpers.tpl index 557177f..ffef2ac 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/_helpers.tpl +++ b/charts/kubezero-logging/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 */}} diff --git a/charts/kubezero-logging/charts/fluentd/templates/_pod.tpl b/charts/kubezero-logging/charts/fluentd/templates/_pod.tpl new file mode 100644 index 0000000..3961bb6 --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/_pod.tpl @@ -0,0 +1,82 @@ +{{- define "fluentd.pod" -}} +{{- $defaultTag := printf "%s-debian-elasticsearch7-1.0" (.Chart.AppVersion) -}} +{{- 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 }} +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 }} + {{- if .Values.env }} + env: + {{- toYaml .Values.env | nindent 6 }} + {{- end }} + {{- if .Values.envFrom }} + envFrom: + {{- toYaml .Values.envFrom | nindent 6 }} + {{- end }} + ports: + - name: metrics + containerPort: 24231 + protocol: TCP + {{- range $port := .Values.service.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.containerPort }} + protocol: {{ $port.protocol }} + {{- end }} + livenessProbe: + httpGet: + path: /metrics + port: metrics + readinessProbe: + httpGet: + path: /metrics + port: metrics + resources: + {{- toYaml .Values.resources | nindent 8 }} + volumeMounts: + {{- toYaml .Values.volumeMounts | nindent 6 }} + {{- range $key := .Values.configMapConfigs }} + {{- print "- name: fluentd-custom-cm-" $key | nindent 6 }} + {{- print "mountPath: /etc/fluent/" $key ".d" | nindent 8 }} + {{- end }} +volumes: + {{- toYaml .Values.volumes | nindent 2 }} + {{- range $key := .Values.configMapConfigs }} + {{- print "- name: fluentd-custom-cm-" $key | nindent 2 }} + configMap: + {{- print "name: " . | nindent 6 }} + 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/kubezero-logging/charts/fluentd/templates/clusterrole.yaml b/charts/kubezero-logging/charts/fluentd/templates/clusterrole.yaml index ccdf142..6d2b53f 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/clusterrole.yaml +++ b/charts/kubezero-logging/charts/fluentd/templates/clusterrole.yaml @@ -1,21 +1,26 @@ {{- 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 + - apiGroups: + - policy + resourceNames: + - {{ include "fluentd.fullname" . }} + resources: + - podsecuritypolicies + verbs: + - use {{- end -}} diff --git a/charts/kubezero-logging/charts/fluentd/templates/clusterrolebinding.yaml b/charts/kubezero-logging/charts/fluentd/templates/clusterrolebinding.yaml index 7d4b85c..dff8cae 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/clusterrolebinding.yaml +++ b/charts/kubezero-logging/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/kubezero-logging/charts/fluentd/templates/configmap-dashboards.yaml b/charts/kubezero-logging/charts/fluentd/templates/configmap-dashboards.yaml new file mode 100644 index 0000000..862114e --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/configmap-dashboards.yaml @@ -0,0 +1,17 @@ +{{- if .Values.dashboards.enabled -}} +{{- range $path, $_ := .Files.Glob "dashboards/*.json" }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: dashboard-{{ trimSuffix ".json" (base $path) }} + 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/kubezero-logging/charts/fluentd/templates/configmap.yaml b/charts/kubezero-logging/charts/fluentd/templates/configmap.yaml deleted file mode 100644 index 81d52c0..0000000 --- a/charts/kubezero-logging/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/kubezero-logging/charts/fluentd/templates/daemonset.yaml b/charts/kubezero-logging/charts/fluentd/templates/daemonset.yaml new file mode 100644 index 0000000..6b4ff40 --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/daemonset.yaml @@ -0,0 +1,25 @@ +{{- if eq .Values.kind "DaemonSet" }} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "fluentd.fullname" . }} + labels: + {{- include "fluentd.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "fluentd.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- 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/kubezero-logging/charts/fluentd/templates/deployment.yaml b/charts/kubezero-logging/charts/fluentd/templates/deployment.yaml index 7afd466..602ca39 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/deployment.yaml +++ b/charts/kubezero-logging/charts/fluentd/templates/deployment.yaml @@ -1,151 +1,27 @@ -{{- $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 }} spec: -{{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} -{{- end }} -{{- if .Values.autoscaling.enabled }} - serviceName: {{ template "fluentd.name" . }} -{{- end }} selector: matchLabels: - app: {{ template "fluentd.name" . }} - release: {{ .Release.Name }} - {{- if and .Values.persistence.enabled (not .Values.autoscaling.enabled) }} - strategy: - type: Recreate - {{- end }} + {{- include "fluentd.selectorLabels" . | nindent 6 }} 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 }} + labels: + {{- include "fluentd.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- 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: {} - {{- 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/kubezero-logging/charts/fluentd/templates/files.conf/prometheus.yaml b/charts/kubezero-logging/charts/fluentd/templates/files.conf/prometheus.yaml new file mode 100644 index 0000000..2b9be3c --- /dev/null +++ b/charts/kubezero-logging/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 +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/kubezero-logging/charts/fluentd/templates/fluentd-configurations-cm.yaml b/charts/kubezero-logging/charts/fluentd/templates/fluentd-configurations-cm.yaml new file mode 100644 index 0000000..97e7613 --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/fluentd-configurations-cm.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluentd-config + labels: + {{- include "fluentd.labels" . | nindent 4 }} +data: +{{- range $key, $value := .Values.fileConfigs }} + {{$key }}: |- + {{- (tpl $value $) | nindent 4 }} +{{- end }} + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluentd-main + 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 }} diff --git a/charts/kubezero-logging/charts/fluentd/templates/hpa.yaml b/charts/kubezero-logging/charts/fluentd/templates/hpa.yaml deleted file mode 100644 index 3ffd699..0000000 --- a/charts/kubezero-logging/charts/fluentd/templates/hpa.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if and .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 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: StatefulSet - name: {{ include "fluentd.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- toYaml .Values.autoscaling.metrics | nindent 4 }} -{{- end }} diff --git a/charts/kubezero-logging/charts/fluentd/templates/ingress.yaml b/charts/kubezero-logging/charts/fluentd/templates/ingress.yaml deleted file mode 100644 index 4ed5891..0000000 --- a/charts/kubezero-logging/charts/fluentd/templates/ingress.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $serviceName := include "fluentd.fullname" . -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ template "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 }} - annotations: -{{ tpl ( toYaml .Values.ingress.annotations | indent 4 ) . }} -{{- end }} -spec: - rules: - {{- range $host := .Values.ingress.hosts }} - - http: - paths: - - path: {{ $host.path | default "/" }} - backend: - serviceName: {{ $serviceName }} - servicePort: {{ $host.servicePort }} - {{- if (not (empty $host.name)) }} - host: {{ $host.name }} - {{- end -}} - {{- end -}} - {{- if .Values.ingress.tls }} - tls: -{{ toYaml .Values.ingress.tls | indent 4 }} - {{- end -}} -{{- end -}} \ No newline at end of file diff --git a/charts/kubezero-logging/charts/fluentd/templates/podsecuritypolicy.yaml b/charts/kubezero-logging/charts/fluentd/templates/podsecuritypolicy.yaml new file mode 100644 index 0000000..2341f63 --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/podsecuritypolicy.yaml @@ -0,0 +1,39 @@ +{{- if .Values.podSecurityPolicy.enabled }} +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' + 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 }} diff --git a/charts/kubezero-logging/charts/fluentd/templates/prometheusrules.yaml b/charts/kubezero-logging/charts/fluentd/templates/prometheusrules.yaml new file mode 100644 index 0000000..961e6e7 --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/prometheusrules.yaml @@ -0,0 +1,20 @@ +{{- 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/kubezero-logging/charts/fluentd/templates/pvc.yaml b/charts/kubezero-logging/charts/fluentd/templates/pvc.yaml deleted file mode 100644 index 694967b..0000000 --- a/charts/kubezero-logging/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/kubezero-logging/charts/fluentd/templates/role.yaml b/charts/kubezero-logging/charts/fluentd/templates/role.yaml deleted file mode 100644 index 36d48d9..0000000 --- a/charts/kubezero-logging/charts/fluentd/templates/role.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.rbac.create }} -apiVersion: rbac.authorization.k8s.io/v1beta1 -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/kubezero-logging/charts/fluentd/templates/rolebinding.yaml b/charts/kubezero-logging/charts/fluentd/templates/rolebinding.yaml deleted file mode 100644 index 09f5b0f..0000000 --- a/charts/kubezero-logging/charts/fluentd/templates/rolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.rbac.create }} -apiVersion: rbac.authorization.k8s.io/v1beta1 -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/kubezero-logging/charts/fluentd/templates/service.yaml b/charts/kubezero-logging/charts/fluentd/templates/service.yaml index 1590cb5..dec930c 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/service.yaml +++ b/charts/kubezero-logging/charts/fluentd/templates/service.yaml @@ -1,35 +1,28 @@ + 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))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{ 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 }} {{- 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 }} diff --git a/charts/kubezero-logging/charts/fluentd/templates/serviceaccount.yaml b/charts/kubezero-logging/charts/fluentd/templates/serviceaccount.yaml index f1db1da..2ff3384 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/serviceaccount.yaml +++ b/charts/kubezero-logging/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/kubezero-logging/charts/fluentd/templates/servicemonitor.yaml b/charts/kubezero-logging/charts/fluentd/templates/servicemonitor.yaml index 76c55b7..4b542bd 100644 --- a/charts/kubezero-logging/charts/fluentd/templates/servicemonitor.yaml +++ b/charts/kubezero-logging/charts/fluentd/templates/servicemonitor.yaml @@ -1,33 +1,35 @@ -{{- 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: 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.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/kubezero-logging/charts/fluentd/templates/tests/test-connection.yaml b/charts/kubezero-logging/charts/fluentd/templates/tests/test-connection.yaml new file mode 100644 index 0000000..73b5bdf --- /dev/null +++ b/charts/kubezero-logging/charts/fluentd/templates/tests/test-connection.yaml @@ -0,0 +1,17 @@ +{{- if .Values.testFramework.enabled }} +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 +{{- end }} diff --git a/charts/kubezero-logging/charts/fluentd/values.yaml b/charts/kubezero-logging/charts/fluentd/values.yaml index 6023fee..a2e7b5e 100644 --- a/charts/kubezero-logging/charts/fluentd/values.yaml +++ b/charts/kubezero-logging/charts/fluentd/values.yaml @@ -1,224 +1,260 @@ -# Default values for fluentd. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 +nameOverride: "" +fullnameOverride: "" + +# DaemonSet or Deployment +kind: "DaemonSet" + +# # Only applicable for Deployment +# replicaCount: 1 image: - repository: gcr.io/google-containers/fluentd-elasticsearch - tag: v2.4.0 - pullPolicy: IfNotPresent - # pullSecrets: - # - secret1 - # - secret2 + repository: "fluent/fluentd-kubernetes-daemonset" + pullPolicy: "IfNotPresent" + tag: "" -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: +testFramework: enabled: false - pluginsList: [] -service: - annotations: {} - type: ClusterIP - # loadBalancerIP: - # type: NodePort - # nodePort: - # Used to create Service records - ports: - - name: "monitor-agent" - protocol: TCP - containerPort: 24220 - -metrics: - enabled: false - service: - port: 24231 - serviceMonitor: - enabled: false - additionalLabels: {} - # namespace: monitoring - # interval: 30s - # scrapeTimeout: 10s - -annotations: {} -# prometheus.io/scrape: "true" -# prometheus.io/port: "24231" - -# Pod Labels -deployment: - labels: {} - -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 - - - # 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: | - - @type forward - port 24224 - bind 0.0.0.0 - - 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 +## Optional array of imagePullSecrets containing private registry credentials +## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] serviceAccount: - # Specifies whether a ServiceAccount should be created create: true - # The name of the ServiceAccount to use. - # If not set and create is true, a name is generated using the fullname template - name: + annotations: {} + name: null -## Persist data to a persistent volume -persistence: - enabled: false +rbac: + create: true - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - # annotations: {} - accessMode: ReadWriteOnce - size: 10Gi +# Configure podsecuritypolicy +# Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ +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 + +resources: {} + # requests: + # cpu: 10m + # memory: 128Mi + # limits: + # memory: 128Mi + +# 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: {} -# Enable autoscaling using HorizontalPodAutoscaler -autoscaling: - 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 +## Annotations to be added to fluentd pods +## +podAnnotations: {} -# 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 +## Labels to be added to fluentd pods +## +podLabels: {} + +## 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: [] + +volumes: +- 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 + +volumeMounts: +- name: varlog + mountPath: /var/log +- name: varlibdockercontainers + mountPath: /var/lib/docker/containers + readOnly: true +- name: etcfluentd-main + mountPath: /etc/fluent +- name: etcfluentd-config + mountPath: /etc/fluent/config.d/ + +## Fluentd service +## +service: + type: "ClusterIP" + annotations: {} + ports: [] + # - name: "forwarder" + # protocol: TCP + # containerPort: 24224 + +## Prometheus Monitoring +## +metrics: + serviceMonitor: + enabled: false + additionalLabels: + release: prometheus-operator + namespace: "" + namespaceSelector: {} + # scrapeInterval: 30s + # scrapeTimeout: 5s + # honorLabels: true + + prometheusRule: + enabled: false + additionalLabels: {} + namespace: "" + rules: [] + +## Grafana Monitoring Dashboard +## +dashboards: + enabled: "true" + namespace: "" + labels: + grafana_dashboard: '"1"' + +## Fluentd list of plugins to install +## +plugins: [] +# - fluent-plugin-out-http + +## Add fluentd config files from K8s configMaps +## +configMapConfigs: + - fluentd-prometheus-conf +# - fluentd-systemd-conf + +## Fluentd configurations: +## +fileConfigs: + 01_sources.conf: |- + ## logs from podman + + @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: |- + diff --git a/charts/kubezero-logging/fluentd.patch b/charts/kubezero-logging/fluentd.patch new file mode 100644 index 0000000..ded9050 --- /dev/null +++ b/charts/kubezero-logging/fluentd.patch @@ -0,0 +1,125 @@ +diff -tubrN charts/fluentd/templates/files.conf/systemd.yaml charts/fluentd.zdt/templates/files.conf/systemd.yaml +--- charts/fluentd/templates/files.conf/systemd.yaml 2021-02-12 18:13:04.000000000 +0100 ++++ charts/fluentd.zdt/templates/files.conf/systemd.yaml 1970-01-01 01:00:00.000000000 +0100 +@@ -1,83 +0,0 @@ +-apiVersion: v1 +-kind: ConfigMap +-metadata: +- labels: +- {{- include "fluentd.labels" . | nindent 4 }} +- name: fluentd-systemd-conf +-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 -tubrN charts/fluentd/templates/fluentd-configurations-cm.yaml charts/fluentd.zdt/templates/fluentd-configurations-cm.yaml +--- charts/fluentd/templates/fluentd-configurations-cm.yaml 2021-02-12 18:13:04.000000000 +0100 ++++ charts/fluentd.zdt/templates/fluentd-configurations-cm.yaml 2021-03-09 17:00:50.318180593 +0100 +@@ -7,7 +7,7 @@ + data: + {{- range $key, $value := .Values.fileConfigs }} + {{$key }}: |- +- {{- $value | nindent 4 }} ++ {{- (tpl $value $) | nindent 4 }} + {{- end }} + + --- +diff -tubrN charts/fluentd/templates/tests/test-connection.yaml charts/fluentd.zdt/templates/tests/test-connection.yaml +--- charts/fluentd/templates/tests/test-connection.yaml 2021-02-12 18:13:04.000000000 +0100 ++++ charts/fluentd.zdt/templates/tests/test-connection.yaml 2021-03-09 17:02:56.061519591 +0100 +@@ -1,3 +1,4 @@ ++{{- if .Values.testFramework.enabled }} + apiVersion: v1 + kind: Pod + metadata: +@@ -13,3 +14,4 @@ + command: ['wget'] + args: ['{{ include "fluentd.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never ++{{- end }} +diff -tubrN charts/fluentd/values.yaml charts/fluentd.zdt/values.yaml +--- charts/fluentd/values.yaml 2021-02-12 18:13:04.000000000 +0100 ++++ charts/fluentd.zdt/values.yaml 2021-03-09 17:04:51.438191456 +0100 +@@ -12,6 +12,9 @@ + pullPolicy: "IfNotPresent" + tag: "" + ++testFramework: ++ enabled: false ++ + ## Optional array of imagePullSecrets containing private registry credentials + ## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + imagePullSecrets: [] diff --git a/charts/kubezero-logging/templates/fluentd/secret.yaml b/charts/kubezero-logging/templates/fluentd/secret.yaml deleted file mode 100644 index 761cc92..0000000 --- a/charts/kubezero-logging/templates/fluentd/secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.fluentd.enabled }} -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: {{ template "kubezero-lib.fullname" $ }}-fluentd-secret - namespace: {{ .Release.Namespace }} - labels: -{{ include "kubezero-lib.labels" . | indent 4 }} -data: - shared_key: {{ .Values.fluentd.shared_key | b64enc | quote }} -{{- end }} diff --git a/charts/kubezero-logging/update.sh b/charts/kubezero-logging/update.sh index 4117137..5b97bd5 100755 --- a/charts/kubezero-logging/update.sh +++ b/charts/kubezero-logging/update.sh @@ -1,8 +1,17 @@ #!/bin/bash FLUENT_BIT_VERSION=0.12.3 +FLUENTD_VERSION=0.2.2 +# Fluent Bit rm -rf charts/fluent-bit curl -L -s -o - https://github.com/fluent/helm-charts/releases/download/fluent-bit-${FLUENT_BIT_VERSION}/fluent-bit-${FLUENT_BIT_VERSION}.tgz | tar xfz - -C charts patch -i fluent-bit.patch -p0 --no-backup-if-mismatch + + +# FluentD +rm -rf charts/fluentd +curl -L -s -o - https://github.com/fluent/helm-charts/releases/download/fluentd-${FLUENTD_VERSION}/fluentd-${FLUENTD_VERSION}.tgz | tar xfz - -C charts + +patch -i fluentd.patch -p0 --no-backup-if-mismatch diff --git a/charts/kubezero-logging/values.yaml b/charts/kubezero-logging/values.yaml index 001d536..ee1e51e 100644 --- a/charts/kubezero-logging/values.yaml +++ b/charts/kubezero-logging/values.yaml @@ -39,27 +39,16 @@ kibana: fluentd: enabled: false image: - repository: quay.io/fluentd_elasticsearch/fluentd - tag: v2.9.0 + repository: fluent/fluentd-kubernetes-daemonset + tag: v1.12-debian-elasticsearch7-1 istio: enabled: false - # broken as of 2.5.1 ;-( - # useStatefulSet: true - replicaCount: 2 + kind: Deployment + replicaCount: 1 - plugins: - enabled: false - pluginsList: - #- fluent-plugin-detect-exceptions - #- fluent-plugin-s3 - #- fluent-plugin-grok-parser - - #persistence: - # enabled: true - # storageClass: "ebs-sc-gp2-xfs" - # accessMode: ReadWriteOnce - # size: 4Gi + #plugins: + #- fluent-plugin-s3 service: ports: @@ -71,124 +60,140 @@ fluentd: containerPort: 9880 metrics: - enabled: false serviceMonitor: - enabled: true + enabled: false additionalLabels: release: metrics + dashboards: + enabled: false + + # No need for docker nor /var/log + volumes: + - name: etcfluentd-main + configMap: + name: fluentd-main + defaultMode: 0777 + - name: etcfluentd-config + configMap: + name: fluentd-config + defaultMode: 0777 + volumeMounts: + - name: etcfluentd-main + mountPath: /etc/fluent + - name: etcfluentd-config + mountPath: /etc/fluent/config.d/ + + resources: + requests: + cpu: 50m + memory: 256Mi + limits: + memory: 1024Mi + output: # Default should be "logging-kubezero-logging-es-http" if fullnameOverride is NOT used host: logging-es-http shared_key: "cloudbender" - env: - OUTPUT_USER: elastic - OUTPUT_SSL_VERIFY: "false" + # OUTPUT_USER: elastic + # OUTPUT_SSL_VERIFY: "false" + env: + - name: "FLUENTD_CONF" + value: "../../etc/fluent/fluent.conf" # Same here the secret names change if fullnameOverride is not used !! - extraEnvVars: - name: OUTPUT_PASSWORD valueFrom: secretKeyRef: name: logging-es-elastic-user key: elastic - - name: FLUENTD_SHARED_KEY - valueFrom: - secretKeyRef: - name: logging-fluentd-secret - key: shared_key - configMaps: - general.conf: | - + fileConfigs: + 00_system.conf: |- + + workers 2 + + 01_sources.conf: |- @type http + @label @KUBERNETES port 9880 bind 0.0.0.0 keepalive_timeout 30 - - @type monitor_agent - bind 0.0.0.0 - port 24220 - tag fluentd.monitor.metrics - - forward-input.conf: | @type forward + @label @KUBERNETES port 24224 bind 0.0.0.0 - skip_invalid_event true + # skip_invalid_event true send_keepalive_packet true self_hostname "#{ENV['HOSTNAME']}" - shared_key "#{ENV['FLUENTD_SHARED_KEY']}" + shared_key {{ .Values.shared_key }} - output.conf: | - - @id elasticsearch - @type elasticsearch - @log_level info - include_tag_key true - id_key id - remove_keys id + 02_filters.conf: |- + - hosts "#{ENV['OUTPUT_HOST']}" - port "#{ENV['OUTPUT_PORT']}" - scheme "#{ENV['OUTPUT_SCHEME']}" - ssl_version "#{ENV['OUTPUT_SSL_VERSION']}" - ssl_verify "#{ENV['OUTPUT_SSL_VERIFY']}" - user "#{ENV['OUTPUT_USER']}" - password "#{ENV['OUTPUT_PASSWORD']}" + 04_outputs.conf: |- + + fluent-bit: enabled: false @@ -213,7 +218,7 @@ fluent-bit: refreshInterval: 10 logLevel: warn - flushInterval: 1 + flushInterval: 5 #extraRecords: # source.clustername: MyKubeCluster diff --git a/charts/kubezero/Chart.yaml b/charts/kubezero/Chart.yaml index 5266f58..381ee7c 100644 --- a/charts/kubezero/Chart.yaml +++ b/charts/kubezero/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero description: KubeZero - Bootstrap and ArgoCD Root App of Apps chart type: application -version: 0.5.0 +version: 0.5.1 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: @@ -15,4 +15,4 @@ dependencies: - name: kubezero-lib version: ">= 0.1.3" repository: https://zero-down-time.github.io/kubezero/ -kubeVersion: ">= 1.16.0" +kubeVersion: ">= 1.18.0" diff --git a/charts/kubezero/README.md b/charts/kubezero/README.md index 3cdae9d..e6aa98b 100644 --- a/charts/kubezero/README.md +++ b/charts/kubezero/README.md @@ -1,6 +1,6 @@ # kubezero -![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) KubeZero - Bootstrap and ArgoCD Root App of Apps chart @@ -14,7 +14,7 @@ KubeZero - Bootstrap and ArgoCD Root App of Apps chart ## Requirements -Kubernetes: `>= 1.16.0` +Kubernetes: `>= 1.18.0` | Repository | Name | Version | |------------|------|---------| @@ -32,6 +32,7 @@ Kubernetes: `>= 1.16.0` | argocd.namespace | string | `"argocd"` | | | aws-ebs-csi-driver.enabled | bool | `false` | | | aws-efs-csi-driver.enabled | bool | `false` | | +| aws-node-termination-handler.enabled | bool | `false` | | | calico.crds | bool | `true` | | | calico.enabled | bool | `false` | | | calico.retain | bool | `true` | | diff --git a/charts/kubezero/templates/logging.yaml b/charts/kubezero/templates/logging.yaml index 2a654bc..1b2b8f7 100644 --- a/charts/kubezero/templates/logging.yaml +++ b/charts/kubezero/templates/logging.yaml @@ -47,8 +47,10 @@ kibana: {{- if .Values.logging.fluentd }} fluentd: enabled: {{ .Values.logging.fluentd.enabled }} + replicaCount: {{ default 1 .Values.logging.fluentd.replicaCount }} metrics: - enabled: {{ .Values.metrics.enabled }} + serviceMonitor: + enabled: {{ .Values.metrics.enabled }} url: {{ .Values.logging.fluentd.url }} {{- if .Values.logging.fluentd.output }} output: diff --git a/charts/kubezero/values.yaml b/charts/kubezero/values.yaml index bf9be04..4b7efc5 100644 --- a/charts/kubezero/values.yaml +++ b/charts/kubezero/values.yaml @@ -1,5 +1,3 @@ -argo: {} - global: kubezero: server: https://kubernetes.default.svc @@ -65,3 +63,5 @@ argocd: namespace: argocd istio: enabled: false + +argo: {}