c12s-kubespray/roles/kubernetes/node/templates/nginx.conf.j2
Dmitry Chepurovskiy 669ab10c17 Added livenessProbe for local nginx apiserver proxy liveness probe (#4222)
* Added configurable local apiserver proxy liveness probe

* Enable API LB healthcheck by default

* Fix template spacing and moved healthz location to nginx http section

* Fix healthcheck listen address to allow kubelet request healthcheck
2019-03-28 06:20:46 -07:00

37 lines
948 B
Django/Jinja

error_log stderr notice;
worker_processes 1;
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(fallback_ips[host])) }}:{{ kube_apiserver_port }};
{% endfor -%}
}
server {
listen 127.0.0.1:{{ nginx_kube_apiserver_port|default(kube_apiserver_port) }};
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}
http {
{% if nginx_kube_apiserver_healthcheck_port is defined -%}
server {
listen {{ nginx_kube_apiserver_healthcheck_port }};
location /healthz {
access_log off;
return 200;
}
}
{% endif -%}
}