Does watchedNamespaces support regex
Describe the issue
I want to use ClusterFluentdConfig to collect all logs of the cluster except logging namespace. And use FluentdConfig in logging namespace to collect the namespace logs. If I have many namespaces and they are updated frequently, watchedNamespaces also need to be updated synchronously, which will be very troublesome. Is there any other good way?
such as:
ClusterFluentdConfig-> all namespace expect logging namespace-> ClusterOutput -> es(all)
FluentdConfig -> logging namespace-> output -> es(other)
How did you install fluent operator?
helm upgrade --install --wait --create-namespace --namespace logging -f fluent-values.yaml fluent-operator fluent-operator
the fluent-values.yaml
fluentd:
enable: true
name: fluentd
port: 24224
image:
repository: "kubesphere/fluentd"
tag: "v1.15.3-arm64"
replicas: 1
forward:
port: 24224
watchedNamespaces:
- kube-system
- default
- monitoring
resources:
limits:
cpu: 1
memory: 1024Mi
requests:
cpu: 100m
memory: 128Mi
Additional context
No response
Here, if set, logs will be collected for all namespaces that are set. If not set, the entire cluster logs will be collected. https://github.com/fluent/fluent-operator/blob/master/pkg/fluentd/router/route.go#L54
It's a good idea to maybe add a parameter to exclude some namespaces. nonWatchNamespace?
If I have many namespaces and they are updated frequently, watchedNamespaces also need to be updated synchronously, which will be very troublesome. Is there any other good way?
Fluent Operator uses https://github.com/kube-logging/fluent-plugin-label-router to control the namespaces selection, it's possible to exclude some namespaces by this plugin:

It'll be great if you can create a proposal and a following PR for this @tanmx
nonWatchNamespace
It would be a great feature to have.