What Is New in HAProxy 2.0
HAProxy 2.0 is a major release that introduces significant features focused on dynamic configuration, enhanced observability, and cloud-native integration. It fundamentally changes how you manage and monitor the load balancer.
| Category | Key Changes |
|---|---|
| New Features | Data Plane API, Dynamic Servers, HTX & HTTP/2, Log Forwarding |
| Improvements | Kubernetes Ingress Controller, Prometheus Metrics, Traffic Policies |
| Bug Fixes | Numerous fixes across the codebase for stability |
How does the Data Plane API change configuration management?
The new Data Plane API is a game-changer for automation. It provides a RESTful interface to dynamically manage your HAProxy configuration, eliminating the need for manual file edits and reloads for many common tasks.
You can now manage frontends, backends, and servers programmatically. This is crucial for integrating HAProxy into modern CI/CD pipelines and infrastructure-as-code workflows, making it feel like a true cloud-native service.
What are the key observability enhancements?
Observability gets a massive boost with native Prometheus support and a structured logs output format. You can now expose over 100 metrics natively in Prometheus format, making deep performance analysis straightforward.
The new log forwarding feature allows you to send logs to a ring buffer or a Unix domain socket in real-time. This matters because it enables integration with external log processors without the overhead and latency of a syslog connection.
How is Kubernetes integration improved?
The HAProxy Kubernetes Ingress Controller is now GA and comes bundled with the community edition. It uses the new Data Plane API for dynamic updates, providing a seamless way to manage ingress traffic.
This native integration means service discovery and configuration changes happen automatically as your Kubernetes services scale up and down. You get a robust, high-performance ingress solution without custom scripting.
What underlying protocol engine changes were made?
HAProxy 2.0 completes the transition to the HTX (HTTP Transformation) engine, which is now the default for all HTTP processing. This modern internal representation is the foundation for advanced HTTP handling.
With HTX, full end-to-end HTTP/2 support is now stable, including the ability to terminate HTTP/2 and proxy it as HTTP/1.1 to backends. This provides modern protocol benefits to clients while maintaining backend compatibility.
What new traffic routing capabilities exist?
New traffic policies allow for more sophisticated routing decisions based on JWT claims, OAuth tokens, and other advanced criteria. You can build more intelligent and secure routing logic directly into the load balancer.
The introduction of a new Process Manager allows for hot-swapping of certificates and seamless binary upgrades. In practice, this means you can update TLS certificates or even the HAProxy binary itself with zero downtime.
FAQ
Is the Data Plane API a separate service?
Yes, it's a separate process that runs alongside HAProxy and communicates with it over its internal runtime API. You need to run both the haproxy and haproxy-dataplaneapi binaries.
Does HTTP/2 work for both frontend and backend connections?
Frontend HTTP/2 support is fully stable. For backends, HAProxy 2.0 can speak HTTP/2 to supported servers, but it commonly converts HTTP/2 from clients to HTTP/1.1 for the backend connections.
Can I use the new Kubernetes Ingress Controller in production?
Yes, the ingress controller is now considered GA (Generally Available) with the 2.0 release, making it suitable for production use alongside the stable core.
How do I access the built-in Prometheus metrics?
You expose the metrics by defining a new frontend or backend with a mode http and using the use_backend directive with the prometheus-exporter feature.
Are there any breaking changes when upgrading to 2.0?
The main consideration is that HTX mode is now the default for HTTP. While most configurations should work, some older, obscure tuning options might behave differently and require testing.