Skip to content

kubernetes workload scaler: add groupByNode parameter#7625

Merged
zroubalik merged 1 commit into
kedacore:mainfrom
zroubalik:kwsg
Apr 9, 2026
Merged

kubernetes workload scaler: add groupByNode parameter#7625
zroubalik merged 1 commit into
kedacore:mainfrom
zroubalik:kwsg

Conversation

@zroubalik

@zroubalik zroubalik commented Apr 8, 2026

Copy link
Copy Markdown
Member

Adds a new groupByNode trigger metadata parameter to the kubernetes-workload scaler so users can scale based on the number of distinct nodes hosting matching pods (instead of total matching pod count).

Checklist

Fixes #7628

@zroubalik zroubalik requested a review from a team as a code owner April 8, 2026 19:35
Copilot AI review requested due to automatic review settings April 8, 2026 19:35
@snyk-io

snyk-io Bot commented Apr 8, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@keda-automation keda-automation requested a review from a team April 8, 2026 19:35
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new groupByNode trigger metadata parameter to the kubernetes-workload scaler so users can scale based on the number of distinct nodes hosting matching pods (instead of total matching pod count).

Changes:

  • Introduce groupByNode boolean metadata in kubernetes-workload scaler and implement unique-node counting logic.
  • Extend unit tests to cover metadata parsing and node-grouped counting behavior.
  • Regenerate scaler schema (YAML/JSON) to include the new parameter.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
schema/generated/scalers-schema.yaml Adds groupByNode parameter to the kubernetes-workload scaler schema.
schema/generated/scalers-schema.json Adds groupByNode parameter to the kubernetes-workload scaler schema (JSON).
pkg/scalers/kubernetes_workload_scaler.go Implements groupByNode metadata and unique-node counting in metric computation.
pkg/scalers/kubernetes_workload_scaler_test.go Adds parsing validation and functional tests for group-by-node counting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zroubalik

zroubalik commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

/run-e2e kubernetes
Update: You can check the progress here

Comment thread pkg/scalers/kubernetes_workload_scaler.go

@wozniakjan wozniakjan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the code simplification mentioned by @rickbrouwer is imho pretty good one, other than that lgtm

@zroubalik

zroubalik commented Apr 9, 2026

Copy link
Copy Markdown
Member Author

/run-e2e kubernetes
Update: You can check the progress here

@zroubalik zroubalik enabled auto-merge (squash) April 9, 2026 10:10
@zroubalik zroubalik disabled auto-merge April 9, 2026 10:41
@zroubalik zroubalik merged commit acb542b into kedacore:main Apr 9, 2026
24 of 25 checks passed
jansworld pushed a commit to jansworld/keda that referenced this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kubernetes Workload Scaler: ability to limit pods on nodes

4 participants