haproxy-config 0.4.1

Parse HAProxy configs and easily query it
Documentation
#  vim:ts=4:sts=4:sw=4:et
#
#  Author: Hari Sekhon
#  Date: 2017-12-16 10:32:58 +0000 (Sat, 16 Dec 2017)
#
#  https://github.com/HariSekhon/HAProxy-configs
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
#  https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
#                   H A P r o x y  -  A p a c h e   D r i l l
# ============================================================================ #

# Options:
#
# 1. use ZooKeeper connection string
# 2. use Load Balancer to avoid exposing ZooKeeper to clients

# Beware that the Apache Drill health check API is not always reliable, as documented in this bug:
#
# https://issues.apache.org/jira/browse/DRILL-5990

frontend apache-drill-ui
    description "Apache Drill UI"
    bind *:8047
    default_backend apache-drill-ui

frontend apache-drill-sql
    description "Apache Drill SQL"
    bind *:31010
    mode tcp
    option tcplog
    default_backend apache-drill-sql

backend apache-drill-ui
    description "Apache Drill UI"
    # using 'source' for both SQL + UI means you'll see your own queries in UI even without global query list
    #balance roundrobin
    balance source
    option httpchk GET /status
    http-check expect string Running
    acl internal_networks src 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 127.0.0.1
    http-request deny if ! internal_networks
    server apache-drill apache-drill:8047 check
    server drill drill:8047 check
    server docker docker:8047 check
    server 192.168.99.100 192.168.99.100:8047 check

backend apache-drill-sql
    description "Apache Drill SQL"
    #balance leastconn
    balance source
    mode tcp
    acl internal_networks src 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 127.0.0.1
    tcp-request content reject if ! internal_networks
    option httpchk GET /status
    http-check expect string Running
    server apache-drill apache-drill:31010 check port 8047
    server drill drill:31010 check port 8047
    server docker docker:31010 check port 8047
    server 192.168.99.100 192.168.99.100:31010 check port 8047