- name: hacluster-exporter
- description: This snap includes
ha_cluster_exporterto provide Pacemaker-based HA cluster statistics via Prometheus. The exporter inspects the local node on each scrape and exposes metrics for Pacemaker, Corosync, SBD, and DRBD when those components are available. - snapcraft: GitHub - canonical/hacluster-exporter-snap: Snap package for HA Cluster exporter · GitHub
- upstream: GitHub - ClusterLabs/ha_cluster_exporter: Prometheus exporter for Pacemaker based Linux HA clusters · GitHub
- upstream-relation: I am the publisher packaging this snap (via Canonical) for the open-source upstream project.
- supported-category: system monitoring/cluster management.
- reasoning: The
ha_cluster_exporteracts as a proxy for querying the host’s high-availability cluster state. To do this, it dynamically invokes several system-level administration tools directly, including/usr/sbin/crm_mon,/usr/sbin/corosync-cfgtool,/usr/sbin/sbd, and/sbin/drbdsetup. While we tested bundling these binaries understrictconfinement, we encountered two blockers:- Host IPC/Socket Communication: The bundled CLI tools (like
crm_monandcorosync-cfgtool) must communicate with the host’s running Pacemaker and Corosync daemons via dynamic IPC Unix sockets (e.g.,/var/run/crm/,/var/run/corosync/, etc.). AppArmor strictly denies this access, and hardcodingsystem-filesplugs for every possible cluster socket path is fragile. - Version Skew: Bundling the cluster tools inside the snap creates a dangerous version mismatch between the snap’s client binaries and the host’s server daemons. Cluster communication protocols often require the CLI tool and the running daemon to be on the same version. Classic confinement allows the exporter to invoke the host’s native tools directly, ensuring version parity and allowing IPC communication with the underlying cluster daemons.
- Shared Memory Access (
/dev/shm/): Pacemaker and Corosync rely heavily on shared memory (/dev/shm/) to store and communicate cluster state. The exporter (and the tools it invokes) requires broad access to this data to function. There is no existing snap interface that allows a confined snap to read the entirety of/dev/shm/. Existing interfaces require specifying exact, predictable paths or are restricted to snap-specific folders, which is incompatible with the dynamic nature of the host’s cluster shared memory.
- Host IPC/Socket Communication: The bundled CLI tools (like
I understand that strict confinement is generally preferred over classic.
I’ve tried the existing interfaces to make the snap to work under strict confinement.