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

Support extended resources and ephemeral-storage for scale-from-zero specified in MachineClass NodeTemplate #334

Open
wants to merge 3 commits into
base: machine-controller-manager-provider
Choose a base branch
from

Conversation

elankath
Copy link

@elankath elankath commented Nov 7, 2024

What this PR does / why we need it:

Right now in scale-from-zero cases, the autoscaler does not respect ephemeral-storage and extended resource specified in the MachineClass.NodeTemplate . Only the standard cpu, gpu and memory are picked up. Neither is there any support for custom extended resource which are fully ignored presently.

Which issue(s) this PR fixes:
Fixes #132

Special notes for your reviewer:

Release note:

Support extended resources and ephemeral-storage for scale-from-zero specified in MachineClass NodeTemplate

@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Nov 7, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 7, 2024
@elankath elankath self-assigned this Nov 7, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 7, 2024
Copy link

@rishabh-11 rishabh-11 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. some changes requested.

capacityAttributes := []v1.ResourceName{"cpu", "gpu", "memory"}

for _, attribute := range capacityAttributes {
for _, attribute := range coreResourceNames {

Choose a reason for hiding this comment

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

FYI - With this GPU is not considered a core resource.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this was stupid oversight. I have gpuResourceNames but it makes more correct to have gpu inside coreReourceNames. To be honest in the real world Node we seem to be using only nvidia GPU's labels.

cluster-autoscaler/cloudprovider/mcm/mcm_manager.go Outdated Show resolved Hide resolved

func filterExtendedResources(allResources v1.ResourceList) (extendedResources v1.ResourceList) {
extendedResources = make(v1.ResourceList)
for _, n := range knownResourceNames {

Choose a reason for hiding this comment

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

Aren't we just filtering the knownResourceNames in this? What if I have some other extended resource which is not part of this list? I think in general that would be the case

Copy link
Author

Choose a reason for hiding this comment

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

We are the removing the knownResources and keeping all other extended resources in this function. Will add a doc and unit-test to make this clear.

@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Nov 11, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 12, 2024
@elankath
Copy link
Author

Corrected issues. Will test scale from zero for ephemeral storage and custom resources and add manual test-log tomorrow. I am unsure how to code an integration test for this though.

@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 12, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 12, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/changes Needs (more) changes needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow a way to specify extended resources for scale-from-zero scenario
6 participants