Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Ensure that nginx does DNS lookups #2368

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

thedadams
Copy link
Contributor

When using static hostnames, nginx will lookup the DNS for these hostnames on startup/config reload and won't do it again until the container is restarted or the config is reloaded. This means that if the service IPs change, then nginx won't have the correct IPs until one of these things happen.

This change uses a hack to ensure that nginx will look up for the DNS for services at least every 15 seconds. This ensures that if the service IPs change for some reason, then nginx will get them.

@thedadams thedadams marked this pull request as draft December 5, 2023 16:02
When using static hostnames, nginx will lookup the DNS for these
hostnames on startup/config reload and won't do it again until the
container is restarted or the config is reloaded. This means that if the
service IPs change, then nginx won't have the correct IPs until one of
these things happen.

This change uses a hack to ensure that nginx will look up for the DNS
for services at least every 15 seconds. This ensures that if the service
IPs change for some reason, then nginx will get them.

Signed-off-by: Donnie Adams <[email protected]>
@thedadams thedadams marked this pull request as ready for review December 5, 2023 21:40
@StrongMonkey
Copy link
Contributor

In which case, service IP could change and that would require nginx to look up again?

@thedadams
Copy link
Contributor Author

@StrongMonkey A change like this one where the linked services are changing.

@thedadams thedadams merged commit f2147cd into acorn-io:main Dec 6, 2023
4 checks passed
@thedadams thedadams deleted the no-nginx-cache-ips branch December 6, 2023 12:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants