Added code
This commit is contained in:
26
ansible/roles/k8s-api-ha/templates/haproxy.cfg.j2
Normal file
26
ansible/roles/k8s-api-ha/templates/haproxy.cfg.j2
Normal file
@ -0,0 +1,26 @@
|
||||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
daemon
|
||||
maxconn 2000
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode tcp
|
||||
option tcplog
|
||||
option dontlognull
|
||||
timeout connect 10s
|
||||
timeout client 1m
|
||||
timeout server 1m
|
||||
retries 3
|
||||
|
||||
frontend kubernetes_api
|
||||
bind *:{{ haproxy_bind_port }}
|
||||
default_backend k8s_masters
|
||||
|
||||
backend k8s_masters
|
||||
option tcp-check
|
||||
balance roundrobin
|
||||
{% for srv in haproxy_backend_server %}
|
||||
server {{ srv.backend_name }} {{ srv.backend_ip }}:{{ srv.backend_port }} check fall 3 rise 2
|
||||
{% endfor %}
|
14
ansible/roles/k8s-api-ha/templates/keepalived.conf.j2
Normal file
14
ansible/roles/k8s-api-ha/templates/keepalived.conf.j2
Normal file
@ -0,0 +1,14 @@
|
||||
vrrp_instance VI_1 {
|
||||
state {{ hostvars[inventory_hostname].state }}
|
||||
interface {{ ansible_default_ipv4.interface }}
|
||||
virtual_router_id 51
|
||||
priority {{ hostvars[inventory_hostname].priority }}
|
||||
advert_int 1
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass {{ keepalived_auth_pass }}
|
||||
}
|
||||
virtual_ipaddress {
|
||||
{{ keepalived_vip }}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user