Page MenuHomePhabricator

Static nginx.conf for nbserve
Closed, ResolvedPublic

Description

Currently the nginx.conf is generated from nginx.py, which ferrets around in /etc/resolv.conf for a nameserver, and uses a environment variable to get the address of the renderer.

There is a, potential, issue with the latter of these. Should the renderer service get a new address, nbserve will not update to reflect this without a restart of the container. There is nothing that is configured to do this automatically. This can be ameliorated by using the service dns, renderer.paws-dev.svc.cluster.local for the minikube env and renderer.prod.svc.paws.local for prod.

Meanwhile the former detail is used to populate the resolver parameter. This is currently only used in the situation that meta.wikimedia.org were to change ip addresses. Should we include the above change to renderer, it would also be used for this. It would appear that nginx does not have a default value for this, and when not set will look up all the dns entries in its config at startup, and never again. However it appears that openresty does have an ability to use whatever is in /etc/resolv.conf https://github.com/openresty/openresty/#resolvconf-parsing where local=on can be used.

Were we to set these two values as the above this could be managed by a helm template that sets the renderer domain based off of if the install is local or prod.

Additionally this gives us a reason to continue with openresty as discussed in T322161

Event Timeline

rook changed the task status from Open to In Progress.Nov 3 2022, 2:58 PM
rook claimed this task.