Haproxy - stop traffic to node under maintenance
Haproxy's control socket supports sending a lot of different commands to control the behavior of the server. If you want to allow all existing connections to complete, but not send new connections, you can put the backend in DRAIN mode (make sure the control socket is enabled):
echo "set server backend/serv state drain" | sudo socat stdio /run/haproxy/haproxysock
You can set the backend to maintenance mode instead of DRAIN if you want to stop all traffic immediately.