diff --git a/jsonnet/kube-prometheus/components/node-exporter.libsonnet b/jsonnet/kube-prometheus/components/node-exporter.libsonnet index 50f1e52e0a78c1fecb53ee0428173b08ce4c18da..afdcf395bc2335e30bd5a4255f8ac228261f6f94 100644 --- a/jsonnet/kube-prometheus/components/node-exporter.libsonnet +++ b/jsonnet/kube-prometheus/components/node-exporter.libsonnet @@ -15,6 +15,10 @@ local defaults = { }, listenAddress:: '127.0.0.1', filesystemMountPointsExclude:: '^/(dev|proc|sys|run/k3s/containerd/.+|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)', + // NOTE: ignore veth network interface associated with containers. + // OVN renames veth.* to <rand-hex>@if<X> where X is /sys/class/net/<if>/ifindex + // thus [a-z0-9] regex below + ignoredNetworkDevices:: '^(veth.*|[a-f0-9]{15})$', port:: 9100, commonLabels:: { 'app.kubernetes.io/name': defaults.name, @@ -200,11 +204,8 @@ function(params) { '--no-collector.wifi', '--no-collector.hwmon', '--collector.filesystem.mount-points-exclude=' + ne._config.filesystemMountPointsExclude, - // NOTE: ignore veth network interface associated with containers. - // OVN renames veth.* to <rand-hex>@if<X> where X is /sys/class/net/<if>/ifindex - // thus [a-z0-9] regex below - '--collector.netclass.ignored-devices=^(veth.*|[a-f0-9]{15})$', - '--collector.netdev.device-exclude=^(veth.*|[a-f0-9]{15})$', + '--collector.netclass.ignored-devices=' + ne._config.ignoredNetworkDevices, + '--collector.netdev.device-exclude=' + ne._config.ignoredNetworkDevices, ], volumeMounts: [ { name: 'sys', mountPath: '/host/sys', mountPropagation: 'HostToContainer', readOnly: true },