-To generate an HAProxy config file for an entire secure cluster, run the `cockroach gen haproxy` command, specifying the location of [certificate directory](cockroach-cert.html) and the address of any instance running a CockroachDB node:
-
-{% include copy-clipboard.html %}
-~~~ shell
-$ cockroach gen haproxy \
---certs-dir=
\
---host=
-~~~
-
-To limit the HAProxy config file to nodes matching specific ["localities"](cockroach-start.html#locality), use the `--localities` flag, specifying the explicit locality tier(s) or a regular expression to match against:
-
-{% include copy-clipboard.html %}
-~~~ shell
-$ cockroach gen haproxy \
---certs-dir= \
---host=
---locality=region=us.*
-~~~
-
-
-
-To generate an HAProxy config file for an entire insecure cluster, run the `cockroach gen haproxy` command, specifying the address of any instance running a CockroachDB node:
-
-{% include copy-clipboard.html %}
-~~~ shell
-$ cockroach gen haproxy \
---insecure \
---host=
-~~~
-
-To limit the HAProxy config file to nodes matching specific ["localities"](cockroach-start.html#locality), use the `--localities` flag, specifying the explicit locality tier(s) or a regular expression to match against:
-
-{% include copy-clipboard.html %}
-~~~ shell
-$ cockroach gen haproxy \
---insecure \
---host=
---locality=region=us.*
-~~~
-
-
-By default, the generated configuration file is called `haproxy.cfg` and looks as follows, with the `server` addresses pre-populated correctly:
-
-~~~
-global
- maxconn 4096
-
-defaults
- mode tcp
- # Timeout values should be configured for your specific use.
- # See: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20connect
- timeout connect 10s
- timeout client 1m
- timeout server 1m
- # TCP keep-alive on client side. Server already enables them.
- option clitcpka
-
-listen psql
- bind :26257
- mode tcp
- balance roundrobin
- option httpchk GET /health?ready=1
- server cockroach1