-
Notifications
You must be signed in to change notification settings - Fork 191
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
Support host prefix for apt_info.py #171
base: master
Are you sure you want to change the base?
Conversation
This looks to me like more of a job for chroot. |
@dswarbrick Why? python3-prometheus-client python3-apt dependencies are installed only in the container |
What advantage does running this script in Docker actually bring you? It seems like an unnecessarily complicated setup. Assuming it's a Debian or Ubuntu host, these scripts are packaged as prometheus-node-exporter-collectors - complete with systemd service to run it periodically. |
Ok, I will try a different approach... There are people ( https://unix.stackexchange.com/questions/261165/change-cache-location-path-for-apt ) having apt dir elsewhere than in the default path, this PR will allow supporting different apt-cache paths. |
I can understand the motivation to support a non-standard apt cache location, and would accept that being implemented via a command-line option. I still don't understand your motivation to run this script in a container, considering the hoops that you have to jump through in order to make it work. It is designed to operate on the host's apt cache, and can run as an unprivileged user. Why do you feel the need to sandbox it in a container? If you are really determined to run this script in a container, maybe mapping the host's entire rootfs to |
I would also like to see this feature implemented. I'm running my node exporter via Kube Prometheus Stack directly inside Kubernetes. Including all other monitoring related stuff. So my nodes already have the the root file system mounted to other node exporter containers. Therefore I don't want to do a two-pronged approach and install this script directly on the node. |
I've implemented this via command-line option: #178 |
@lukasmrtvy I've created an exporter using my changes of the PR #178. |
this PR should be closed. |
This will allow to run apt_info.py on the host from the container. ``` docker run --rm -it --entrypoint bash -v "/:/hostfs" ubuntu:22.04 -c 'apt update && apt install -y python3-prometheus-client python3-apt curl && curl https://raw.githubusercontent.com/prometheus-community/node-exporter-textfile-collector-scripts/master/apt_info.py -o /tmp/apt_info.py && python3 /tmp/apt_info.py' ``` Signed-off-by: Lukas M <[email protected]>
Signed-off-by: Lukas M <[email protected]>
This will allow us to run apt_info.py on the host from the container.