fluent-operator icon indicating copy to clipboard operation
fluent-operator copied to clipboard

bug: inconsistent behaviour for setting FluentBit labels and annotations

Open jjsiv opened this issue 1 year ago • 1 comments

Describe the issue

Setting FluentBit.Spec.Labels will set labels on both the DaemonSet and the pods. Setting FluentBit.Spec.Annotations will set annotations only on the pods.

To Reproduce

Create a FluentBit resource with both labels and annotations

Expected behavior

Consistent behaviour for both of the options. Perhaps annotations should as well set the annotations on both the Daemonset and pods

Your Environment

- Fluent Operator version:
- Container Runtime:
- Operating system:
- Kernel version:

How did you install fluent operator?

No response

Additional context

Maybe append fb.Annotations and fb.Spec.Annotations and then set? https://github.com/fluent/fluent-operator/blob/master/pkg/operator/daemonset.go#L36

jjsiv avatar Nov 29 '24 18:11 jjsiv

Adding to this fluent-bit labels inconsistency behavior: When no labels are set, fluent-bit pods use the CR labels. That means that pods get tagged with app.kubernetes.io/name: fluent-bit, because the CR is tagged that way. However, if a custom label is provided via .Values.fluentbit.labels, the app.kubernetes.io/name label is no longer automatically added.

We found this the hard way, as we used that label for a network policy.

This also happens for the app.kubernetes.io/managed-by: Helm label, which may change how the chart behaves depending on whether a custom label is in place or not.

ddl-martin-currao avatar Oct 14 '25 16:10 ddl-martin-currao