2016-09-28 11:05:08 +00:00
|
|
|
error_log stderr notice;
|
|
|
|
|
2018-10-20 20:56:53 +00:00
|
|
|
worker_processes 1;
|
2016-09-28 11:05:08 +00:00
|
|
|
events {
|
|
|
|
multi_accept on;
|
|
|
|
use epoll;
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
stream {
|
|
|
|
upstream kube_apiserver {
|
|
|
|
least_conn;
|
|
|
|
{% for host in groups['kube-master'] -%}
|
2019-03-05 11:04:39 +00:00
|
|
|
server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(fallback_ips[host])) }}:{{ kube_apiserver_port }};
|
2019-03-28 13:20:46 +00:00
|
|
|
{% endfor -%}
|
2016-09-28 11:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2016-12-27 15:39:00 +00:00
|
|
|
listen 127.0.0.1:{{ nginx_kube_apiserver_port|default(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;
|
|
|
|
|
|
|
|
}
|
2019-03-28 13:20:46 +00:00
|
|
|
}
|
2016-09-28 11:05:08 +00:00
|
|
|
|
2019-03-28 13:20:46 +00:00
|
|
|
http {
|
|
|
|
{% if nginx_kube_apiserver_healthcheck_port is defined -%}
|
|
|
|
server {
|
|
|
|
listen {{ nginx_kube_apiserver_healthcheck_port }};
|
|
|
|
location /healthz {
|
|
|
|
access_log off;
|
|
|
|
return 200;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endif -%}
|
2016-09-28 11:05:08 +00:00
|
|
|
}
|