-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kube-prometheus-stack] node-exporter crashes at startup #467
Comments
I have the same issue, running a k3s v1.18 cluster on Linux (Alpine) if that helps rule anything out. |
I have the this issue also on Docker Desktop for Mac 3.0.0 |
Same issue on Docker for Windows.
|
Same issue in docker for windows ( Using Hyper-V backend ) with Kubernetes v1.19.3 and Helm v3.4.1. |
The same issue with Docker Desktop for Mac v.3. |
Same issue using Docker Desktop for windows 10 on WSL2 |
Facing the same issue using Docker Desktop for windows 10. DockerEngine Version: 20.10.2 |
+1 |
+1 |
+1 for Docker Desktop for Windows 10 (Pro, version 2004) on WSL2 |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
Please stop the "+1". Alternatively you just could add a thumbs up via the smiley function. |
Same issue for me, this + another one Prometheus is exporting nothing, kube-state-metrics if i port forward has some metrics, but querying prometheus is totally empty, node exporter broken |
@monotek what is the alternate to make it work? |
Not always possible to mount / from host, see issue prometheus-community#467
Not always possible to mount / from host, see issue prometheus-community#467 Signed-off-by: William Johansson <[email protected]>
I had the same issue and as a workaround, I removed the mountPropagation to use the kubectl patch ds monitoring-prometheus-node-exporter --type "json" -p '[{"op": "remove", "path" : "/spec/template/spec/containers/0/volumeMounts/2/mountPropagation"}]' |
* [prometheus] make path.rootfs condition Not always possible to mount / from host, see issue #467 Signed-off-by: William Johansson <[email protected]> * [prometheus] bump minor version Signed-off-by: William Johansson <[email protected]> * [prometheus] bump minor version Signed-off-by: William Johansson <[email protected]> Co-authored-by: André Bauer <[email protected]>
@monotek I think this issue is not solved. It was opened for The changes made to the Let me know if I'm correct, I will create a pull request myself if needed. |
I think this was automatically closed because the pr #737 was merged and this issue was mentioned... |
you don't have to copy the whole with below way, you can fix the problem easily
|
I had to do the following to get it to work in my
|
had to do the following to get it to work with my helm install command for Docker-Desktop for Mac:
|
Thanks a lot, this worked. |
…rter Refer to prometheus-community/helm-charts@201e9e8, https://github.com/prometheus-community/helm-charts/blob/prometheus-node-exporter-1.17.0/charts/kube-prometheus-stack/Chart.yaml 14.7.1 is the lowerest version that supports hostRootFsMount. Without the option to set hostRootFsMount as false, the node-exporter would crash in some cases, refer to https://github.com/prometheus-community/helm-charts/issues/467\#issuecomment-802642666.
…rter Refer to prometheus-community/helm-charts@201e9e8, https://github.com/prometheus-community/helm-charts/blob/prometheus-node-exporter-1.17.0/charts/kube-prometheus-stack/Chart.yaml 14.7.1 is the lowerest version that supports hostRootFsMount. Without the option to set hostRootFsMount as false, the node-exporter would crash in some cases, refer to prometheus-community/helm-charts#467.
Refer to prometheus-community/helm-charts@201e9e8, https://github.com/prometheus-community/helm-charts/blob/prometheus-node-exporter-1.17.0/charts/kube-prometheus-stack/Chart.yaml 14.7.1 is the lowerest version that supports hostRootFsMount. Without the option to set hostRootFsMount as false, the node-exporter would crash in some cases, refer to prometheus-community/helm-charts#467.
helm install {Name} prometheus-community/kube-prometheus-stack --set prometheus-node-exporter.hostRootFsMount.enabled=false |
For those using the kube-prometheus-stack where prometheus-node-exporter is a dependency, you need to add this change to the prometheus-node-exporter values file and not the kube-prometheus-stack values file. Change the enabled value to false:
|
PS C:\Users\do> kubectl patch ds monitoring-prometheus-node-exporter --type "json" -p '[{"op": "remove", "path" : "/spec/template/spec/containers/0/volumeMounts/2/mountPropagation"}]' |
@doublespaces thanks your comment I could add those values. |
@puitiza thanks for solution it works for me just updating the values. |
The prometheus-node-exporter is version 4 now, you can use the prometheus-node-exporter:
hostRootFsMount:
enabled: false |
I found another way. Because My error was another folder, But the solution was the same. if your error is OS [Shell Command]: else if your error is OS [Shell Command]: But I haven't been able to confirm that it works even after rebooting. |
In a k3s cluster on wls2 this method solved the problem for me! |
Worked for me in a proxmox container (Ubuntu 18.04.6). |
Thanks. this worked for me, added it my command helm upgrade --install prometheus prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace \
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set prometheus-node-exporter.hostRootFsMount.enabled=false \
--set prometheus-node-exporter.hostRootFsMount.mountPropagation='HostToContainer' \ |
I solved using: helm install prometheus prometheus-community/kube-prometheus-stack --set prometheus-node-exporter.hostRootFsMount.enabled=false |
- Main examples: - https://github.com/oijkn/Docker-Raspberry-PI-Monitoring/blob/main/docker-compose.yml#L46-L65 - https://github.com/prometheus/node_exporter/tree/f35a592dd65d6b3488426a789b328c8ca5b2bc22?tab=readme-ov-file#docker - https://theawesomegarage.com/blog/monitor-your-raspberry-pi-with-prometheus-and-grafana - I attempted to use `network_mode: host` as in the node_exporter README example, but then I needed to add `extra_hosts: ["host.docker.internal:host-gateway"]` to the prometheus service and `- targets: ['host.docker.internal:9100']` to prometheus.yml as recommended by https://stackoverflow.com/a/66689508 but the connection was always refused - Additionally, I think this would have exposed the :9100/metrics endpoint publicly - The downside of not using `network_mode: host` is that the network metrics only include network traffic that goes through the docker container, and not the node itself. This should be fine though, since theoretically all network traffic that isn't admin-related (i.e. me) should go through the docker containers - I needed to remove rslave from `/:/host:ro,rslave` or else `dc up` failed on mac. - https://docs.docker.com/engine/storage/bind-mounts/#configure-bind-propagation - prometheus/node_exporter#2002 - prometheus-community/helm-charts#467 - prometheus/node_exporter#610 (comment)
Describe the bug
Node exporter pod underlying container fails to startup. This is the error reported by the deamon:
Error: failed to start container "node-exporter": Error response from daemon: path / is mounted on / but it is not a shared or slave mount
This error is related to #325 and it appears to be caused by this pull request. I've create this issue as suggested by @monotek in #80 (comment) (it appears that the original reporter of this issue has not created a new issue).
Moreover, I've tried to change kube-prometheus-stack chart manually to revert the commit above and I am able to deploy the chart without any error.
I am using
docker-desktop
(v2.5.0.1) on Windows 10 1909 and I have enabled Kubernetes cluster from it.I'm not sure if this error is caused by
docker-desktop
, in any case, if it does not happen in other type of clusters, I would suggest to make the mount rootfs mountPropagation configurable via the chart values (and maybe enable it by default if you think it should not be optional) to prevent this error.Another (better) solution would be to mount / as shared, but I've not found a way to do it.
Version of Helm and Kubernetes:
Helm Version:
version.BuildInfo{Version:"v3.4.1", GitCommit:"c4e74854886b2efe3321e185578e6db9be0a6e29", GitTreeState:"clean", GoVersion:"go1.14.11"}
Kubernetes Version:
Which chart: kube-prometheus-stack
Which version of the chart: 12.7.0
What happened: node-exporter pod fails to startup
What you expected to happen: node-exporter should not fail
How to reproduce it:
No additional change in values.yaml file to reproduce.
The helm command that you execute and failing/misfunctioning:
helm install prom-stack prometheus-community/kube-prometheus-stack --version v12.7.0 -n monitoring
The text was updated successfully, but these errors were encountered: