kubernetes workload scaler: add groupByNode parameter#7625
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
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:
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. |
There was a problem hiding this comment.
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
groupByNodeboolean metadata inkubernetes-workloadscaler 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.
|
/run-e2e kubernetes |
There was a problem hiding this comment.
the code simplification mentioned by @rickbrouwer is imho pretty good one, other than that lgtm
Signed-off-by: Zbynek Roubalik <[email protected]>
|
/run-e2e kubernetes |
Signed-off-by: Zbynek Roubalik <[email protected]> Signed-off-by: jansworld <[email protected]>
Adds a new
groupByNodetrigger metadata parameter to thekubernetes-workloadscaler so users can scale based on the number of distinct nodes hosting matching pods (instead of total matching pod count).Checklist
make generate-scalers-schemahas been run to update any outdated generated filesFixes #7628