diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-02-01 02:48:06 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-02-01 02:48:06 +0100 |
commit | 844bc9826f652d6bebe55c66e44eb69bd89575bf (patch) | |
tree | 5c60fe1648e5a1db4b54c4ce02e72c4cf0bd8939 /roles/kubernetes/kubeadm/base/templates | |
parent | updated all nexcloud instances on sk-cloudia (diff) | |
parent | kubernetes standalone with docker (diff) |
Merge branch 'topic/kubernetes-ng'
Diffstat (limited to 'roles/kubernetes/kubeadm/base/templates')
-rw-r--r-- | roles/kubernetes/kubeadm/base/templates/haproxy.cfg.j2 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/roles/kubernetes/kubeadm/base/templates/haproxy.cfg.j2 b/roles/kubernetes/kubeadm/base/templates/haproxy.cfg.j2 new file mode 100644 index 00000000..3de6ac00 --- /dev/null +++ b/roles/kubernetes/kubeadm/base/templates/haproxy.cfg.j2 @@ -0,0 +1,36 @@ +global + log /dev/log local0 + log /dev/log local1 notice + chroot /var/lib/haproxy + stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners + stats timeout 30s + user haproxy + group haproxy + daemon + +frontend kube_api +{% if '_kubernetes_masters_' in group_names %} + bind *:6443 +{% else %} + bind 127.0.0.1:6443 +{% endif %} + mode tcp + timeout client 3h + default_backend kube_api + +backend kube_api + mode tcp +{% if '_kubernetes_masters_' in group_names %} + balance first +{% else %} + balance roundrobin +{% endif %} + option log-health-checks + option httpchk GET /healthz + http-check expect string ok + default-server inter 5s fall 3 rise 2 + timeout connect 5s + timeout server 3h +{% for master in groups['_kubernetes_masters_'] %} + server {{ hostvars[master].inventory_hostname }} {{ hostvars[master].kubernetes_overlay_node_ip | default(hostvars[master].ansible_default_ipv4.address) }}:6442 {% if master == inventory_hostname %}id 1{% endif %} check check-ssl verify none +{% endfor %} |