From b5455e519a3c716783087a82e3a8d290af901029 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 4 Oct 2023 20:48:14 -0500 Subject: [PATCH] Revert "collectd: Run collectd in privileged container" Unfortunately, running *collectd* in a container is not going to work. Although containers can be configured to share some of the host's namespaces, one notable exception is the mount namespace. Naturally, containers must have their own mount namespace, which prevents them from seeing filesystems that are actually mounted on the host. For *collectd*, this effectively makes the `df` plugin useless, which ultimately prevents us from monitoring disk space. This reverts commit 4048e5cc0ade387e272ed0b3d9d14e68d79d6b37. --- collectd.container | 26 -------------------------- collectd.yaml | 21 +++++++++++++++++---- 2 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 collectd.container diff --git a/collectd.container b/collectd.container deleted file mode 100644 index 44333aa..0000000 --- a/collectd.container +++ /dev/null @@ -1,26 +0,0 @@ -# vim: set ft=systemd : -[Unit] -Description=Collectd statistics daemon -After=network.target -Wants=network.target - -[Container] -Image=git.pyrocufflink.net/containerimages/collectd:latest -Volume=/etc/collectd.d:/etc/collectd.d:ro -Volume=/run:/run:rw -Tmpfs=/tmp -Network=host -SecurityLabelDisable=true -PodmanArgs=--privileged -PodmanArgs=--ipc=host -PodmanArgs=--uts=host -PodmanArgs=--pid=host -PodmanArgs=--cgroupns=host - -[Service] -Restart=always -StartLimitIntervalSec=10s -StartLimitBurst=10 - -[Install] -WantedBy=multi-user.target diff --git a/collectd.yaml b/collectd.yaml index 4c3cbd6..8ed3177 100644 --- a/collectd.yaml +++ b/collectd.yaml @@ -1,13 +1,22 @@ variant: fcos version: 1.4.0 +ignition: + config: + merge: + - local: packages.yaml + storage: files: - - path: /etc/containers/systemd/collectd.container + - path: /etc/ignition/packages.d/collectd mode: 0644 contents: - local: collectd.container - + inline: | + collectd + collectd-chrony + collectd-disk + collectd-sensors + collectd-write_prometheus - path: /etc/collectd.d/df.conf mode: 0644 contents: @@ -18,7 +27,6 @@ storage: FSType overlay IgnoreSelected true - - path: /etc/collectd.d/plugins.conf mode: 0644 contents: @@ -42,3 +50,8 @@ storage: Port 9103 + +systemd: + units: + - name: collectd.service + enabled: true