You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
654 B

  1. error_log stderr notice;
  2. worker_processes auto;
  3. events {
  4. multi_accept on;
  5. use epoll;
  6. worker_connections 1024;
  7. }
  8. stream {
  9. upstream kube_apiserver {
  10. least_conn;
  11. {% for host in groups['kube-master'] -%}
  12. server {{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address'])) }}:{{ kube_apiserver_port }};
  13. {% endfor %}
  14. }
  15. server {
  16. listen 127.0.0.1:{{ kube_apiserver_port }};
  17. proxy_pass kube_apiserver;
  18. proxy_timeout 10m;
  19. proxy_connect_timeout 1s;
  20. }
  21. }