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

Adding support for WinProxyEbpfMode in Windows KubeProxy #124092

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

princepereira
Copy link
Contributor

@princepereira princepereira commented Mar 28, 2024

What type of PR is this?

This pr provides support for WinProxyEbpfMode in windows Kube proxy.
/kind feature

What this PR does / why we need it:

Earlier windows networking stack didn't support modify load balancer policy. Update of load balancer policy was always done through delete and create policy. This was slightly time consuming, and this will increase the lag when the number of policies is in lot in number. The other draw back was change in the load balancer id even for the update policy. The sequence is also error prune in cases where delete is passed and create is failed.
With the introduction of eBPF mode in Windows Container Networking Stack, will add api for load balancer update which will be lot faster, less error prune and no change in lb id after update. Also have added changes to support proxy terminating endpoints in ebpf mode.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Provides support for eBPF mode in Windows Kubeproxy

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.30 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.30.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Mar 28 02:11:27 UTC 2024.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: princepereira
Once this PR has been reviewed and has the lgtm label, please assign daschott, mrunalp for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/windows Categorizes an issue or PR as relevant to SIG Windows. labels Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/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 Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @princepereira. 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.

@princepereira princepereira force-pushed the ppereira-updatelbpolicy-master branch 3 times, most recently from dd74563 to 5cb686e Compare March 28, 2024 19:01
@princepereira princepereira changed the title Adding update policy support to windows kubeproxy. Adding support for WinProxyEbpfMode in Windows KubeProxy Apr 12, 2024
@princepereira princepereira force-pushed the ppereira-updatelbpolicy-master branch 2 times, most recently from e4489eb to 7ffe4fc Compare April 12, 2024 10:34
// owner: @princepereira
// alpha: v1.27
//
// Allows windows kube-proxy to switch between old and new windows networking stack
Copy link

Choose a reason for hiding this comment

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

Suggested change
// Allows windows kube-proxy to switch between old and new windows networking stack
// Allows windows kube-proxy to switch between "vswitch" and "ebpf" windows networking stack

// This will be cleanup by cleanupStaleLoadbalancer fnction.
proxier.mapStaleLoadbalancers[*lbHnsID] = true
// configureLoadbalancer takes care of deleting and creating lb policy in old hns architecture and update policy in
// new architecture. If there are no backend endpoints, then code will only delete existing loadbalancer.
Copy link

Choose a reason for hiding this comment

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

spelling

return
}

klog.V(3).InfoS("Create and delete loadbalancer called.", "lbHnsID", *lbHnsID, "sourceVip", sourceVip, "vip", vip, "port", targetPort, "lbType", lbType)
Copy link

Choose a reason for hiding this comment

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

Nit: reverse these.. i.e., "delete and create"

svcPortMap[svcPortName] = true
proxier.onEndpointsMapChange(&svcPortName, false)
}

for svcPortName, eps := range newEndpointsMap {
logFormattedEndpoints("endpointsMapChange newEndpointsMap", logLevel, svcPortName, eps)
if proxier.winProxyEbpfMode {
for _, ep := range eps {
if !ep.IsLocal() && proxier.remoteEPsToCleanup[ep.IP()] {
Copy link

Choose a reason for hiding this comment

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

Probably isLocal check is not needed here. ep in remoteEPsToCleanup shouldn't be local per check in line 371. And if at all ep is local and in remoteEPsToCleanup, we would ideally like to remove it from remoteEPsToCleanup?

@@ -348,14 +362,30 @@ func (proxier *Proxier) endpointsMapChange(oldEndpointsMap, newEndpointsMap prox
// This will optimize remote endpoint and loadbalancer deletion based on the annotation
Copy link

Choose a reason for hiding this comment

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

As discussed, please add a comment on when endpointsMapChange gets called.

@aojea
Copy link
Member

aojea commented Apr 15, 2024

/hold

is there a KEP? I can not find it, also windows proxy is not well maintained so we should understand the implications of adding more functionality if there is no commitment from people to maintain it

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kube-proxy cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

4 participants