Skip to content

Add control/data plane HPA #3702

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

Merged
merged 13 commits into from
Aug 8, 2025
Merged

Add control/data plane HPA #3702

merged 13 commits into from
Aug 8, 2025

Conversation

sjberman
Copy link
Collaborator

@sjberman sjberman commented Aug 7, 2025

Problem: I want the NGF control plane and nginx data plane to scale automatically based on resource consumption or other metrics.

Solution: Allow for configuring a HorizontalPodAutoscaler (HPA) through the helm chart and NginxProxy resource for both Deployments.

Testing: Verified that the HPA works for both Deployments.

Closes #3447

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • 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

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Add HorizontalPodAutoscaling support for both control plane and data plane deployments.

nowjean and others added 2 commits August 7, 2025 08:18
Problem: I want the NGF control plane and nginx data plane to scale automatically based on resource consumption or other metrics.

Solution: Allow for configuring a HorizontalPodAutoscaler (HPA) through the helm chart and NginxProxy resource for both Deployments.
@sjberman sjberman requested a review from a team as a code owner August 7, 2025 14:58
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart labels Aug 7, 2025
@sjberman sjberman mentioned this pull request Aug 7, 2025
6 tasks
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 76.38889% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.05%. Comparing base (2987d81) to head (3a2f6d8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/provisioner/objects.go 79.77% 15 Missing and 3 partials ⚠️
internal/controller/provisioner/setter.go 0.00% 9 Missing ⚠️
internal/controller/provisioner/provisioner.go 53.33% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3702      +/-   ##
==========================================
- Coverage   87.14%   87.05%   -0.09%     
==========================================
  Files         128      128              
  Lines       15779    15919     +140     
  Branches       62       62              
==========================================
+ Hits        13750    13858     +108     
- Misses       1869     1896      +27     
- Partials      160      165       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

👏

@sarthyparty
Copy link
Contributor

Do we need to clean up HPA if the autoscaling is removed from NginxProxy?

@sjberman
Copy link
Collaborator Author

sjberman commented Aug 7, 2025

Do we need to clean up HPA if the autoscaling is removed from NginxProxy?

Yeah we should. Gonna need to add logic for that.

Copy link
Contributor

@bjee19 bjee19 left a comment

Choose a reason for hiding this comment

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

nice 🚀

Copy link
Contributor

@ciarams87 ciarams87 left a comment

Choose a reason for hiding this comment

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

One non-blocking question, otherwise looks great! 🎉

@sjberman sjberman enabled auto-merge (squash) August 8, 2025 16:17
@sjberman sjberman merged commit 385d5be into main Aug 8, 2025
78 of 80 checks passed
@sjberman sjberman deleted the feat/hpa branch August 8, 2025 16:54
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Aug 8, 2025
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 helm-chart Relates to helm chart release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

HorizontalPodAutoscaler Support
7 participants