-
Notifications
You must be signed in to change notification settings - Fork 332
replace nginz disco with native upstream resolver WPB-15302 #4663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace nginz disco with native upstream resolver WPB-15302 #4663
Conversation
0769ae8
to
e38d9c6
Compare
zone {{ $name }} 64k; # needed for dynamic DNS updates | ||
least_conn; | ||
keepalive 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do these settings come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are kept from before, see https://github.com/wireapp/wire-server/blob/develop/tools/nginz_disco/nginz_disco.sh#L49-L55 which results in current upstream files looking like
upstream cargohold {
least_conn;
keepalive 32;
server 10.100.213.88:8080 max_fails=3 weight=100;
}
upstream galeb.integrations {
least_conn;
keepalive 32;
server 10.100.18.166:8080 max_fails=3 weight=100;
}
The only difference here is the addition of a zone
, which according to the docs in https://nginx.org/en/docs/http/ngx_http_upstream_module.html (see 'resolve' keyword) is needed, as
The server group must reside in the shared memory.
… intented behaviour or not
My attempt to try refactorings on the base branch (instead of messing with it directly.) Besides minor cleanups, I'm now using an Attoparsec Parser to identify and drop upsteam <name> { <code> } blocks (blocks can be nested, thus a simple regex won't help) and Interpolate Template Haskell templates to generate new upstream blocks.
We still need to drop the existing upstreams to add new (adjusted) ones.
Stop at the first '}' which is seen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Paolo Capriotti <[email protected]>
WPB-15302
(but actually hardcoded nginx to 1.26 for some reason! - So this PR also upgrades nginx from 1.26 to 1.28)
Checklist
changelog.d