fluent / fluent-operator

Operate Fluent Bit and Fluentd in the Kubernetes way - Previously known as FluentBit Operator
Apache License 2.0
587 stars 250 forks source link

bug: Fluentd configuration file is different for each reconciliation, even if no modification is done #1104

Closed antrema closed 7 months ago

antrema commented 7 months ago

Describe the issue

Create thousands of filter.fluentd.fluent.io and fluentdConfig.fluentd.fluent.io in the cluster. Compare the configuration file each time it reconcile, it is different. An infinite reconciliation loop is launched and Fluentd pods are infinitely reloading configuration.

To Reproduce

Create thousands of filter.fluentd.fluent.io and fluentdConfig.fluentd.fluent.io in the cluster. Compare the configuration file each time it reconcile, it is different

Expected behavior

The generated configuration file is the same each time it reconcile (when no modification is done)

Your Environment

- Fluent Operator version: kubesphere/fluent-operator:v2.7.0
- Container Runtime: containerd://1.6.15
- Operating system: Ubuntu 22.04.1 LTS
- Kernel version: 5.15.0-46-generic

How did you install fluent operator?

kubectl create ns fluent 
kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/release-2.0/manifests/setup/setup.yaml

Additional context

Proposed solution: create an ordered configuration file based on @id, name and tag

antrema commented 7 months ago

I will propose a PR to correct this behaviour

benjaminhuo commented 7 months ago

I will propose a PR to correct this behaviour

That's great!