[Metricbeat Autodiscover] Provider Kubernetes always creates watcher for namespaces and nodes #37179
Closed
3 tasks done
Labels
Team:Cloudnative-Monitoring
Label for the Cloud Native Monitoring team
Issue
add_resource_metadata
is enabled at all times for two resources,namespaces
andnodes
.There is an option to disable them (warning: hints should also be disabled, otherwise this will not work). For simplicity, I will only use namespace for this issue:
However, when creating the watcher, we don't check if it is enabled or not:
beats/libbeat/autodiscover/providers/kubernetes/pod.go
Line 110 in cc39376
And only later when it is time to add events, do we check for that:
beats/libbeat/autodiscover/providers/kubernetes/pod.go
Lines 160 to 163 in cc39376
The problem with this approach is that we always need to have permissions to list namespaces within the cluster scope, when we shouldn't force the user to have them. But if they don't, we always face the error:
We face this issue when resource is set to
pod
(default) andservice
.We also need to prevent namespace/node watchers from being created when using enrichers.
To complete
add_resource_metadata
orhints
are enabled:The text was updated successfully, but these errors were encountered: