Merge pull request #1542 from bitnami/fluentdAggregator

[bitnami/fluentd] Add an option to disable aggregator
This commit is contained in:
Carlos Rodríguez Hernández
2019-10-29 13:14:31 +01:00
committed by GitHub
8 changed files with 24 additions and 4 deletions

View File

@@ -82,6 +82,7 @@ The following tables lists the configurable parameters of the kibana chart and t
| `forwarder.tolerations` | Tolerations for pod assignment | `[]` |
| `forwarder.affinity` | Affinity for pod assignment | `{}` |
| `forwarder.podAnnotations` | Pod annotations | `{}` |
| `aggregator.enabled` | Enable Fluentd aggregator | `true` |
| `aggregator.replicaCount` | Number of aggregator pods to deploy in the Stateful Set | `2` |
| `aggregator.configFile` | Name of the config file that will be used by Fluentd at launch under the `/opt/bitnami/fluentd/conf` directory | `fluentd.conf` |
| `aggregator.configMap` | Name of the config map that contains the Fluentd configuration files | `nil` |

View File

@@ -3,13 +3,20 @@
To verify that Fluentd has started, run:
kubectl get all -l "app.kubernetes.io/name={{ include "fluentd.name" . }},app.kubernetes.io/instance={{ .Release.Name }}"
{{ if not .Values.aggregator.configMap }}
{{ if and .Values.aggregator.enabled (not .Values.aggregator.configMap) }}
Logs are captured on each node by the forwarder pods and then sent to the aggregator pods. By default, the aggregator pods send the logs to the standard output.
You can see all the logs by running this command:
kubectl logs -l "app.kubernetes.io/component=aggregator"
You can mount your own configuration files to the aggregators and the forwarders. For example, this is useful if you want to forward the aggregated logs to Elasticsearch or another service.
{{- else if and (not .Values.aggregator.enabled) (not .Values.forwarder.configMap) }}
Logs are captured on each node by the forwarder pods and sent to the standard output
You can see all the logs by running this command:
kubectl logs -l "app.kubernetes.io/component=forwarder"
You can mount your own configuration files to the forwarders. For example, this is useful if you want to forward the logs to Elasticsearch or another service.
{{- end }}
{{- include "fluentd.checkRollingTags" . -}}

View File

@@ -1,4 +1,4 @@
{{- if not .Values.aggregator.configMap -}}
{{- if and .Values.aggregator.enabled (not .Values.aggregator.configMap) -}}
apiVersion: v1
kind: ConfigMap
metadata:

View File

@@ -1,3 +1,4 @@
{{- if .Values.aggregator.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -108,3 +109,4 @@ spec:
{{- with .Values.aggregator.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}

View File

@@ -76,7 +76,7 @@ data:
<filter kubernetes.**>
@type kubernetes_metadata
</filter>
{{ if .Values.aggregator.enabled }}
# Forward all logs to the aggregators
<match **>
@type forward
@@ -101,4 +101,10 @@ data:
flush_interval 5s
</buffer>
</match>
{{- else }}
# Send the logs to the standard output
<match **>
@type stdout
</match>
{{- end -}}
{{- end -}}

View File

@@ -1,3 +1,4 @@
{{- if .Values.aggregator.enabled -}}
apiVersion: v1
kind: Service
metadata:
@@ -12,4 +13,5 @@ spec:
port: {{ .Values.aggregator.port }}
targetPort: tcp
selector: {{- include "fluentd.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: aggregator
app.kubernetes.io/component: aggregator
{{- end -}}

View File

@@ -119,6 +119,7 @@ forwarder:
podAnnotations: {}
aggregator:
enabled: true
## Number of aggregator replicas
##
replicaCount: 2

View File

@@ -119,6 +119,7 @@ forwarder:
podAnnotations: {}
aggregator:
enabled: true
## Number of aggregator replicas
##
replicaCount: 1