Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Created June 18, 2020 20:45
Show Gist options
  • Save darth-veitcher/70513131e5ae92c787d0b40c9b5cee39 to your computer and use it in GitHub Desktop.
Save darth-veitcher/70513131e5ae92c787d0b40c9b5cee39 to your computer and use it in GitHub Desktop.
HAProxy Kubernetes
# file: /etc/haproxy/haproxy.cfg
...
# HA K8s
frontend kubernetes
bind *:6443
option tcplog
mode tcp
default_backend kubernetes-master-nodes
backend kubernetes-master-nodes
option httpchk GET /healthz
http-check expect status 200
mode tcp
option ssl-hello-chk
balance roundrobin
server master1 123.456.789:6443 check
server master2 123.456.789:6443 check
server master3 123.456.789:6443 check
# END HA K8s
# HTTP(S)
frontend http
bind *:80
mode tcp
option tcplog
default_backend http
frontend https
bind *:443
mode tcp
option tcplog
default_backend https
backend http
mode tcp
balance roundrobin
server master1 123.456.789:80 check send-proxy-v2
server master2 123.456.789:80 check send-proxy-v2
server master3 123.456.789:80 check send-proxy-v2
backend https
mode tcp
option ssl-hello-chk
balance roundrobin
server master1 123.456.789:443 check send-proxy-v2
server master2 123.456.789:443 check send-proxy-v2
server master3 123.456.789:443 check send-proxy-v2
# End HTTP(S)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment