-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat: support new topologySpread scheduling constraints #852
feat: support new topologySpread scheduling constraints #852
Conversation
aed9f49
to
54af319
Compare
Pull Request Test Coverage Report for Build 13251614430Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
4329131
to
f0127f2
Compare
b23a605
to
0408162
Compare
0408162
to
6673b5b
Compare
Holding to include |
This is awesome work! This is definitely getting close! I think mostly a few small things -- we should write-down things that we want to refactor here since there were some ideas thrown out about how we could move existing nodes into |
da3c39a
to
3feab07
Compare
3feab07
to
3441351
Compare
dd3ce78
to
58005bf
Compare
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.
Nice work!
"sigs.k8s.io/karpenter/pkg/scheduling" | ||
) | ||
|
||
// TopologyDomainGroup tracks the domains for a single topology. Additionally, it tracks the taints associated with |
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.
Yeah, I think my confusion here was just based around when this was used -- this is only used when constructing the topologyGroup -- it's not actually used when we are doing any counting since we should have already discovered all of the available domains at the top of the loop
} | ||
|
||
return filter | ||
} | ||
|
||
// Matches returns true if the TopologyNodeFilter doesn't prohibit node from the participating in the topology | ||
func (t TopologyNodeFilter) Matches(node *v1.Node) bool { | ||
return t.MatchesRequirements(scheduling.NewLabelRequirements(node.Labels)) | ||
func (t TopologyNodeFilter) Matches(taints []corev1.Taint, requirements scheduling.Requirements, compatibilityOptions ...option.Function[scheduling.CompatibilityOptions]) bool { |
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 you confirm if these compatibility options are still needed? Because the pod requirements are being checked against the node requirements, I believe there is a hard requirement that all of the nodeRequirements must exist when evaluating Counts (undefined doesn't mean it should count since this is really only true for NodeClaims that are still in-flight and we've already discussed that it's already too complicated to try and figure out if this is right or not). Anyways, the current behavior is that an undefined label doesn't mean the pod is compatible with it and I don't think that we should drop or change that behavior
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.
Right now we only allow missing WellKnownLabels when evaluating if an inflight NodeClaim should count against a domain. I don't think we should drop that here because that would result in us not counting a nodeclaim for a topology group when we should have. I think this is the right side for us to error on - being to conservative and overcounting NodeClaims rather than undercounting them.
e42e1c8
to
19836eb
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jmdeal, jonathan-innis 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 |
/hold Wait for confirmation from @jmdeal that this one is good to merge |
Should be good to go 👍 |
/remove-hold |
When will a new release with this change be rolled out? Thanks! |
Fixes #430
Description
This PR adds support for the following topology spread constraint fields:
matchLabelKeys
nodeAffinityPolicy
nodeTaintsPolicy
How was this change tested?
make test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.