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

Added: publishing events for topologyAwareHints changes #113544

Merged

Conversation

LiorLieberman
Copy link
Member

@LiorLieberman LiorLieberman commented Nov 2, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

See PR title

Does this PR introduce a user-facing change?

Added: publishing events when enabling/disabling topologyAwareHints.

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

Enhancement Issue: kubernetes/enhancements#2433

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 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. labels Nov 2, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 2, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: LiorLieberman / name: Lior Lieberman (16722655d95a64f4cf56840a7f9d0cedce708861, 02540031e30524f484ae69d2f285426b542e6532, a62937dab38d35c8aa8448b3a55c1a3e27800b76, ece7c451af603b6898fe2cc649730ef77c2dee2e)

@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 2, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @LiorLieberman!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 2, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @LiorLieberman. 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 the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 2, 2022
@LiorLieberman LiorLieberman changed the title WIP publishing events from the EndpointSlice controller for changes i… WIP publishing events for changes in the topologyHints feature Nov 2, 2022
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 2, 2022
@LiorLieberman LiorLieberman reopened this Nov 3, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 3, 2022
@LiorLieberman LiorLieberman changed the title WIP publishing events for changes in the topologyHints feature publishing events for changes in the topologyAwareHints Nov 3, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 3, 2022
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @LiorLieberman! These changes mostly LGTM, just a few nits. A few overall requests on the PR as well:

  1. Please squash the commits down to a single one (or small set if that provides a clearer story).
  2. Please fill out the relevant fields in the PR description, especially the release note section.
  3. Please link to Topology Aware Routing enhancements#2433 as the enhancement issue
  4. Remove WIP from the title whenever you think this is ready

@robscott
Copy link
Member

robscott commented Nov 5, 2022

/cc @swetharepakula @aojea

@LiorLieberman LiorLieberman changed the title WIP publishing events for changes in the topologyAwareHints Added events publishing for topologyAwareHints changes Nov 5, 2022
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 5, 2022
@LiorLieberman LiorLieberman changed the title Added events publishing for topologyAwareHints changes Added: publishing events for topologyAwareHints changes Nov 5, 2022
Comment on lines +274 to 294
if t.cpuRatiosByZone == nil {
return nil, &EventBuilder{
EventType: v1.EventTypeWarning,
Reason: "TopologyAwareHintsDisabled",
Message: InsufficientNodeInfo,
}
}
if len(t.cpuRatiosByZone) < 2 {
return nil, &EventBuilder{
EventType: v1.EventTypeWarning,
Reason: "TopologyAwareHintsDisabled",
Message: NodesReadyInOneZoneOnly,
}
}
if len(t.cpuRatiosByZone) > numEndpoints {
return nil, &EventBuilder{
EventType: v1.EventTypeWarning,
Reason: "TopologyAwareHintsDisabled",
Message: fmt.Sprintf("%s (%d endpoints, %d zones)", InsufficientNumberOfEndpoints, numEndpoints, len(t.cpuRatiosByZone)),
}
}
Copy link
Member

@aojea aojea Nov 7, 2022

Choose a reason for hiding this comment

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

what if we aggregate here, if we return fast we miss the other checks, that are another reason for not having hints too.

My point is if I'm using this and I hit this 3 problems, I will have to fix 1 by 1, if I see the 3 errors I may fix all of them

Copy link
Member

Choose a reason for hiding this comment

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

+1, having information about all 3 would be very useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

You suggest to publish all 3 events right? not one that contains all of them

Copy link
Member

Choose a reason for hiding this comment

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

your call, I don't have strong opinion, Swetha or Rob may have some ideas

Copy link
Member Author

Choose a reason for hiding this comment

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

@aojea @swetharepakula thinking further, it is not a good place to aggregate as all these events are mutually exclusive. you could see we check t.cpuRatiosByZone in all of them.
Moreover, if its nil, we will get exception checking for its length in the next condition.

Copy link
Member

Choose a reason for hiding this comment

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

You're right. I think how it is makes sense. Thanks!

@robscott
Copy link
Member

robscott commented Nov 7, 2022

Thanks @LiorLieberman!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiorLieberman, robscott

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 Nov 7, 2022
@LiorLieberman
Copy link
Member Author

/retest

@swetharepakula
Copy link
Member

LGTM. Thanks @LiorLieberman !

@k8s-ci-robot k8s-ci-robot merged commit 0e530f4 into kubernetes:master Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 8, 2022
@robscott robscott mentioned this pull request Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants