Skip to content

robbat2/haproxy-healthcheck-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-check of HAProxy

This code & HAProxy example configuration provides a way to expose the health of HAProxy itself.

It should NOT be confused with the agent-check functionality that HAProxy can use to check backend servers.

The output is formatted to be similar to the agent-check TCP check used by HAProxy, but sent via HTTP rather than TCP.

The exampe configuration uses two files which can be used to set the output into MAINT or DRAIN states. The files are haproxy_maint.acl, haproxy_drain.acl respectively.

One example usage might be checking the state of HAProxy from a seperate L4 load balancer layer [#L4LB].

  • If HAProxy is up AND ready, new connections should be delivered to HAProxy.
  • If HAProxy is up, but going down soon, no new connections should be accepted, but it may be desirable to let long-running connections continue (e.g. in-flight uploads/downloads)

Beware that if you naively connect the DOWN/DRAIN/MAINT states to some BGP announcement, but have in-flight active connections, the BGP route being withdrawn may then cause the connections to break.

TODO:

  • Implement weight output
  • Implement maxconn output

References:

agent-check

L4 load balancer (L4LB)

License & Copyright.

This code is licensed under BSD 2-Clause "Simplified" License, (SPDX:BSD-2-Clause). Copyright (c) 2020, Robin H. Johnson [email protected] & DigitalOcean.

About

Healthcheck of HAProxy, agent-check style but via HTTP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages