homek8s/infrastructure/networking/rosenpass/rosenpass-metrics.service

23 lines
1,006 B
SYSTEMD
Raw Normal View History

[Unit]
Description=Rosenpass health metrics for node-exporter (textfile collector)
Documentation=file:///usr/local/sbin/rosenpass-metrics.sh
# No Requires=/After= on rosenpass.service or [email protected] on purpose:
# the recorder has to keep running and keep exporting while the unit it watches
# is dead or the interface is down — a hard dependency would take the metric
# away exactly when it becomes the alert.
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/rosenpass-metrics.sh
User=root
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
# /var/lib/rosenpass-exporter (hash state) is created by systemd.
StateDirectory=rosenpass-exporter
# The textfile dir is shared with the node-exporter DaemonSet (hostPath). It is
# created by the install step; the leading `-` keeps the unit startable if a
# node has lost it (the node-exporter DirectoryOrCreate recreates it), instead
# of failing the whole unit with 226/NAMESPACE.
ReadWritePaths=-/var/lib/node-exporter/textfile