Welcome! Log In Create A New Profile

Advanced

Re: least_conn upstream configuration issue "host not found in upstream" with Kubernetes DNS

Francis Daly
January 05, 2021 02:56PM
On Tue, Jan 05, 2021 at 01:20:34PM -0500, kpirateone wrote:

Hi there,

> 1) use ips instead of host names, not ideal due to the dynamic nature of the
> ips
> 2) maintain an upstream configuration externally and use nginx reload to
> modify the upstream as pods come online
>
> scaling up, as stated in the referenced thread
> (https://forum.nginx.org/read.php?2,290205) is not supported in stock
> nginx.

"scaling up" by turning on upstream services on pre-configured IP:ports
is supported in nginx. Or on re-configured IP:ports.

The thing that is not supported is run-time name resolution, if I
understand things correctly.

> there doesnt seem to be any way to use a least connected policy without
> individually knowing all the hosts?

nginx needs to know what upstream IP:ports to try to connect to. There's
not really a way around that. Stock-nginx learns that list at start time.

> as in, there is no way to use least
> connected over a headless service that returns multiple ips; we must need to
> explicitly declare all known hosts?

A hostname that resolves to multiple IPs should
be fine, according to the documentation --
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server

nginx will request the name resolution at start time. Put your list of
IPs in your name server config, or in your nginx config, as you prefer.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

least_conn upstream configuration issue "host not found in upstream" with Kubernetes DNS

kpirateone January 05, 2021 10:53AM

Re: least_conn upstream configuration issue "host not found in upstream" with Kubernetes DNS

Francis Daly January 05, 2021 12:28PM

Re: least_conn upstream configuration issue "host not found in upstream" with Kubernetes DNS

kpirateone January 05, 2021 01:20PM

Re: least_conn upstream configuration issue "host not found in upstream" with Kubernetes DNS

Francis Daly January 05, 2021 02:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready