CI/CD / Networking / Service Mesh

HAProxy Bonds with HashiCorp Consul to Extend Automated Service Discovery

25 Jan 2021 8:53am, by

Version 2.2 of HAProxy’s Data Plane API, a sidecar for managing the HAProxy proxy server/load balancer with an API, now offers service discovery and native support for the HashiCorp’s Consul service networking software.

“With this release, you can now register the Data Plane API as a Consul client and pull node information down to a running instance of HAProxy. Entire backends and the list of servers within them will be populated in the HAProxy configuration on-the-fly,” wrote Daniel Corbett, head of product, HAProxy Technologies, in a blog post.

Through a RESTful HTTP API, HAProxy connects directly to a defined Consul server and ingests the list of services and nodes from a Consul catalog, Corbett later told The New Stack.

The API will set off a process that can “define an HAProxy backend and pool of servers to match this catalog and automatically scale up or down nodes/servers on-demand based on changes within the Consul catalog,” Corbett said.

Corbett noted in the blog post how many HAProxy users already rely on Consul and have previously used HashiCorp’s service networking solution to automatically detect new service nodes and relay their locations to other nodes within the network.

External Files

The HAProxy Data Plane API can now be used to manage files outside of HAProxy, beyond the file for HAProxy’s load balancing capabilities, haproxy.cfg. Other files HAProxy manages include:

  • SSL certificates and keys hold the cryptographic data that allows HAProxy to encrypt traffic.
  • Map files list key-value pairs that enable dictionary-style lookups that HAProxy can use when deciding how to route traffic, apply rate limiting and activate servers.
  • SPOE configuration files outline the format HAProxy should use when passing messages to external programs.

“This latest release of the HAProxy Data Plane API allows you to manipulate these files remotely,” Corbett said. “This pushes the API towards being more than a simple configuration API.”

For CI/CD, the HAProxy data plane API was also designed to support the production and deployment pipeline for software deployments.

“At the end of most deployment pipelines, you need load balancing, reverse proxying, or API gateway capabilities. You can use HAProxy for any of those cases and you can install it in any environment,” Corbett said. “The Data Plane API automates the deployment of those things, such as allowing deployment patterns such as blue/green and canary.

The company has also released version 2.3 of HAProxy itself, adding features such as forwarding, prioritizing, and translating of messages sent over the Syslog Protocol on both UDP and TCP, an OpenTracing SPOA, Stats Contexts, SSL/TLS enhancements, an improved cache, and changes in the connection layer that lay the foundation for support for HTTP/3/QUIC.

For more information on the HAProxy’s Data Plane API, check out the HAProxy Webinar on Tuesday, February 9.

A newsletter digest of the week’s most important stories & analyses.