2016-09-28 11:05:08 +00:00
|
|
|
error_log stderr notice;
|
|
|
|
|
2019-04-08 09:02:29 +00:00
|
|
|
worker_processes 2;
|
|
|
|
worker_rlimit_nofile 130048;
|
|
|
|
worker_shutdown_timeout 10s;
|
|
|
|
|
2016-09-28 11:05:08 +00:00
|
|
|
events {
|
|
|
|
multi_accept on;
|
|
|
|
use epoll;
|
2019-04-08 09:02:29 +00:00
|
|
|
worker_connections 16384;
|
2016-09-28 11:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stream {
|
2019-04-08 09:02:29 +00:00
|
|
|
upstream kube_apiserver {
|
|
|
|
least_conn;
|
2021-03-24 00:26:05 +00:00
|
|
|
{% for host in groups['kube_control_plane'] -%}
|
2019-04-08 09:02:29 +00:00
|
|
|
server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(fallback_ips[host])) }}:{{ kube_apiserver_port }};
|
|
|
|
{% endfor -%}
|
|
|
|
}
|
2016-09-28 11:05:08 +00:00
|
|
|
|
2019-04-08 09:02:29 +00:00
|
|
|
server {
|
2019-04-10 19:20:08 +00:00
|
|
|
listen 127.0.0.1:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }};
|
2022-03-07 13:39:00 +00:00
|
|
|
{% if enable_dual_stack_networks -%}
|
|
|
|
listen [::]:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }};
|
|
|
|
{% endif -%}
|
2019-04-08 09:02:29 +00:00
|
|
|
proxy_pass kube_apiserver;
|
|
|
|
proxy_timeout 10m;
|
|
|
|
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 {
|
2019-04-08 09:02:29 +00:00
|
|
|
aio threads;
|
|
|
|
aio_write on;
|
|
|
|
tcp_nopush on;
|
|
|
|
tcp_nodelay on;
|
|
|
|
|
2019-09-05 07:32:51 +00:00
|
|
|
keepalive_timeout {{ loadbalancer_apiserver_keepalive_timeout }};
|
2019-04-08 09:02:29 +00:00
|
|
|
keepalive_requests 100;
|
|
|
|
reset_timedout_connection on;
|
|
|
|
server_tokens off;
|
|
|
|
autoindex off;
|
|
|
|
|
2019-04-10 12:56:18 +00:00
|
|
|
{% if loadbalancer_apiserver_healthcheck_port is defined -%}
|
2019-04-08 09:02:29 +00:00
|
|
|
server {
|
2019-04-10 12:56:18 +00:00
|
|
|
listen {{ loadbalancer_apiserver_healthcheck_port }};
|
2022-03-07 13:39:00 +00:00
|
|
|
{% if enable_dual_stack_networks -%}
|
|
|
|
listen [::]:{{ loadbalancer_apiserver_healthcheck_port }};
|
|
|
|
{% endif -%}
|
2019-04-08 09:02:29 +00:00
|
|
|
location /healthz {
|
|
|
|
access_log off;
|
|
|
|
return 200;
|
|
|
|
}
|
2019-07-01 20:38:37 +00:00
|
|
|
location /stub_status {
|
|
|
|
stub_status on;
|
|
|
|
access_log off;
|
|
|
|
}
|
2019-04-08 09:02:29 +00:00
|
|
|
}
|
2019-04-10 12:56:18 +00:00
|
|
|
{% endif %}
|
2016-09-28 11:05:08 +00:00
|
|
|
}
|