prometheus / node_exporter

Exporter for machine metrics

Home Page:https://prometheus.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running node-exporter on Kubernetes without Root Privileges

metbog opened this issue · comments

Are you running node_exporter in Docker?

kubernetes, docker

What did you do that produced an error?

We use node-exporter on Kubernetes (k8s) to monitor /dev/mapper devices. Unfortunately, node-exporter can only retrieve information about a device when it is running with root privileges, as indicated by the following securityContext configuration:

securityContext:
    runAsUser: 0

Without this configuration, we encounter the 'node_filesystem_device_error' with details like the device path, file system type (fstype), and mount point:

node_filesystem_device_error{device="/dev/mapper/3624a937010ed65ee4214591800042af7", fstype="ext4", mountpoint="/var/lib/kubelet/pods/7adbc046-d10e-41e7-b64a-774047217cd2/volumes/kubernetes.io~portworx-volume/pvc-3322b508-d83d-4f11-a570-30f606bdb53a"} 1

However, for security reasons, we want to avoid running node-exporter as the root user. Is there a possible solution to address this security concern?

For questions/help/support please use our community channels. There are more people available to potentially respond to your request and the whole community can benefit from the answers provided.