wkulhanek / openshift-prometheus

Repository for all things related to Prometheus on OpenShift
51 stars 41 forks source link

node_exporter filesystem collector can not read /proc/1/mounts #22

Open omilun opened 5 years ago

omilun commented 5 years ago

Hello i am using the node-exporter and it can not collect filesystem metrics . Node-exporter log has an error :

level=error msg="ERROR: filesystem collector failed after 0.000074s: open /host/proc/1/mounts: permission denied" source="collector.go:132"

I don't have any problems with Node-exporter version 0.16 but new version (0.17) has this problem . Prometheus contributors solve this problem at latest version (0.18)

wkulhanek commented 5 years ago

@omilun I'm afraid I have no idea. I haven't used this repo in a while since Prometheus is now a part of OpenShift.

Are you running as a DaemonSet or natively?

omilun commented 5 years ago

Yes.I am using NodeExporter as a DaemonSet.

wkulhanek commented 5 years ago

Might be worthwhile trying a native deployment to ensure it's not something on the nodes rather the container.

wkulhanek commented 5 years ago

Can you try natively to see if this happens then, too? From a quick glance the hostpath mounts seem to give all necessary permissions.

omilun commented 5 years ago

I have solved this issue today. node exporter needs a SCC users and enable security context privilege to yaml file. for version 0.17+

wkulhanek commented 5 years ago

Great. Mind sending me a pull request to fix this, please?

omilun commented 5 years ago

I just realized that your node-exporter.yaml and setup.sh already had the fix (privileged SCC).

Doesn't enabling privileged have security implications?!

wkulhanek commented 5 years ago

It does. But of course there are use cases where it's necessary. That's why SCCs exist. And a Node Exporter without full access to the host doesn't make a lot of sense. So it's OK to do it here.