I ran into the same issue - wanted to add the textfile.directory to the 
node_exporter using "extra_container_args" - and it failed just as you 
describe.  It appears that those args get applied to the container command 
(podman or docker) and not to the actual service in the container.  Not sure if 
that is intentional or not, but it would be nice to be able to add args to the 
process IN the container, especially for the node_exporter so that additional 
data can be collected.


________________________________
From: Lee Carney <lee.car...@globalrelay.net>
Sent: Thursday, October 27, 2022 10:27 AM
To: ceph-users@ceph.io <ceph-users@ceph.io>
Subject: [ceph-users] cephadm node-exporter extra_container_args for 
textfile_collector

Has anyone had success in using cephadm to add extra_container_args onto the 
node-exporter config? For example changing the collector config.


I am trying and failing using the following:


1. Create ne.yml

service_type: node-exporter
service_name: node-exporter
placement:
    host_pattern: '*'
extra_container_args:
    - --collector.textfile.directory=/var/lib/node_exporter/textfile_collector


2. cephadm shell --mount ne.yml:/var/lib/ceph/node-exporter/ne.yml

3. ceph orch apply -i '/var/lib/ceph/node-exporter/ne.yml'

4. Service will fail to start as the args have been applied at the beginning of 
the service config and not at the end..e.g.  cat 
/var/lib/ceph/a898358c-eeac-11ec-b707-0800279b70f1/node-exporter.node1-cceph1-vagrant-local1/unit.run

/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --init --name 
ceph-a898358c-eeac-11ec-b707-0800279b70f1-node-exporter-node1-cceph1-vagrant-local1
 --user 65534 --security-opt label=disable -d --log-driver journald 
--conmon-pidfile 
/run/ceph-a898358c-eeac-11ec-b707-0800279b70f1@node-exporter.node1-cceph1-vagrant-local1.service-pid
 --cidfile 
/run/ceph-a898358c-eeac-11ec-b707-0800279b70f1@node-exporter.node1-cceph1-vagrant-local1.service-cid
 --cgroups=split 
--collector.textfile.directory=/var/lib/node_exporter/textfile_collector -e 
CONTAINER_IMAGE=quay.io/prometheus/node-exporter:v1.3.1 -e 
NODE_NAME=node1-cceph1-vagrant-local1.dev-globalrelay.net -e 
CEPH_USE_RANDOM_NONCE=1 -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v 
/:/rootfs:ro quay.io/prometheus/node-exporter:v1.3.1 --no-collector.timex 
--web.listen-address=:9100 --path.procfs=/host/proc --path.sysfs=/host/sys 
--path.rootfs=/rootfs


Looking at the cephadm deployer I had expected the extra args to be added at 
the end: 
https://github.com/ceph/ceph/blob/c37bd103033bc0a9f05ec0e78cef7cbca5649eeb/src/cephadm/cephadm#L575
 and 
https://github.com/ceph/ceph/blob/c37bd103033bc0a9f05ec0e78cef7cbca5649eeb/src/cephadm/cephadm#L5761


_______________________________________________
ceph-users mailing list -- ceph-users@ceph.io
To unsubscribe send an email to ceph-users-le...@ceph.io
_______________________________________________
ceph-users mailing list -- ceph-users@ceph.io
To unsubscribe send an email to ceph-users-le...@ceph.io

Reply via email to