Inherit fluentbit kubernetes annotations from namespace
Is your feature request related to a problem? Please describe.
This relates to the Kubernetes filter. Currently users must set the annotation fluentbit.io/exclude: 'true' on pods to drop logs from their containers. To drop logs from all pods in a namespace, users need to set the annotation on all pods in the namespace.
Describe the solution you'd like
A common pattern is to set namespace-level annotations which then set default logic for pods in the namespace.
I'd like to set the fluentbit annotations at the namespace level. Applying a fluentbit annotation to a namespace would mean the pod inherits the fluentbit annotation (e.g. all logs would be dropped from the namespace).
Describe alternatives you've considered
One can use an Input filter exclude_path, but this is a bit clunky, since it creates a long list like exclude_path /var/log/containers/*_<namespace_1>*.log,/var/log/containers/*_<namespace_2>*.log,/var/log/containers/*_<namespace_3>*.log,... and involves rolling a config change to fluentbit pods.
Additional context
Semi-related to https://github.com/fluent/fluent-bit/issues/6544
This would be a great feature. As a workaround we have created a Kyverno ClusterPolicy that mutates every Pod and patches it with the annotation from the namespace. The namespace-level annotation is referenced as an external data variable via a K8s API call and then injected on each Pod in that namespace.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.
This issue was closed because it has been stalled for 5 days with no activity.
sad