how to the prometheus outside of kubernetes need to monitor kube-prometheus node-exporter
my prometheus config
- job_name: "kube-node-exporter" static_configs: - targets: - "10.0.1.156:9100" - "10.0.1.155:9100" - "10.0.1.154:9100" - "10.0.1.153:9100" and node-exporter deployed by kube-prometheus,but my prometheus out of the k8s cluster cannot resive node-exporter data,how can i config this to resive data?

From the https://github.com/prometheus-operator/prometheus-operator/issues/4520.
“I see that node exporter runs on the host network by default: https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus-node-exporter/values.yaml#L98. I assume the reason is so that the exporter can discover information about all network interfaces on that node. Without host networking, it would only see the virtual interfaces of the container in which it runs.
If you need additional security in place, you can look into network policies and restrict which pods can scrape the metric endpoints. Maybe such a network policy should be created by default, but that's really an issue for the community helm charts repository.”
So the hostnetwork of node exporter is necessary.
Information for folks who find this issue in the future:
Kube-prometheus shipped from this repository runs node_exporter with kube-rbac-proxy as a sidecar and only authenticated requests are allowed. Additionally this project also ships NetworkPolicies for node_exporter. Both of those features are not present in helm chart project named kube-prometheus-stack.
This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.
This issue was closed because it has not had any activity in the last 120 days. Please reopen if you feel this is still valid.