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

Fix creation of NEGs in the new zone when cluster spans to the new zone #1754

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

gauravkghildiyal
Copy link
Member

@gauravkghildiyal gauravkghildiyal commented Jul 20, 2022

  • Propagate node update events for both NEG types (GCE_VM_IP_PORT + GCE_VM_IP)

  • Configure separate zoneMaps for the NEG types (vmIpZoneMap and vmIpPortZoneMap). These zoneMaps will be updated using the same predicate function that is eventually used inside transactionSyncer.isZoneChange() for the respective NEG types.

  • Introduce a new function NodePredicateForNetworkEndpointType that will be the source of truth for the type of predicate function to be used for a given NEG type.

For future reference, here's another related PR: #1600

/assign @swetharepakula

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 20, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @gauravkghildiyal. 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 20, 2022
@swetharepakula
Copy link
Member

/ok-to-test

@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 Jul 26, 2022
// - CandidateNodesPredicate() function decides the candidate nodes for the GCE_VM_IP_PORT kind of NEGs
//
// If we find a change in the candidacy of the node according to any of the two functions above, we should enqueue the node.
if utils.CandidateNodesPredicateIncludeUnreadyExcludeUpgradingNodes(oldNode) != utils.CandidateNodesPredicateIncludeUnreadyExcludeUpgradingNodes(currentNode) ||
Copy link
Member

Choose a reason for hiding this comment

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

The only concern I have with this approach is that we may cause L4 NEGs to be synced more than needed. we probably need to be able to differentiate later on, how not to trigger extra syncs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. That makes sense.

The reason why I initially thought it shouldn't be a problem was based on the need that we want to minimize the number of calls made to GCE APIs. Since isZoneChange() function was just making calls to the Kubernetes Cluster API, I thought it would be okay.

But it's true that there was scope of improvement there as we can save these O(number of nodes) operations used by isZoneChange() for each NEG, by just calculating it at the beginning and not doing it for each NEG

pkg/neg/manager.go Show resolved Hide resolved
@gauravkghildiyal gauravkghildiyal force-pushed the negZone branch 3 times, most recently from e4a4e34 to 178112e Compare July 29, 2022 21:09
pkg/neg/manager.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 26, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 2022
Copy link
Member

@swetharepakula swetharepakula left a comment

Choose a reason for hiding this comment

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

Thanks for the change!

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauravkghildiyal, swetharepakula

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 Aug 26, 2022
@k8s-ci-robot k8s-ci-robot merged commit 2b5cafd into kubernetes:master Aug 26, 2022
@gauravkghildiyal gauravkghildiyal deleted the negZone branch August 26, 2022 20:31
gauravkghildiyal added a commit to gauravkghildiyal/ingress-gce that referenced this pull request Aug 7, 2024
This reverts the behaviour to what existed prior to kubernetes#1754
gauravkghildiyal added a commit to gauravkghildiyal/ingress-gce that referenced this pull request Aug 14, 2024
This reverts the behaviour to what existed prior to kubernetes#1754
gauravkghildiyal added a commit to gauravkghildiyal/ingress-gce that referenced this pull request Aug 20, 2024
This reverts the behaviour to what existed prior to kubernetes#1754
gauravkghildiyal added a commit to gauravkghildiyal/ingress-gce that referenced this pull request Aug 20, 2024
This reverts the behaviour to what existed prior to kubernetes#1754
gauravkghildiyal added a commit to gauravkghildiyal/ingress-gce that referenced this pull request Aug 20, 2024
This reverts the behaviour to what existed prior to kubernetes#1754
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. 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants