2016-09-28 11:05:08 +00:00
|
|
|
error_log stderr notice;
|
|
|
|
|
|
|
|
worker_processes auto;
|
|
|
|
events {
|
|
|
|
multi_accept on;
|
|
|
|
use epoll;
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
stream {
|
|
|
|
upstream kube_apiserver {
|
|
|
|
least_conn;
|
|
|
|
{% for host in groups['kube-master'] -%}
|
|
|
|
server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address'])) }}:{{ kube_apiserver_port }};
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2017-01-07 19:04:00 +00:00
|
|
|
listen {{ kube_apiserver_nginx_bind_address }}:{{ kube_apiserver_port }};
|
2016-09-28 11:05:08 +00:00
|
|
|
proxy_pass kube_apiserver;
|
2016-11-28 17:27:47 +00:00
|
|
|
proxy_timeout 10m;
|
2016-09-28 11:05:08 +00:00
|
|
|
proxy_connect_timeout 1s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|