Skip to content

ha-cluster: add HA cluster orchestration - #29137

Open
pgaufillet wants to merge 1 commit into
openwrt:masterfrom
pgaufillet:add-ha-cluster
Open

pgaufillet wants to merge 1 commit into
openwrt:masterfrom
pgaufillet:add-ha-cluster

Conversation

@pgaufillet

@pgaufillet pgaufillet commented Apr 12, 2026

Copy link
Copy Markdown

📦 Package Details

Maintainer: @pgaufillet

Description:
Add ha-cluster, a UCI-based orchestration package that coordinates keepalived (VRRP), owsync (config sync), and optionally lease-sync (DHCP sync) to provide high availability for OpenWrt routers.

Reads /etc/config/ha-cluster and generates flat configs for each managed service in /tmp/ha-cluster/. Manages lifecycle via procd.

Features:

  • Single UCI configuration for all HA services
  • Automatic keepalived.conf generation (VRRP instances, VIPs)
  • IPv4 + IPv6 dual-stack VRRP support
  • Unicast and multicast VRRP transport
  • Service takeover/release on VRRP state transitions
  • Startup validation (interface checks, DHCP prerequisites)

Shell-only package (PKGARCH:=all), ~1000 lines.
Depends on: keepalived. Recommends: owsync, lease-sync.

Part of the OpenWrt HA cluster proposal:

Source: files shipped in the package (no upstream repo).


🧪 Run Testing Details

  • OpenWrt Version: 24.10 and 25.12
  • OpenWrt Target/Subtarget: x86/64, mediatek/filogic
  • OpenWrt Device: Generic x86_64 VM, ASUS TUF Gaming AX4200

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread net/ha-cluster/files/ha-cluster.config Outdated
Comment thread net/ha-cluster/files/ha-cluster.sh Outdated
Comment thread net/ha-cluster/files/ha-cluster.sh Outdated
Comment thread net/ha-cluster/files/ha-cluster.sh
Comment thread net/ha-cluster/Makefile Outdated
Comment thread net/ha-cluster/files/ha-cluster.config Outdated
Add ha-cluster, a UCI-based orchestration package that coordinates
keepalived (VRRP), owsync (config sync), and optionally lease-sync
(DHCP sync) to provide high availability for OpenWrt routers.

Reads /etc/config/ha-cluster and generates flat configs for each
managed service in /tmp/ha-cluster/. Manages lifecycle via procd.

Features:
- Single UCI configuration for all HA services
- Automatic keepalived.conf generation (VRRP instances, VIPs)
- IPv4 + IPv6 dual-stack VRRP support
- Unicast and multicast VRRP transport
- Service takeover/release on VRRP state transitions
- Startup validation (interface checks, DHCP prerequisites)

Shell-only package (PKGARCH:=all), ~1000 lines.
Depends on: keepalived. Recommends: owsync, lease-sync.

Tested on: OpenWrt 24.10 and 25.12 (x86_64 + filogic), production.

Signed-off-by: Pierre Gaufillet <pierre.gaufillet@bergamote.eu>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code


if [ "$lease_sync_enabled" -eq 1 ]; then
mkdir -p "$confdir"
tmp_overlay="$overlay_path.new"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The temp file lands inside dnsmasq's conf-dir, which is passed wholesale as --conf-dir=$dnsmasqconfdir in dnsmasq.init:1175 with no filter by default, so a ha-cluster.conf.new left behind by an interrupted run gets parsed as config (and the elif cleanup branch below only removes $overlay_path). dnsmasq's conf-dir scan skips dotfiles, so a dot-prefixed name inside the same directory keeps mv atomic and is never read.

Suggested change
tmp_overlay="$overlay_path.new"
tmp_overlay="$confdir/.$HA_DNSMASQ_OVERLAY_NAME.new"

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants