Skip to main content

Herr Ober

PyPI version Python 3.12+ License: MIT Tests codecov

High-Performance S3 Ingress Controller (BGP/ECMP or VRRP)

Herr Ober ("Head Waiter") is a lightweight, high-throughput (50GB/s+) ingress controller designed for Ceph RGW clusters. It uses HAProxy 3.3 (the Ubuntu PPA and distro builds use OpenSSL; ober doctor shows the TLS library) for SSL offloading with two HA modes:

  • BGP/ECMP Mode - Uses ExaBGP for Layer 3 HA via BGP (requires BGP-capable router)
  • Keepalived Mode - Uses VRRP for VIP failover (no BGP required)

Supported: Ubuntu, Debian, RHEL 10+ on Proxmox VMs (KVM), and Amazon Linux 2027 on EC2


Documentation

For deep internals, kernel tuning, and failure recovery logic, see architecture.md. For Proxmox host and VM setup (SR-IOV, hugepages, CPU priority, BIOS), see docs/proxmox-deployment.md.


Quick Start

1. Proxmox VM Prerequisites

Before installing, configure the VM for high throughput:

  • CPU: type host (passes AES-NI/VAES through to HAProxy's TLS code).
  • Network: SR-IOV VFs passed through to the VM. VirtIO with multiqueue (queues = vCPUs) is a fallback that tops out at tens of Gbit/s.
  • Memory: fixed size, ballooning off, 1G hugepages.
  • Hardware watchdog: add device Intel 6300ESB with action Reset.

For host BIOS and kernel settings, a full VM config and a verification checklist, see docs/proxmox-deployment.md.

2. Install

One-liner (recommended): use a release tag (see releases), not main, so you run a reviewed script. The script installs the newest herr-ober from PyPI.

OBER_TAG=v0.4.0
curl -fsSL "https://raw.githubusercontent.com/dirkpetersen/herr-ober/$OBER_TAG/install.sh" | sudo bash
sudo ober bootstrap

Manual install:

sudo su -
apt install -y pipx
# Install globally (outside /root): the systemd units use ProtectHome=true
export PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin
pipx install 'herr-ober[bgp]'   # [bgp] pins ExaBGP to the tested 4.2.x series
ober bootstrap

The one-liner also writes /etc/profile.d/herr-ober.sh, which exports PIPX_HOME and PIPX_BIN_DIR, so a later pipx upgrade herr-ober in a new root shell finds the global install.

Amazon Linux 2027: there is no pipx package, so the one-liner installs pipx into its own venv at /opt/pipx-tool and then works as on the other systems. You can also install into a plain venv outside /root and /home (as lab/aws/deploy.sh does):

sudo python3 -m venv /opt/herr-ober
sudo /opt/herr-ober/bin/pip install 'herr-ober[bgp]'
sudo ln -sf /opt/herr-ober/bin/ober /usr/local/bin/ober
sudo ober bootstrap

Amazon Linux has no NetworkManager, so in BGP mode ober config puts the VIPs on lo-vip with systemd-networkd (/etc/systemd/network/60-lo-vip.{netdev,network}). These files match only lo-vip; the ENI configuration of amazon-ec2-net-utils is not changed.

Upgrading from v0.3.0 or earlier: re-run the one-liner. The old install lived under /root/.local/pipx; the installer prints how to keep it (sudo ober bootstrap /root/.local/pipx/venvs/herr-ober) or copy its etc/ to /opt/pipx/venvs/herr-ober/etc. Because the hostlist dependency was replaced by python-hostlist, reinstall into a clean venv so that no stale hostlist package stays:

PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx reinstall herr-ober
sudo ober upgrade   # installs ExaBGP again if the reinstall removed it, and rewrites the units

3. Configure

Interactive wizard to select HA mode (BGP or Keepalived) and configure VIPs, backends, and certificates.

sudo ober config

Note: Choose BGP mode if you have a BGP-capable router for ECMP load balancing. Choose Keepalived mode for VRRP-based failover without BGP.

4. Verify

# Check prerequisites and configuration
ober doctor

# View service status
ober status

Example: Keepalived Mode Setup

For a 3-node keepalived cluster without BGP:

Node 1:

sudo ober bootstrap
sudo ober config
# Select: Keepalived/VRRP mode
# Peers: 10.0.0.2,10.0.0.3 (IP addresses, not hostnames)
# VIPs: 192.168.1.100,192.168.1.101,192.168.1.102 (one per node)
sudo ober start

Node 2 & 3: Repeat the same steps with appropriate peer IPs.

By default the md5 of each VIP picks its owner node (priority 100, the others 90), so the split can be uneven. To place each VIP on a known node, set owner (an IP from local_ip and keepalived.peers) in ober.yaml:

vips:
  - {address: 192.168.1.100, owner: 10.0.0.1}
  - {address: 192.168.1.101, owner: 10.0.0.2}
  - {address: 192.168.1.102, owner: 10.0.0.3}

An owner that is not a cluster node is an error. In BGP mode owner is ignored (a warning). A failing node loses its VIPs in a few seconds. A started owner waits 30 s (vrrp_startup_delay), and an owner with recovered health 30 s (rise), before it takes its VIP back.

DNS Round-Robin:

s3.example.com  IN  A  192.168.1.100
s3.example.com  IN  A  192.168.1.101
s3.example.com  IN  A  192.168.1.102

Usage

CLI Commands

ober bootstrap [path]     # Install and set up everything (--firewall: enable ufw/firewalld)
ober config [--dry-run]   # Interactive configuration wizard (choose BGP or Keepalived mode)
ober config --non-interactive  # Validate ober.yaml and render all configs, no prompts
ober status               # Show current state (--json for scripting)
ober metrics [--output F] # Node state for Prometheus (deploy/prometheus/alerts.yml)
ober cluster status       # All nodes over SSH: VIP placement, drift (set nodes: in ober.yaml)
ober apply [-f FILE|-]    # Apply ober.yaml: diff, check, reload, health gate, auto roll back
ober push                 # ober apply on the other nodes, one at a time; stops at a failure
ober rollback [--list]    # Go back to the state before the last apply
ober cert install PEM [--all-nodes]  # Check cert+key, swap into HAProxy without reload
ober backend list|drain|maint|ready <server> [--all-nodes]  # RGW servers (this node or all)
ober start|stop|restart   # Service management (stop gracefully withdraws routes/releases VIPs)
                          # restart = validated zero-downtime reload; restart --hard = full restart
ober logs [-f] [-n N]     # View logs (--service http|bgp|ha|all to filter)
ober doctor               # Diagnostic checks
ober test                 # Test BGP connectivity without starting services
ober upgrade              # Re-render units, install HAProxy/ExaBGP updates (see Rolling upgrade)
ober uninstall            # Clean removal

Editing ober.yaml directly

Every wizard prompt is prefilled from ober.yaml, so pressing Enter keeps a value. You can also edit the file and apply it without prompts:

sudo ober config --dry-run          # validate and show a summary (works without a TTY)
sudo ober config --non-interactive  # validate and render haproxy.cfg and the HA config

ober config, ober start and ober test refuse an invalid ober.yaml and list every problem. ober stop, ober status and ober logs still work. local_ip sets this node's IP for keepalived unicast_src_ip and the BGP router-id/local-address when the default route uses another NIC.

One ober.yaml for the whole cluster

Values that must differ between nodes go in ober.local.yaml next to ober.yaml on each node. Its keys override ober.yaml, and ober config saves them back there:

# etc/ober.local.yaml on node ober2
local_ip: 10.0.0.2
bgp:
  router_id: 10.0.0.2

Then ober.yaml is the same on every node. List the nodes once (nodes: [ober1, ober2, ober3]), apply on one node, and push to the others:

sudo ober apply              # this node first
sudo ober push               # ssh NODE sudo -n ober apply -f - on each other node, one at a time
sudo ober cluster status     # VIP placement and config drift over all nodes

ober push refuses an ober.yaml that sets local_ip, bgp.router_id or bgp.local_address, and stops at the first node that fails its check or health gate. That node puts its old files back. Certificates are not copied. The SSH user needs a key without a prompt and sudo -n ober on each node. SSH runs with BatchMode=yes, so the host keys must already be in root's known_hosts (or set StrictHostKeyChecking accept-new for the node addresses).

Metrics and alerts

HAProxy serves request and backend metrics on :8404/metrics. ober metrics adds what HAProxy does not know: VIP announced or VRRP MASTER, VIP present, maintenance, backend servers UP, certificate expiry, the config hash and the versions. Write it for the node_exporter textfile collector every minute, for example from root's crontab:

* * * * * /usr/local/bin/ober metrics --output /var/lib/node_exporter/textfile/ober.prom

deploy/prometheus/alerts.yml has the alert rules: a VIP on no node or MASTER on two nodes, a node healthy but not announcing, backends down, certificate under 21 days, and config or version drift between nodes. Test them with promtool test rules deploy/prometheus/alerts_test.yml.

ober sync is deprecated: the files it wrote were never read. Use bgp.neighbors or keepalived.peers, security.internal_networks or security.allowlist, and backends[].servers in ober.yaml.

Certificates

Use one issuer for the whole cluster, not one per node: behind ECMP or DNS round-robin a per-node HTTP-01 challenge can land on the wrong node. The files in deploy/lego/ run lego with the DNS-01 challenge on one node (or an admin host that can SSH to all nodes):

  • DNS-01 proves the domain with a DNS TXT record, so no node opens port 80.
  • The certificate covers s3.example.com and *.s3.example.com. The wildcard is needed for virtual-host buckets (bucket.s3.example.com). ober cert install warns without it.
  • After each new certificate, lego runs ober-lego-hook. The hook joins the certificate and key into one PEM and pipes it to ober cert install --all-nodes [--name NAME] -, which checks it and swaps it into HAProxy on every node without a reload.
sudo install -m 755 deploy/lego/ober-lego-hook /usr/local/bin/
sudo install -m 600 deploy/lego/ober-lego.env /etc/ober/lego.env    # then edit: DNS token
sudo install -m 644 deploy/lego/ober-lego.service deploy/lego/ober-lego.timer /etc/systemd/system/
sudo systemctl start ober-lego.service       # first certificate, check the journal
sudo systemctl enable --now ober-lego.timer  # checks twice a day, renews when due

The DNS API token stays in /etc/ober/lego.env (mode 600), never in ober.yaml. The unit is written for lego v5 (lego run --deploy-hook); lego v4 uses renew --renew-hook, and the hook reads the environment variables of both. The unit runs as root, so root needs an SSH key for the other nodes and sudo -n ober there (as for ober push).

If the hook fails, lego keeps the new certificate in /var/lib/lego/certificates/ and does not run the hook again until the next renewal. Run the hook by hand or use ober cert install. Expiry is visible early: ober status warns under 21 days and is critical under 7, and ober metrics exports ober_cert_remaining_seconds, which fires the OberCertExpiresSoon alert in deploy/prometheus/alerts.yml under 21 days.

Rolling upgrade

Upgrade one node at a time. There is no single command for this. On each node:

  1. sudo ober cluster status must exit 0 (OK) before you start.
  2. sudo ober maintenance on. Wait until sudo ober maintenance status shows no announced routes (BGP) or no MASTER state (keepalived), so the traffic has moved to the other nodes.
  3. As root: PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx upgrade herr-ober (or pip install -U herr-ober in the venv).
  4. sudo ober upgrade. It re-renders the systemd units and offers HAProxy and ExaBGP updates. If it says ober-http.service changed, or it installed a new ExaBGP, run sudo ober restart --hard now, while the node has no traffic.
  5. sudo ober doctor must show no failures.
  6. sudo ober maintenance off.
  7. Wait until sudo ober cluster status exits 0 again, then go to the next node.

BGP mode: the health process that ExaBGP started keeps running the old code until ExaBGP restarts. A health process from an ober version without SIGHUP support dies on the SIGHUP that ober apply, ober rollback and ober push send, and ExaBGP starts it again with the new code. To avoid this while the node has traffic, run sudo ober restart --hard in step 4 also in BGP mode.

Host firewall

ober bootstrap changes no firewall unless you add --firewall. With it, bootstrap allows the SSH port(s) from sshd -T first, then 443/tcp and VRRP, and then enables ufw (Debian/Ubuntu) or firewalld (RHEL). When the firewall is already active, bootstrap adds only 443/tcp and VRRP and keeps your SSH rules. If sshd -T fails, bootstrap stops before it changes the firewall. All rules are persistent. Port 80, BGP and the stats port are not opened. Bootstrap also raises nf_conntrack_max to 1048576, because a stateful firewall tracks every client and RGW connection.

Checking Health

# Full status with systemd service info
ober status

# JSON output for monitoring integration
ober status --json

# Direct health endpoint
curl http://127.0.0.1:8404/health

Failure & Recovery

BGP/ECMP Mode

Event Recovery
Node Crash Traffic fails over via ECMP (instant)
OS Freeze Proxmox Watchdog hard-resets VM (10s)
HAProxy Crash BGP withdraws immediately (BindsTo=)
Network Cut BGP hold timer expires and the router removes the route (3s default hold-time)

Keepalived Mode

Event Recovery
Node Crash VIP fails over to backup node (instant)
OS Freeze Proxmox Watchdog resets VM, VRRP timeout triggers failover (3-10s)
HAProxy Crash Health check fails, priority drops, VIP fails over (4-6s)
Keepalived Crash VRRP advertisements stop, VIP fails over (3s)
Network Partition Risk of split-brain (both nodes may claim VIP)

See architecture.md for detailed failure scenarios.


Security Monitoring

For internet-exposed S3 endpoints, ober watch analyzes HAProxy logs off the data path, can push proxy-side blocklists, and forwards findings (never raw logs) to Microsoft Sentinel and, optionally, Defender for Endpoint.

Key points: trusted_networks are exempt from all automatic blocking and limits (put a shared campus NAT range in both allowlist and trusted_networks); auto-ban counts only signed 401/403 responses, unsigned failures use a separate higher threshold (autoban_unsigned_failures); automatic blocks apply only to single IPs seen on Internet VIPs. List the proxy nodes in watch.syslog_allowed_sources, bind ober watch to a management network and firewall 5514/udp and 8405/tcp (UDP syslog is unauthenticated). OBER_WATCH_TOKEN grants read access, OBER_WATCH_ADMIN_TOKEN is needed for blocklist add/remove. Upgrading from earlier versions: the frontend s3_front became s3_internal / s3_internet (update dashboards), and ober config installs a systemd drop-in for /run/ober. Known limits: stick tables are per node (with ECMP the effective threshold is N times the limit) and rejected connections are not logged. See docs/security-monitoring.md and deploy/sentinel/README.md.


Development

# Clone and install dev dependencies
git clone https://github.com/dirkpetersen/herr-ober.git
cd ober
pip install -e ".[dev]"

# Run tests
pytest

# Lint and format
ruff check .
ruff format .

# Type check
mypy ober/

License

MIT

Metadata

Release files for herr-ober 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for herr-ober 0.4.0
File Size Uploaded Provenance Actions
herr_ober-0.4.0.tar.gz 207.9 kB With provenance Details for herr_ober-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for herr-ober 0.4.0
File Interpreter ABI Platform Actions
herr_ober-0.4.0-py3-none-any.whl Python 3 none any Details for herr_ober-0.4.0-py3-none-any.whl

Total release size: 349.3 kB

Release files / herr_ober-0.4.0.tar.gz

Download URL herr_ober-0.4.0.tar.gz
Size 207.9 kB
Tags Source
SHA-256 checksum
How to use checksums
edd339a8096e769b83449d476b4ebef76728a069669a324fdbed0f555e61dc1b
BLAKE2b-256 checksum
How to use checksums
76d8cc6e2dae0c1d9363bffba606778dad8a7edae47154c06c3f1ad7c55a3690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / herr_ober-0.4.0-py3-none-any.whl

Download URL herr_ober-0.4.0-py3-none-any.whl
Size 141.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3b0b2c0ad0882f02c3ae2cf2bd619f6b2ca3d150778f6f06adb643ab43896c2
BLAKE2b-256 checksum
How to use checksums
255aecb823181268036cb7e01b0f6aaca83c7a6efca31f1c2a2eaa3622f0f5d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for herr-ober 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for herr_ober-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page