-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
/sig scheduling |
/hold this needs further discussion Could you open an issue to describe your usecase in more detail? |
If this pr is acceptable, maybe ExtenderConfig can also be extended. |
/ok-to-test One API at a time :) Also, the extender API needs a new version before we modify it. |
} | ||
|
||
// 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"` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
@liggitt anything to add? |
ignoredExtendedResources = sets.NewString() | ||
} | ||
|
||
if ignoredResourceGroups == nil { | ||
ignoredResourceGroups = sets.NewString() | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/test pull-kubernetes-kubemark-e2e-gce-big |
Any other questions? |
ping @tallclair @liggitt |
/approve for API portions |
[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 |
Is it possible to merge? @alculquicondor |
/hold cancel |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
/test pull-kubernetes-node-e2e |
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-verify |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
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
, whererc1
andrc2
are dynamic, so we can't throughNodeResourcesFit
pluginignoredResources
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 theNodeResourcesFit
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?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: