You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using Red Hat OpenShift you will also need to set up security context constraints (SCC) using the relevant option in the helm chart.
45
41
46
42
### Installing with Helm Chart
47
43
48
44
[Helm](https://helm.sh) is a package manager for Kubernetes and allows you to quickly deploy application packages into your running cluster. Fluent Bit is distributed via a helm chart found in the Fluent Helm Charts repo: [https://github.com/fluent/helm-charts](https://github.com/fluent/helm-charts).
49
45
50
46
To add the Fluent Helm Charts repo use the following command
To validate that the repo was added you can run `helm search repo fluent` to ensure the charts were added. The default chart can then be installed by running the following
@@ -67,39 +63,12 @@ The default chart values include configuration to read container logs, with Dock
67
63
68
64
The default configuration of Fluent Bit makes sure of the following:
69
65
70
-
* Consume all containers logs from the running Node.
71
-
*The [Tail input plugin](https://docs.fluentbit.io/manual/v/1.0/input/tail) will not append more than **5MB**into the engine until they are flushed to the Elasticsearch backend. This limit aims to provide a workaround for [backpressure](https://docs.fluentbit.io/manual/v/1.0/configuration/backpressure) scenarios.
66
+
* Consume all containers logs from the running Node and parse them with either the `docker` or `cri` multiline parser.
67
+
*Persist how far it got into each file it is tailing so if a pod is restarted it picks up from where it left off.
72
68
* The Kubernetes filter will enrich the logs with Kubernetes metadata, specifically _labels_ and _annotations_. The filter only goes to the API Server when it cannot find the cached info, otherwise it uses the cache.
73
69
* The default backend in the configuration is Elasticsearch set by the [Elasticsearch Output Plugin](../pipeline/outputs/elasticsearch.md). It uses the Logstash format to ingest the logs. If you need a different Index and Type, please refer to the plugin option and do your own adjustments.
74
70
* There is an option called **Retry\_Limit** set to False, that means if Fluent Bit cannot flush the records to Elasticsearch it will re-try indefinitely until it succeed.
75
71
76
-
## Container Runtime Interface (CRI) parser
77
-
78
-
Fluent Bit by default assumes that logs are formatted by the Docker interface standard. However, when using CRI you can run into issues with malformed JSON if you do not modify the parser used. Fluent Bit includes a CRI log parser that can be used instead. An example of the parser is seen below:
Copy file name to clipboardExpand all lines: pipeline/filters/kubernetes.md
+15-10
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,9 @@ To perform processing of the _log_ key, it's **mandatory to enable** the _Merge\
83
83
If _log_ value processing fails, the value is untouched. The order above is not chained, meaning it's exclusive and the filter will try only one of the options above, **not** all of them.
84
84
85
85
## Kubernetes Namespace Meta
86
-
Namespace Meta can be enabled via the following settings:
86
+
87
+
Namespace Meta can be enabled via the following settings:
88
+
87
89
* Namespace\_Labels
88
90
* Namespace\_Annotations
89
91
@@ -94,7 +96,7 @@ Namespace Meta if collected will be stored within a `kubernetes_namespace` recor
94
96
> Namespace meta is not be guaranteed to be in sync as namespace labels & annotations can be adjusted after pod creation. Adjust `Kube_Meta_Namespace_Cache_TTL` to lower caching times to fit your use case.
95
97
96
98
* Namespace\_Metadata\_Only
97
-
- Using this feature will instruct fluent-bit to only fetch namespace metadata and to not fetch POD metadata at all.
99
+
* Using this feature will instruct fluent-bit to only fetch namespace metadata and to not fetch POD metadata at all.
98
100
POD basic metadata like container id, host, etc will be NOT be added and the Labels and Annotations configuration options which are used specifically for POD Metadata will be ignored.
99
101
100
102
## Kubernetes Pod Annotations
@@ -162,7 +164,7 @@ Kubernetes Filter depends on either [Tail](../inputs/tail.md) or [Systemd](../in
162
164
Name tail
163
165
Tag kube.*
164
166
Path /var/log/containers/*.log
165
-
Parser docker
167
+
multiline.parser docker, cri
166
168
167
169
[FILTER]
168
170
Name kubernetes
@@ -223,11 +225,11 @@ You can see on [Rublar.com](https://rubular.com/r/HZz3tYAahj6JCd) web site how t
Under certain and not common conditions, a user would want to alter that hard-coded regular expression, for that purpose the option **Regex\_Parser** can be used \(documented on top\).
229
231
230
-
#####Custom Tag For Enhanced Filtering
232
+
#### Custom Tag For Enhanced Filtering
231
233
232
234
One such use case involves splitting logs by namespace, pods, containers or container id.
233
235
The tag is restructured within the tail input using match groups, this can simplify the filtering by those match groups later in the pipeline.
@@ -287,7 +289,7 @@ rules:
287
289
- pods
288
290
- nodes
289
291
- nodes/proxy
290
-
verbs:
292
+
verbs:
291
293
- get
292
294
- list
293
295
- watch
@@ -432,19 +434,23 @@ If you are not seeing metadata added to your kubernetes logs and see the followi
432
434
When Fluent Bit is deployed as a DaemonSet it generally runs with specific roles that allow the application to talk to the Kubernetes API server. If you are deployed in a more restricted environment check that all the Kubernetes roles are set correctly.
433
435
434
436
You can test this by running the following command (replace `fluentbit-system` with the namespace where your fluentbit is installed)
437
+
435
438
```text
436
439
kubectl auth can-i list pods --as=system:serviceaccount:fluentbit-system:fluentbit
437
440
```
438
-
If set roles are configured correctly, it should simply respond with `yes`.
439
441
440
-
For instance, using Azure AKS, running the above command may respond with:
442
+
If set roles are configured correctly, it should simply respond with `yes`.
443
+
444
+
For instance, using Azure AKS, running the above command may respond with:
445
+
441
446
```text
442
447
no - Azure does not have opinion for this user.
443
448
```
444
449
445
-
If you have connectivity to the API server, but still "could not get meta for POD" - debug logging might give you a message with `Azure does not have opinion for this user`. Then the following `subject` may need to be included in the `fluentbit``ClusterRoleBinding`:
450
+
If you have connectivity to the API server, but still "could not get meta for POD" - debug logging might give you a message with `Azure does not have opinion for this user`. Then the following `subject` may need to be included in the `fluentbit``ClusterRoleBinding`:
446
451
447
452
appended to `subjects` array:
453
+
448
454
```yaml
449
455
- apiGroup: rbac.authorization.k8s.io
450
456
kind: Group
@@ -462,4 +468,3 @@ By default the Kube\_URL is set to `https://kubernetes.default.svc:443` . Ensure
462
468
### I can't see new objects getting metadata
463
469
464
470
In some cases, you may only see some objects being appended with metadata while other objects are not enriched. This can occur at times when local data is cached and does not contain the correct id for the kubernetes object that requires enrichment. For most Kubernetes objects the Kubernetes API server is updated which will then be reflected in Fluent Bit logs, however in some cases for `Pod` objects this refresh to the Kubernetes API server can be skipped, causing metadata to be skipped.
0 commit comments