From 000375c7bae85a61d70867dda69d01bcbda6fa75 Mon Sep 17 00:00:00 2001 From: Tuan-Dat Tran Date: Mon, 30 Sep 2024 10:46:19 +0200 Subject: [PATCH] adjust name for upstream in lb Signed-off-by: Tuan-Dat Tran --- roles/loadbalancer/templates/nginx.conf.j2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/loadbalancer/templates/nginx.conf.j2 b/roles/loadbalancer/templates/nginx.conf.j2 index e2f0197..a7c554a 100644 --- a/roles/loadbalancer/templates/nginx.conf.j2 +++ b/roles/loadbalancer/templates/nginx.conf.j2 @@ -16,15 +16,16 @@ stream { } http { - upstream k3s_servers { - {% for ip in k3s_server_ips %} - server {{ ip }}; - {% endfor %} + upstream k3s_servers_http { + least_conn; + {% for ip in k3s_server_ips %} + server {{ ip }}; + {% endfor %} } server { location / { - proxy_pass http://k3s_servers; - } + proxy_pass http://k3s_servers_http; + } } }