2016-09-28 19:05:08 +08:00
|
|
|
error_log stderr notice;
|
|
|
|
|
2018-10-21 04:56:53 +08:00
|
|
|
worker_processes 1;
|
2016-09-28 19:05:08 +08:00
|
|
|
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 {
|
2016-12-27 23:39:00 +08:00
|
|
|
listen 127.0.0.1:{{ nginx_kube_apiserver_port|default(kube_apiserver_port) }};
|
2016-09-28 19:05:08 +08:00
|
|
|
proxy_pass kube_apiserver;
|
2016-11-29 01:27:47 +08:00
|
|
|
proxy_timeout 10m;
|
2016-09-28 19:05:08 +08:00
|
|
|
proxy_connect_timeout 1s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|