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

add args for NodeResourcesFit plugin #88842

Merged
merged 1 commit into from
Jul 9, 2020
Merged

Conversation

angao
Copy link
Contributor

@angao angao commented Mar 5, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:
In our scenario, we use custom extended resources in the container, such as example.com/rc1, example.com/rc2, where rc1 and rc2 are dynamic, so we can't through NodeResourcesFit plugin ignoredResources args settings because it only can set up a fixed set of resource name. But we want to be able to set some prefixes for extension resources that can skip the NodeResourcesFit plugin check and check-in our custom plugin.

Which issue(s) this PR fixes:

Fixes #88887

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Users can configure a resource prefix to ignore a group of resources.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 5, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @angao. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 5, 2020
@angao
Copy link
Contributor Author

angao commented Mar 5, 2020

/sig scheduling

@angao
Copy link
Contributor Author

angao commented Mar 5, 2020

/assign @bsalamat @yujuhong

@angao angao changed the title add args for noderesources plugin add args for NodeResourcesFit plugin Mar 5, 2020
@alculquicondor
Copy link
Member

/hold this needs further discussion

Could you open an issue to describe your usecase in more detail?

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 5, 2020
@angao
Copy link
Contributor Author

angao commented Mar 10, 2020

If this pr is acceptable, maybe ExtenderConfig can also be extended.

@alculquicondor
Copy link
Member

/ok-to-test

One API at a time :) Also, the extender API needs a new version before we modify it.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2020
pkg/scheduler/framework/plugins/noderesources/fit.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/plugins/noderesources/fit.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/plugins/noderesources/fit.go Outdated Show resolved Hide resolved
}

// FitArgs holds the args that are used to configure the plugin.
type FitArgs struct {
// IgnoredResources is the list of resources that NodeResources fit filter
// should ignore.
IgnoredResources []string `json:"ignoredResources,omitempty"`
// IgnoredResourceGroups defines the list of resource prefix that NodeResources fit filter should ignore.
IgnoredResourceGroups []string `json:"ignoredResourceGroups,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Let's add some format validation for ignoredResourceGroups. Maybe there is some validation for label keys that you could reuse.

Copy link
Member

Choose a reason for hiding this comment

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

@alculquicondor can you clarify how this struct is used and why it has json annotations? is this serialized as a user-visible API or does it deserialize API input from a user?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is deserialized from component config. Please see #87784

Copy link
Member

Choose a reason for hiding this comment

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

Ok... spreading API-oriented code out into non-API packages makes it very easy to make breaking changes without realizing it. Anything that serializes or deserializes content from a config file or API request should be in an API-specific package and should be versioned.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Do you prefer that #87784 gets solved before this PR?

pkg/scheduler/framework/plugins/noderesources/fit_test.go Outdated Show resolved Hide resolved
@alculquicondor
Copy link
Member

@liggitt anything to add?

Comment on lines 245 to 250
ignoredExtendedResources = sets.NewString()
}

if ignoredResourceGroups == nil {
ignoredResourceGroups = sets.NewString()
}
Copy link
Member

@liggitt liggitt Jun 9, 2020

Choose a reason for hiding this comment

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

can drop these and avoid allocating these on every call... Len() and Has() can be run on nil string sets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@angao
Copy link
Contributor Author

angao commented Jun 19, 2020

/test pull-kubernetes-kubemark-e2e-gce-big

@angao
Copy link
Contributor Author

angao commented Jun 29, 2020

Any other questions?

@alculquicondor
Copy link
Member

ping @tallclair @liggitt

@liggitt
Copy link
Member

liggitt commented Jun 29, 2020

/approve

for API portions

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, angao, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2020
@angao
Copy link
Contributor Author

angao commented Jul 7, 2020

Is it possible to merge? @alculquicondor

@alculquicondor
Copy link
Member

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 7, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@angao
Copy link
Contributor Author

angao commented Jul 8, 2020

/retest

@angao
Copy link
Contributor Author

angao commented Jul 8, 2020

/test pull-kubernetes-node-e2e

@angao
Copy link
Contributor Author

angao commented Jul 8, 2020

/test pull-kubernetes-e2e-gce

@angao
Copy link
Contributor Author

angao commented Jul 8, 2020

/test pull-kubernetes-verify

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@liggitt liggitt added this to the v1.19 milestone Jul 8, 2020
@liggitt
Copy link
Member

liggitt commented Jul 8, 2020

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 70e09f2 into kubernetes:master Jul 9, 2020
@liggitt liggitt moved this from Assigned to API review completed, 1.19 in API Reviews Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: API review completed, 1.19
Development

Successfully merging this pull request may close these issues.

add another arg for NodeResourcesFit plugin
7 participants