add IPv6 listen directive to nginx if enable_dual_stack_networks (#8596)

pull/8558/head
kakkotetsu 2022-03-07 22:39:00 +09:00 committed by GitHub
parent 56d882abed
commit 58b2f39ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,9 @@ stream {
server { server {
listen 127.0.0.1:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }}; listen 127.0.0.1:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }};
{% if enable_dual_stack_networks -%}
listen [::]:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }};
{% endif -%}
proxy_pass kube_apiserver; proxy_pass kube_apiserver;
proxy_timeout 10m; proxy_timeout 10m;
proxy_connect_timeout 1s; proxy_connect_timeout 1s;
@ -41,6 +44,9 @@ http {
{% if loadbalancer_apiserver_healthcheck_port is defined -%} {% if loadbalancer_apiserver_healthcheck_port is defined -%}
server { server {
listen {{ loadbalancer_apiserver_healthcheck_port }}; listen {{ loadbalancer_apiserver_healthcheck_port }};
{% if enable_dual_stack_networks -%}
listen [::]:{{ loadbalancer_apiserver_healthcheck_port }};
{% endif -%}
location /healthz { location /healthz {
access_log off; access_log off;
return 200; return 200;