Skip to content

Enable metrics-server utilization for descheduler#267

Open
officialasishkumar wants to merge 2 commits into
harvester:mainfrom
officialasishkumar:issue-10547-descheduler-metrics
Open

Enable metrics-server utilization for descheduler#267
officialasishkumar wants to merge 2 commits into
harvester:mainfrom
officialasishkumar:issue-10547-descheduler-metrics

Conversation

@officialasishkumar
Copy link
Copy Markdown

Problem:

The descheduler LowNodeUtilization strategy currently scores nodes from pod requests. On KubeVirt clusters this misses actual VM runtime usage, so descheduling decisions can be ineffective for Harvester VM workloads.

Solution:

Enable metricsUtilization.metricsServer for the bundled descheduler LowNodeUtilization strategy so it reads node usage from metrics-server. Add a render assertion to keep the generated addon template from dropping the setting.

Related Issue(s):

Issue harvester/harvester#10547

Test plan:

  • go test ./...
  • go run . -generateTemplates -path /tmp/harvester-addons-rendered
  • go run . -generateAddons -path /tmp/harvester-addons-rendered
  • rg verified metricsUtilization.metricsServer in rendered rancherd-22-addons.yaml and descheduler.yaml

Configure LowNodeUtilization to read node usage from metrics-server so VM runtime utilization is included in descheduler decisions.

Add a render assertion for the generated addon template.

Related to: harvester/harvester#10547

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Copilot AI review requested due to automatic review settings May 14, 2026 05:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables descheduler’s LowNodeUtilization strategy to read node utilization from metrics-server (instead of only pod requests), improving descheduling decisions for KubeVirt/Harvester VM workloads.

Changes:

  • Set metricsUtilization.metricsServer: true under the descheduler LowNodeUtilization plugin args in the bundled rancherd-22 addons template.
  • Add a render-time test assertion to ensure the generated rancherd-22-addons.yaml includes the metrics-server utilization setting.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/templates/rancherd-22-addons.yaml Enables metrics-server based utilization for descheduler LowNodeUtilization.
pkg/render/addon_test.go Adds an assertion to prevent the template render output from losing the new setting.

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

Comment thread pkg/render/addon_test.go Outdated

rendered, err := os.ReadFile(filepath.Join(tmpPath, defaultFileName))
assert.NoError(err)
assert.Contains(string(rendered), "metricsUtilization:\n metricsServer: true")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed by changing the rendered YAML assertion to a whitespace-tolerant regexp while still checking metricsUtilization.metricsServer: true.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
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.

2 participants