# fluentd-operator ### Backgrouds - fluentbit vs fluentd - fb: daemonset; fd: deployment - instance + mounted secret ### workflow **fluent-bit: scrape / forward logs** ![Fluent Bit workflow](https://github.com/fluent/fluentbit-operator/raw/master/docs/images/fluent-bit-operator-workflow.svg) **fluentd: process / forward logs** ![img](https://github.com/fluent/fluentbit-operator/raw/master/docs/images/fluent-operator.svg) #### Target Configuration Diff https://github.com/zhu733756/fluentbit-operator/blob/master/api/fluentbitoperator/v1alpha2/fluentbitconfig_types_test.go#L14 https://github.com/zhu733756/fluentbit-operator/blob/fluentd-integration/api/fluentdoperator/v1alpha1/tests/expected-main-cfgs.cfg #### Label Router Plugin https://github.com/banzaicloud/fluent-plugin-label-router#configuration #### Configuration build process of single fluentd ![fluentd](https://raw.githubusercontent.com/zhu733756/bedpic/main/architecture/fluentd.svg) **Description of Routes and Outputs** ``` <match **> ---> Global router match all @type label_router <route> ---> route1 (generated from clusterconfig1) @label @clustercfglabel tag @clustercfglabel <match> labels a:b,c:d namespaces kubesphere-logging-system,kube-system </match> <match> ... </match> </route> ... ---> routeN (generated from clusterconfigN) <route> ---> routeN+1 (generated from config1) @label @cfglabel tag @cfglabel <match> labels a:b,c:d namespaces <namespace of this fluentdconfig> </match> </route> ... ---> routeN+M (generated from configN) </match> ------------- <match @clustercfglabel> @id @clustercfgid @type forward <buffer buffertag.*> @id common_buffer @type file chunk_limit_size 5GB path /fluentd/buffer/ </buffer> <server> host host port 14423 </server> <service_discovery> @type file path /sd/path </service_discovery> </match> <match @cfglabel> @id @cfgid @type forward <buffer buffertag.*> @id common_buffer @type file chunk_limit_size 5GB path /fluentd/buffer/ </buffer> <server> host host port 14423 </server> <service_discovery> @type file path /sd/path </service_discovery> </match> ```