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 4048e5cc0a.
Dustin 2023-10-04 20:48:14 -05:00
parent 5862ff4cc2
commit b5455e519a
2 changed files with 17 additions and 30 deletions

View File

@ -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

View File

@ -1,13 +1,22 @@
variant: fcos variant: fcos
version: 1.4.0 version: 1.4.0
ignition:
config:
merge:
- local: packages.yaml
storage: storage:
files: files:
- path: /etc/containers/systemd/collectd.container - path: /etc/ignition/packages.d/collectd
mode: 0644 mode: 0644
contents: contents:
local: collectd.container inline: |
collectd
collectd-chrony
collectd-disk
collectd-sensors
collectd-write_prometheus
- path: /etc/collectd.d/df.conf - path: /etc/collectd.d/df.conf
mode: 0644 mode: 0644
contents: contents:
@ -18,7 +27,6 @@ storage:
FSType overlay FSType overlay
IgnoreSelected true IgnoreSelected true
</Plugin> </Plugin>
- path: /etc/collectd.d/plugins.conf - path: /etc/collectd.d/plugins.conf
mode: 0644 mode: 0644
contents: contents:
@ -42,3 +50,8 @@ storage:
<Plugin write_prometheus> <Plugin write_prometheus>
Port 9103 Port 9103
</Plugin> </Plugin>
systemd:
units:
- name: collectd.service
enabled: true