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
Copy file name to clipboardexpand all lines: README.md
+15-3
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,9 @@ Once installed, the Fluent Operator provides the following features:
49
49
- [Fluentd](#fluentd-2)
50
50
- [Best Practice](#best-practice)
51
51
- [Plugin Grouping](#plugin-grouping)
52
-
- [Custom Parser](#custom-parser)
52
+
- [Monitoring](#monitoring)
53
+
- [Custom Parser](#custom-parser)
54
+
- [Misc](#misc)
53
55
- [Roadmap](#roadmap)
54
56
- [Development](#development)
55
57
- [Requirements](#requirements)
@@ -248,9 +250,19 @@ For more info on various use cases of Fluent Operator Fluentd CRDs, you can refe
248
250
249
251
### Plugin Grouping
250
252
251
-
For fluenbit,input, filter, and output plugins are connected by label selectors. For input and output plugins, always create `ClusterInput` or `ClusterOutput` CRs for every plugin. Don't aggregate multiple inputs or outputs into one `ClusterInput` or `ClusterOutput` object, except you have a good reason to do so. Take the demo `logging stack` for example, we have one yaml file for each output.
253
+
[Here](docs/best-practice/plugin-grouping.md)you can find the plugin group information.
252
254
253
-
However, for filter plugins, if you want a filter chain, the order of filters matters. You need to organize multiple filters into an array as the demo [logging stack](manifests/logging-stack/filter-kubernetes.yaml) suggests.For more info on various use cases of Fluent Operator Fluentd CRDs, you can refer to [Fluent-Operator-Walkthrough](https://github.com/kubesphere-sigs/fluent-operator-walkthrough#fluent-bit--fluentd-mode).
255
+
### Monitoring
256
+
257
+
[Here](docs/best-practice/monitoring.md) you can use the built-in HTTP Server in Fluent Bit.
258
+
259
+
### Custom Parser
260
+
261
+
[Here](docs/best-practice/custom-parser.md) you can customize parser in Fluent Bit.
262
+
263
+
### Misc
264
+
265
+
If you want to learn more about Fluent-Operator, please refer to the [misc](docs/best-practice/misc.md).
To enable parsers, you must set the value of `FluentBitConfig.Spec.Service.ParsersFile` to `parsers.conf`. Your custom parsers will be included into the built-in parser config via `@INCLUDE /fluent-bit/config/parsers.conf`. Note that the parsers.conf contains a few built-in parsers, for example, docker. Read [parsers.conf](https://github.com/kubesphere/fluentbit-operator/blob/master/conf/parsers.conf) for more information.
4
+
5
+
Check out the demo in the folder `/manifests/regex-parser` for how to use a custom regex parser.
| /fluent-bit/tail | Stores tail related files, eg. file tracking db. Using [fluentbit.spec.positionDB](https://github.com/fluent/fluent-operator/blob/master/docs/fluentbit.md#fluentbitspec) will mount a file `pos.db` under this dir by default. |
9
+
| /fluent-bit/secrets/{secret_name} | Stores secrets, eg. TLS files. Specify secrets to mount in [fluentbit.spec.secrets](https://github.com/fluent/fluent-operator/blob/master/docs/fluentbit.md#fluentbitspec), then you have access. |
10
+
| /fluent-bit/config | Stores the main config file and user-defined parser config file. |
11
+
12
+
> Note that ServiceAccount files are mounted at `/var/run/secrets/kubernetes.io/serviceaccount`.
Fluent Bit comes with a built-in HTTP Server. According to the official [documentation](https://docs.fluentbit.io/manual/administration/monitoring) of fluentbit You can enable this by enabling the HTTP server from the fluent bit configuration file:
4
+
5
+
```conf
6
+
[SERVICE]
7
+
HTTP_Server On
8
+
HTTP_Listen 0.0.0.0
9
+
HTTP_PORT 2020
10
+
```
11
+
12
+
When you use the fluent-operator, You can enable this from `FluentBitConfig` manifest. Example is below:
13
+
14
+
```yaml
15
+
apiVersion: fluentbit.fluent.io/v1alpha2
16
+
kind: ClusterFluentBitConfig
17
+
metadata:
18
+
name: fluent-bit-config
19
+
labels:
20
+
app.kubernetes.io/name: fluent-bit
21
+
spec:
22
+
filterSelector:
23
+
matchLabels:
24
+
fluentbit.fluent.io/enabled: 'true'
25
+
inputSelector:
26
+
matchLabels:
27
+
fluentbit.fluent.io/enabled: 'true'
28
+
outputSelector:
29
+
matchLabels:
30
+
fluentbit.fluent.io/enabled: 'true'
31
+
service:
32
+
httpListen: 0.0.0.0
33
+
httpPort: 2020
34
+
httpServer: true
35
+
parsersFile: parsers.conf
36
+
37
+
```
38
+
39
+
Once HTTP server is enabled, you should be able to get the information:
For fluenbit,input, filter, and output plugins are connected by label selectors. For input and output plugins, always create `ClusterInput` or `ClusterOutput` CRs for every plugin. Don't aggregate multiple inputs or outputs into one `ClusterInput` or `ClusterOutput` object, except you have a good reason to do so. Take the demo `logging stack` for example, we have one yaml file for each output.
6
+
7
+
However, for filter plugins, if you want a filter chain, the order of filters matters. You need to organize multiple filters into an array as the demo [logging stack](https://github.com/fluent/fluent-operator/blob/master/manifests/logging-stack/filter-kubernetes.yaml) suggests.For more info on various use cases of Fluent Operator Fluentd CRDs, you can refer to [Fluent-Operator-Walkthrough](https://github.com/kubesphere-sigs/fluent-operator-walkthrough#fluent-bit--fluentd-mode).
Fluent Bit comes with a built-in HTTP Server. According to the official [documentation](https://docs.fluentbit.io/manual/administration/monitoring) of fluentbit You can enable this by enabling the HTTP server from the fluent bit configuration file:
331
-
332
-
```conf
333
-
[SERVICE]
334
-
HTTP_Server On
335
-
HTTP_Listen 0.0.0.0
336
-
HTTP_PORT 2020
337
-
```
338
-
339
-
When you use the fluent-operator, You can enable this from `FluentBitConfig` manifest. Example is below:
340
-
341
-
```yaml
342
-
apiVersion: fluentbit.fluent.io/v1alpha2
343
-
kind: ClusterFluentBitConfig
344
-
metadata:
345
-
name: fluent-bit-config
346
-
labels:
347
-
app.kubernetes.io/name: fluent-bit
348
-
spec:
349
-
filterSelector:
350
-
matchLabels:
351
-
fluentbit.fluent.io/enabled: 'true'
352
-
inputSelector:
353
-
matchLabels:
354
-
fluentbit.fluent.io/enabled: 'true'
355
-
outputSelector:
356
-
matchLabels:
357
-
fluentbit.fluent.io/enabled: 'true'
358
-
service:
359
-
httpListen: 0.0.0.0
360
-
httpPort: 2020
361
-
httpServer: true
362
-
parsersFile: parsers.conf
363
-
364
-
```
365
-
366
-
Once HTTP server is enabled, you should be able to get the information:
367
-
368
-
```bash
369
-
curl <podIP>:2020 | jq .
370
-
371
-
{
372
-
"fluent-bit": {
373
-
"version": "1.8.3",
374
-
"edition": "Community",
375
-
"flags": [
376
-
"FLB_HAVE_PARSER",
377
-
"FLB_HAVE_RECORD_ACCESSOR",
378
-
"FLB_HAVE_STREAM_PROCESSOR",
379
-
"FLB_HAVE_TLS",
380
-
"FLB_HAVE_OPENSSL",
381
-
"FLB_HAVE_AWS",
382
-
"FLB_HAVE_SIGNV4",
383
-
"FLB_HAVE_SQLDB",
384
-
"FLB_HAVE_METRICS",
385
-
"FLB_HAVE_HTTP_SERVER",
386
-
"FLB_HAVE_SYSTEMD",
387
-
"FLB_HAVE_FORK",
388
-
"FLB_HAVE_TIMESPEC_GET",
389
-
"FLB_HAVE_GMTOFF",
390
-
"FLB_HAVE_UNIX_SOCKET",
391
-
"FLB_HAVE_PROXY_GO",
392
-
"FLB_HAVE_JEMALLOC",
393
-
"FLB_HAVE_LIBBACKTRACE",
394
-
"FLB_HAVE_REGEX",
395
-
"FLB_HAVE_UTF8_ENCODER",
396
-
"FLB_HAVE_LUAJIT",
397
-
"FLB_HAVE_C_TLS",
398
-
"FLB_HAVE_ACCEPT4",
399
-
"FLB_HAVE_INOTIFY"
400
-
]
401
-
}
402
-
}
403
-
```
404
-
405
-
[Back to TOC](#table-of-contents)
406
-
# Path Convention
407
-
408
-
Path to file in Fluent Bit config should be well regulated. Fluent Bit Operator adopts the following convention internally.
| /fluent-bit/tail | Stores tail related files, eg. file tracking db. Using [fluentbit.spec.positionDB](docs/fluentbit.md#fluentbitspec) will mount a file `pos.db` under this dir by default. |
413
-
| /fluent-bit/secrets/{secret_name} | Stores secrets, eg. TLS files. Specify secrets to mount in [fluentbit.spec.secrets](docs/fluentbit.md#fluentbitspec), then you have access. |
414
-
| /fluent-bit/config | Stores the main config file and user-defined parser config file. |
415
-
416
-
> Note that ServiceAccount files are mounted at `/var/run/secrets/kubernetes.io/serviceaccount`.
417
-
418
-
[Back to TOC](#table-of-contents)
419
-
# Custom Parser
420
-
421
-
To enable parsers, you must set the value of `FluentBitConfig.Spec.Service.ParsersFile` to `parsers.conf`. Your custom parsers will be included into the built-in parser config via `@INCLUDE /fluent-bit/config/parsers.conf`. Note that the parsers.conf contains a few built-in parsers, for example, docker. Read [parsers.conf](https://github.com/kubesphere/fluentbit-operator/blob/master/conf/parsers.conf) for more information.
422
-
423
-
Check out the demo in the folder `/manifests/regex-parser` for how to use a custom regex parser.
0 commit comments