githubEdit

Docker on Bare Metal

This guide covers deploying Mermin as a Docker container on bare metal or virtual machines without Kubernetes. This is useful for monitoring standalone Linux hosts or environments where Kubernetes is not available.

circle-exclamation

Prerequisites

Before deploying on bare metal:

  • Linux OS: RHEL/CentOS 7+, Ubuntu 18.04+, Debian 10+, or similar

  • Linux Kernel: Version 4.18 or newer with eBPF support

  • Docker: Version 19.03 or newer, or containerd/Podman as alternative

  • Root Access: Required to run privileged containers

  • Network Access: To OTLP collector endpoint

Verify eBPF Support

Check that your kernel supports eBPF:

# Check kernel version
uname -r
# Should be >= 4.18

# Verify CONFIG_BPF is enabled
grep CONFIG_BPF /boot/config-$(uname -r)
# Should show: CONFIG_BPF=y

# Check for BPF filesystem
mount | grep bpf
# Should show: bpffs on /sys/fs/bpf type bpf

If bpffs is not mounted:

Configuration

Create a Mermin configuration file optimized for bare metal:

Deployment with Docker

Pull the Image

Run Mermin Container

Run Mermin with necessary privileges and volume mounts:

Flags explained:

  • --privileged: Required for eBPF program loading

  • --network host: Access host network interfaces

  • --pid host: Access host process information (optional)

  • --cap-add: Explicit capabilities for eBPF and networking

  • -v /sys/kernel/debug: Debug filesystem for eBPF (read-only)

  • -v /sys/fs/bpf: BPF filesystem for program management

  • -v config.hcl: Mount configuration file

Verify Deployment

Check that the container is running:

View logs:

Check health:

Both should return ok.

Deployment with Systemd

For production deployments, use systemd to manage the container:

Create Systemd Service

Enable and Start Service

Deployment with Podman

Podman is a daemonless alternative to Docker:

Configuration for Bare Metal

Identifying Network Interfaces

List available interfaces:

Common interface naming:

  • Traditional: eth0, eth1

  • Predictable: ens32, eno1, enp0s3

  • Virtual: docker0, veth*, br-*

Update your configuration:

Multi-Host Deployments

Deploy Mermin on multiple hosts for fleet-wide observability:

Host 1:

Host 2:

Monitoring and Logs

View Real-Time Logs

Access Metrics

Log Rotation

Configure Docker log rotation in /etc/docker/daemon.json:

Restart Docker:

Limitations Compared to Kubernetes

Bare metal deployments have these limitations:

Feature
Kubernetes
Bare Metal

Pod Metadata

✅ Full

❌ Not Available

Service Mapping

✅ Yes

❌ No

Owner References

✅ Yes

❌ No

Network Policies

✅ Yes

❌ No

Auto-Discovery

✅ Informers

❌ Manual Config

Flow Traces

✅ Available

✅ Available

Protocol Analysis

✅ Available

✅ Available

Bare metal deployments capture raw network flows without Kubernetes context.

Use Cases for Bare Metal

Bare metal deployments are suitable for:

  • Non-Kubernetes Environments: Traditional VMs or physical servers

  • Host-Level Monitoring: Monitor host OS network activity

  • Hybrid Environments: Bridge Kubernetes and non-Kubernetes infrastructure

  • Edge Deployments: Lightweight observability at edge locations

  • Testing and Development: Quick setup for experimentation

Troubleshooting

Container Exits Immediately

Check logs for errors:

Common causes:

  • Missing configuration file

  • Invalid configuration syntax

  • Interface not found

"Operation not permitted" Errors

Ensure container has necessary privileges:

No Flow Traces

Check that interfaces exist:

Verify eBPF programs are loaded:

High CPU Usage

Reduce monitored interfaces:

Increase flow timeouts:

Updating Mermin

Docker

Systemd

Best Practices

  1. Always use systemd: For production deployments

  2. Configure log rotation: Prevent disk filling

  3. Monitor resource usage: Set up alerts on CPU/memory

  4. Use configuration management: Ansible, Puppet, or Chef for fleet deployments

  5. Secure OTLP connections: Use TLS and authentication

  6. Test configuration: Validate before rolling out to production

  7. Document host identifiers: Maintain inventory of monitored hosts

Next Steps

For Kubernetes deployments with full metadata enrichment, see Kubernetes with Helm.

Last updated