-
Notifications
You must be signed in to change notification settings - Fork 59
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
Implementation KEP 257: LeaderExcluded SubGroup #428
Implementation KEP 257: LeaderExcluded SubGroup #428
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Edwinhr716 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 |
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.
Does the TPU part good to you @ahg-g otherwise, LGTM.
pkg/webhooks/pod_webhook.go
Outdated
@@ -126,7 +126,8 @@ func (p *PodWebhook) Default(ctx context.Context, obj runtime.Object) error { | |||
SetExclusiveAffinities(pod, groupUniqueKey, epKey, leaderworkerset.GroupUniqueHashLabelKey) | |||
} | |||
_, foundSubGroupSize := pod.Annotations[leaderworkerset.SubGroupSizeAnnotationKey] | |||
if foundSubGroupSize && pod.Labels[leaderworkerset.SubGroupIndexLabelKey] == "" { | |||
_, leaderExcludedSubGroup := pod.Annotations[leaderworkerset.SubGroupPolicyTypeAnnotationKey] |
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 check the value == LeaderWorker
additionally, which is benefit once we introduced more policies.
_, leaderExcludedSubGroup := pod.Annotations[leaderworkerset.SubGroupPolicyTypeAnnotationKey] | |
value, SubGroupTypeExists := pod.Annotations[leaderworkerset.SubGroupPolicyTypeAnnotationKey] |
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.
We don't have an annotation for subGroupType
if it is LeaderWorker
. Although if we are breaking backwards compatibility with #434 anyway, I think we can reconsider adding a label even if it is LeaderWorker
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.
@kerthcet thoughts on adding the label for LeaderWorker
?
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, it's all about subgroup.
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.
just nits.
❌ Deploy Preview for kubernetes-sigs-lws failed. Why did it fail? →
|
✅ Deploy Preview for kubernetes-sigs-lws canceled.
|
Seems the test is crashing ... |
…riables, added unit tests
Co-authored-by: Kante Yin <[email protected]>
Co-authored-by: Kante Yin <[email protected]>
Co-authored-by: Kante Yin <[email protected]>
Co-authored-by: Kante Yin <[email protected]>
23eb37d
to
b491d91
Compare
/retest |
/lgtm I think we need to update the https://lws.sigs.k8s.io/docs/reference/labels-annotations-and-environment-variables/ as well, but could be a follow-up. Thanks for this. |
What type of PR is this?
/kind feature
What this PR does / why we need it
Adds a new type of subgroup to exclude the leader. Can provide exclusive placement guarantees in the workers even if leader has different hardware requirements
Which issue(s) this PR fixes
Fixes #257
Special notes for your reviewer
Does this PR introduce a user-facing change?