VPP client (internal/vpp/) - New package managing connections to both VPP API and stats sockets, treated as a unit: if either drops, both are torn down and re-established together. - Run() loop: connect, fetch version via vpe.ShowVersion, read /sys/boottime from the stats segment, log vpp-connect, then monitor with control_ping every 10s. On failure, disconnect both, retry after 5s. - Registers as client name "vpp-maglev" (visible in VPP's "show api clients"). - Flags: --vpp-api-addr (default /run/vpp/api.sock) and --vpp-stats-addr (default /run/vpp/stats.sock). Empty api addr disables VPP integration entirely. gRPC / proto - Add GetVPPInfo RPC returning VPPInfo: version, build_date, build_directory, pid, boottime_ns, connecttime_ns. Both times are unix timestamps in nanoseconds — the client computes durations locally for display. - Returns codes.Unavailable if VPP is disabled or not connected. maglevc - Add 'show vpp info' command displaying version, build-date, build-dir, vpp-pid, vpp-boottime (with duration), and connected time (with duration).
maglevd
Health checker and gRPC control plane for VPP Maglev load balancing.
Build and Install
make # builds build/<arch>/maglevd and build/<arch>/maglevc
make test # runs all tests
make pkg-deb # Creates a debian package for arm64 and amd64
Requires Go 1.25+ and (for make proto) protoc with protoc-gen-go and
protoc-gen-go-grpc.
Produces vpp-maglev_<version>_amd64.deb and vpp-maglev_<version>_arm64.deb
in the build/ directory by cross-compiling with GOOS=linux GOARCH=<arch>.
Requires dpkg-deb (available on any Debian/Ubuntu host).
Running
After installing, the unit is enabled but not started automatically:
# edit /etc/vpp-maglev/maglev.yaml, then:
systemctl enable --now vpp-maglevd
Or run the server and client by hand:
maglevd --config /etc/vpp-maglev/maglev.yaml --grpc-addr :9090
maglevd --version # print version and exit
maglevc --server localhost:9090 # interactive shell
maglevc show frontends # one-shot
maglevc -color=false show backends # one-shot, no ANSI color
maglevc set backend nginx0-ams pause
Send SIGHUP to maglevd to reload config without restarting.
maglevd requires CAP_NET_RAW for ICMP health checks.
Check out a minimal configuration file in [debian/maglev.yaml].
See docs/user-guide.md for flags, signals, and maglevc usage.
See docs/config-guide.md for the full configuration reference.
See docs/healthchecks.md for health state machine details.
Docker
docker build -t maglevd .
docker run --cap-add NET_RAW -v /etc/vpp-maglev:/etc/vpp-maglev maglevd