From 53f680a88b644d7154ecf252f8d4836ff92dfa9d Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 12 Apr 2019 07:59:26 -0400 Subject: [PATCH] Added kubernetes api to haproxy --- roles/haproxy/templates/haproxy.cfg.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/haproxy/templates/haproxy.cfg.j2 b/roles/haproxy/templates/haproxy.cfg.j2 index 904e368..c2f8f78 100644 --- a/roles/haproxy/templates/haproxy.cfg.j2 +++ b/roles/haproxy/templates/haproxy.cfg.j2 @@ -39,3 +39,11 @@ listen https {% for node in groups['kube-workers'] %} server {{node}} {{ hostvars[node]['ansible_host'] }}:443 check fall 3 inter 3s rise 2 {% endfor %} + +listen kubernetes + bind *:6443 + mode tcp + balance roundrobin +{% for node in groups['kube-masters'] %} + server {{node}} {{ hostvars[node]['ansible_host'] }}:6443 check fall 3 inter 3s rise 2 +{% endfor %}