Skip to content
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

NGINX Plus: dynamic upstream reloads support #1469

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

sjberman
Copy link
Collaborator

Problem: One of the benefits of using NGINX Plus is the ability to dynamically update upstream servers using the API. We currently only perform nginx reloads to update upstream servers, which can be a disruptive process.

Solution: If using NGINX Plus, we'll now use the N+ API to update upstream servers. This reduces the amount of reloads that we have to perform, specifically when endpoints change (scaled, for example) with no other changes.

Testing: Verified that state file exists and is updated properly when apps are scaled.

Closes #1332

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@sjberman sjberman requested review from a team as code owners January 16, 2024 17:39
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart labels Jan 16, 2024
@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from b80ae86 to cc4c985 Compare January 17, 2024 18:30
internal/mode/static/handler.go Outdated Show resolved Hide resolved
internal/mode/static/handler.go Show resolved Hide resolved
internal/mode/static/nginx/conf/nginx-plus.conf Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/upstreams_template.go Outdated Show resolved Hide resolved
internal/mode/static/state/resolver/resolver.go Outdated Show resolved Hide resolved
internal/mode/static/handler.go Outdated Show resolved Hide resolved
site/content/overview/nginx-plus.md Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/upstreams_template.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/handler.go Outdated Show resolved Hide resolved
internal/mode/static/manager.go Show resolved Hide resolved
internal/mode/static/nginx/config/upstreams.go Outdated Show resolved Hide resolved
internal/mode/static/state/resolver/resolver.go Outdated Show resolved Hide resolved
internal/mode/static/state/store_test.go Show resolved Hide resolved
@sjberman sjberman marked this pull request as draft January 18, 2024 23:26
@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from cc4c985 to 5545e37 Compare January 18, 2024 23:29
@github-actions github-actions bot removed the helm-chart Relates to helm chart label Jan 18, 2024
@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from 5545e37 to 4958ed9 Compare January 19, 2024 17:47
@sjberman sjberman marked this pull request as ready for review January 19, 2024 17:47
@sjberman sjberman requested a review from ADubhlaoich January 19, 2024 18:27
internal/mode/static/handler.go Show resolved Hide resolved
internal/mode/static/handler.go Show resolved Hide resolved
internal/mode/static/nginx/config/http/config.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Show resolved Hide resolved
internal/mode/static/state/change_processor.go Outdated Show resolved Hide resolved
internal/mode/static/state/change_processor.go Outdated Show resolved Hide resolved
internal/mode/static/state/store_test.go Show resolved Hide resolved
Copy link
Contributor

@ADubhlaoich ADubhlaoich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with some edit suggestions.

The (Albeit small) NGINX Plus document reeks of marketing jargon to me, but it's hard to avoid it without completely rewriting it.

@sjberman sjberman requested a review from kate-osborn January 22, 2024 17:32
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀

@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from ea88e6d to 388213d Compare January 22, 2024 21:12
internal/mode/static/handler.go Outdated Show resolved Hide resolved
internal/mode/static/handler.go Show resolved Hide resolved
internal/mode/static/handler.go Outdated Show resolved Hide resolved
internal/mode/static/handler_test.go Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/framework/events/loop.go Outdated Show resolved Hide resolved
@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from 388213d to 488e229 Compare January 23, 2024 16:17
@sjberman sjberman requested a review from pleshakov January 23, 2024 16:21
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Problem: One of the benefits of using NGINX Plus is the ability to dynamically update upstream servers using the API. We currently only perform nginx reloads to update upstream servers, which can be a disruptive process.

Solution: If using NGINX Plus, we'll now use the N+ API to update upstream servers. This reduces the amount of reloads that we have to perform, specifically when endpoints change (scaled, for example) with no other changes.
@sjberman sjberman force-pushed the enh/plus-dynamic-reloads branch from 63be261 to 10e4959 Compare January 24, 2024 15:21
@sjberman sjberman enabled auto-merge (squash) January 24, 2024 15:24
@sjberman sjberman merged commit d65385d into nginx:main Jan 24, 2024
26 checks passed
@sjberman sjberman deleted the enh/plus-dynamic-reloads branch January 24, 2024 15:29
@sjberman sjberman restored the enh/plus-dynamic-reloads branch July 24, 2024 19:39
@sjberman sjberman deleted the enh/plus-dynamic-reloads branch July 24, 2024 19:40
@sjberman sjberman restored the enh/plus-dynamic-reloads branch December 10, 2024 21:38
@sjberman sjberman deleted the enh/plus-dynamic-reloads branch December 10, 2024 21:40
@sjberman sjberman restored the enh/plus-dynamic-reloads branch December 10, 2024 21:49
@sjberman sjberman deleted the enh/plus-dynamic-reloads branch December 10, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NGINX+ Dynamic Upstream Reloads
4 participants