2021-04-01 19:18:59 +08:00
|
|
|
user root;
|
|
|
|
worker_processes 1;
|
|
|
|
|
|
|
|
error_log /etc/kube-lb/logs/error.log warn;
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 3000;
|
|
|
|
}
|
|
|
|
|
|
|
|
stream {
|
|
|
|
upstream backend {
|
|
|
|
{% for host in groups['kube_master'] %}
|
2021-04-02 18:53:46 +08:00
|
|
|
server {{ host }}:{{ SECURE_PORT }} max_fails=2 fail_timeout=3s;
|
2021-04-01 19:18:59 +08:00
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2021-04-02 18:53:46 +08:00
|
|
|
listen 127.0.0.1:{{ SECURE_PORT }};
|
2021-04-01 19:18:59 +08:00
|
|
|
proxy_connect_timeout 1s;
|
|
|
|
proxy_pass backend;
|
|
|
|
}
|
|
|
|
}
|