recorded decision · public · no signup
KEP-5100: [RETROACTIVE] DSR and Overlay support in Windows kube-proxy
What was chosen
Constraints
- Overlay networking mode is not compatible with dualstack networking on Windows.adr ↗
- Overlay networking mode cannot be disabled on a per-node basis, as all cluster nodes must use the same network type.adr ↗
- Overlay networking mode is required for network policy support with some CNI solutions on Windows nodes.adr ↗
- Overlay networking mode requires the Host Network Service (HNS) network to be of type `Overlay` before kube-proxy starts.adr ↗
Consequences
- If overlay networking and dualstack are enabled, IP address space will be downgraded to IPv4 only.adr ↗
- Enabling or disabling DSR support requires restarting kube-proxy, causing a brief network traffic disruption.adr ↗
- DSR support reduces load on the Host Network Service and decreases latency for client requests.adr ↗
The recorded why
KEP-5100: [RETROACTIVE] DSR and Overlay support in Windows kube-proxy
<!-- This is the title of your KEP. Keep it short, simple, and descriptive. A good title can help communicate what the KEP is and should be considered as part of any review. --> <!-- A table of contents is helpful for quickly jumping to sections of a KEP and for highlighting any additional information provided beyond the standard KEP template. Ensure the TOC is wrapped with <code><!-- toc --&rt;<!-- /toc --&rt;</code> tags, and then generate with `hack/update-toc.sh`. --> <!-- toc -->- Release Signoff Checklist
- Summary
- Motivation
- Proposal
- Design Details
- Production Readiness Review Questionnaire
- Implementation History
- Drawbacks
- Alternatives
- Infrastructure Needed (Optional)
§ Release Signoff Checklist
<!-- **ACTION REQUIRED:** In order to merge code into a release, there must be an issue in [kubernetes/enhancements] referencing this KEP and targeting a release milestone **before the [Enhancement Freeze](https://git.k8s.io/sig-release/releases) of the targeted release**. For enhancements that make changes to code or processes/procedures in core Kubernetes—i.e., [kubernetes/kubernetes], we require the following Release Signoff checklist to be completed. Check these off as they are completed for the Release Team to track. These checklist items _must_ be updated for the enhancement to be released. -->Items marked with (R) are required prior to targeting to a milestone / release.
- (R) Enhancement issue in release milestone, which links to KEP dir in kubernetes/enhancements (not the initial KEP PR)
- (R) KEP approvers have approved the KEP status as
implementable - (R) Design details are appropriately documented
- (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
- e2e Tests for all Beta API Operations (endpoints)
- (R) Ensure GA e2e tests meet requirements for Conformance Tests
- (R) Minimum Two Week Window for GA e2e tests to prove flake free
- (R) Graduation criteria is in place
- (R) all GA Endpoints must be hit by Conformance Tests
- (R) Production readiness review completed
- (R) Production readiness review approved
- "Implementation History" section is up-to-date for milestone
- User-facing documentation has been created in kubernetes/website, for publication to kubernetes.io
- Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
§ Summary
<!-- This section is incredibly important for producing high-quality, user-focused documentation such as release notes or a development roadmap. It should be possible to collect this information before implementation begins, in order to avoid requiring implementors to split their attention between writing release notes and implementing the feature itself. KEP editors and SIG Docs should help to ensure that the tone and content of the `Summary` section is useful for a wide audience. A good summary is probably at least a paragraph in length. Both in this section and below, follow the guidelines of the [documentation style guide]. In particular, wrap lines to a reasonable length, to make it easier for reviewers to cite specific portions, and to minimize diff churn on updates. [documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md -->Add support for DSR (Direct Server Return) and Overlay networking mode support for Windows kube-proxy.
Support for both of these features was added in K8s v1.14 without a KEP. This KEP is to retroactively document the changes made to Windows kube-proxy to support these features and provide a path for promoting these features to GA.
§ Motivation
<!-- This section is for explicitly listing the motivation, goals, and non-goals of this KEP. Describe why the change is important and the benefits to users. The motivation section can optionally provide links to [experience reports] to demonstrate the interest in a KEP within the wider Kubernetes community. [experience reports]: https://github.com/golang/go/wiki/ExperienceReports -->DSR support was added to Windows Server 2019 as part of the May 2020 update. DSR provides performance optimizations by allowing the return traffic routed through load balancers to bypass the load balancer and respond directly to the client; reducing load on the load balancer and also reducing overall latency. More information on DSR on Windows can be found here.
Overlay networking mode is a common networking mode used in Kubernetes clusters and is required by some for some important scenarios like network policy support with Calico CNI. Adding support for overlay networking mode in Windows kube-proxy will allow users to use more CNI solutions with Windows nodes.
Goals
<!-- List the specific goals of the KEP. What is it trying to achieve? How will we know that this has succeeded? -->Enable DSR and overlay networking on Windows nodes running kube-proxy in Kubernetes clusters.
Non-Goals
<!-- What is out of scope for this KEP? Listing non-goals helps to focus discussion and make progress. -->§ Proposal
<!-- This is where we get down to the specifics of what the proposal actually is. This should have enough detail that reviewers can understand exactly what you're proposing, but should not include things like API designs or implementation. What is the desired outcome and how do we measure success?. The "Design Details" section below is for the real nitty-gritty. -->DSR and Overlay networking mode support is already implemented in Windows kube-proxy and has been extensively tested in the Windows CI pipeline. This proposal is to promote the existing implementations to GA.
Additionally, DSR support on Windows is supported on both EKS and AKS. Both DSR and overlay networking support have been used in the Windows CI pipelines running release-informing jobs since K8s v1.20.
User Stories (Optional)
<!-- Detail the things that people will be able to do if this KEP is implemented. Include as much detail as possible so that people can understand the "how" of the system. The goal here is to make this feel real for users without getting bogged down. -->Story 1
As a cluster administrator, I want to enable DSR functionality on Windows nodes in order to reduce load in the Host Network Service and reduce latency for client requests.
Story 2
As a cluster administrator, I want to be able to enable network policy on Windows nodes which requires overlay networking mode support in kube-proxy for some CNI solutions.
Notes/Constraints/Caveats (Optional)
<!-- What are the caveats to the proposal? What are some important details that didn't come across above? Go in to as much detail as necessary here. This might be a good place to talk about core concepts and how they relate. -->Overlay networking mode is not compatible with dualstack networking on Windows.
If kube-proxy is started with both overlay networking mode and dualstack networking enabled, a warning message will be added and ip address space with be downgraded to ipv4 only. This is existing behavior and has not caused any reported issues.
Risks and Mitigations
<!-- What are the risks of this proposal, and how do we mitigate? Think broadly. For example, consider both security and how this will impact the larger Kubernetes ecosystem. How will security be reviewed, and by whom? How will UX be reviewed, and by whom? Consider including folks who also work outside the SIG or subproject. -->Enabling DSR and overlay networking mode support in Windows kube-proxy both have very little risk.
For DSR, the Windows Host Network Service handles all of the logic for managing network traffic; kube-proxy only needs to specify if DSR should be used when creating/sycing load balancer rules. Additionally, DSR must be enabled with a kube-proxy command switch (--enable-dsr=true) disabling DSR is can be performed by redeploying kube-proxy on Windows nodes.
Overlay networking support in Windows has been used in the Windows CI pipelines running release-informing capz-windows-master jobs since K8s v1.20.
§ Design Details
<!-- This section should contain enough information that the specifics of your change are understandable. This may include API specs (though not always required) or even code snippets. If there's any ambiguity about HOW your proposal will be implemented, this is the place to discuss them. -->Since the functionality is already implemented, the design details section will cover the current implementation.
DSR Enablement
DSR is enabled by passing --enable-dsr=true as a command line switch to the Windows kube-proxy.
Prior to GA, kube-proxy will ensure that WinDSR=true is specified in the feature-gates and will fail to start if DSR is enabled without that.
Checks for terminating and service endpoints handle DSR traffic differently than non-DSR traffic to adhere to behavior defined in KEP-1669: Proxy Terminating Endpoints
- Local endpoints will be skipped when determining if all endpoints for a service are terminated if DSR is enabled and service type is load balancer.
- Non-local endpoints will be skipped when considering if all endpoints for a service are non-serving if DSR is enabled and service type is load balancer.
Flags passed to HNS (Host Networking Service) calls used for the following operators will be updated to include a flag indicating if DSR is enabled for all get, create, and update loadbalancer HNS calls.
Overlay support
To enable overlay networking on Windows nodes, HNS network created on the node prior to starting kube-proxy and specified by $KUBE_NETWORK should be of type Overlay.
Prior to GA WinOverlay=true must be specified in the kube-proxy feature gates.
If the specified network is of type Overlay and the the feature gate is not set, kube-proxy will log an error and fail to start.
Addintionally, in overlay networking node, kube-proxy needs to know the source IP address of the traffic it is proxying by setting --source-vip=$sourceVIP on the kube-proxy command line.
Creating the endpoint varries by CNI implementation and here are two examples:
- For Flannel, the endpoint is created prior to starting kube-proxy like in this example
- For Calico, the endpoint is crated by the node agent and queried by name prior to starting kube-proxy like in this example
Once kube-proxy is running in overlay networking mode, the specified source VIP will sometimes be used on in load balancer policy rules based on the backend endpoints using the following logic:
a) Backend endpoints are any IP's outside the cluster ==> Choose Node's IP as the source VIP b) Backend endpoints are IP addresses of a remote node => Choose Node's IP as the source VIP c) Everything else (Local POD's, Remote POD's, Node IP of current Node) ==> Choose the specified source VIP
Everything else is handled by the Windows HNS.
Test Plan
<!-- **Note:** *Not required until targeted at a release.* The goal is to ensure that we don't accept enhancements with inadequate testing. All code is expected to have adequate tests (eventually with coverage expectations). Please adhere to the [Kubernetes testing guidelines][testing-guidelines] when drafting this test plan. [testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md -->[x] I/we understand the owners of the involved components may require updates to existing tests to make this code solid enough prior to committing the changes necessary to implement this enhancement.
Prerequisite testing updates
<!-- Based on reviewers feedback describe what additional tests need to be added prior implementing this enhancement to ensure the enhancements have also solid foundations. -->Unit tests
<!-- In principle every added code should have complete unit test coverage, so providing the exact set of tests will not bring additional value. However, if complete unit test coverage is not possible, explain the reason of it together with explanation why this is acceptable. --> <!-- Additionally, for Alpha try to enumerate the core package you will be touching to implement this enhancement and provide the current unit coverage for those in the form of: - <package>: <date> - <current test coverage> The data can be easily read from: https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit This can inform certain test coverage improvements that we want to do before extending the production code to implement this enhancement. -->Kube-proxy for Windows must run on Windows machines so coverage is not reported in ci-kubernetes-coverage-unit. This coverage data was run manually on a Windows Server 2022 machine:
- k8s.io/kubernetes/pkg/proxy/winkernel: 2025-02-11 - 58.8% of statements
Integration tests
<!-- Integration tests are contained in k8s.io/kubernetes/test/integration. Integration tests allow control of the configuration parameters used to start the binaries under test. This is different from e2e tests which do not allow configuration of parameters. Doing this allows testing non-default options and multiple different and potentially conflicting command line options. --> <!-- This question should be filled when targeting a release. For Alpha, describe what tests will be added to ensure proper quality of the enhancement. For Beta and GA, add links to added tests together with links to k8s-triage for those tests: https://storage.googleapis.com/k8s-triage/index.html -->Functionality described in this KEP require Windows nodes and are primarily validated with unit and e2e tests. The Kubernetes project does not currently have support for running integration tests for Windows specific code-paths.
e2e tests
<!-- This question should be filled when targeting a release. For Alpha, describe what tests will be added to ensure proper quality of the enhancement. For Beta and GA, add links to added tests together with links to k8s-triage for those tests: https://storage.googleapis.com/k8s-triage/index.html We expect no non-infra related flakes in the last month as a GA graduation criteria. -->All Windows nodes running kube-proxy in https://testgrid.k8s.io/sig-windows-master-release#capz-windows-master have DSR and overlay networking configured.
Graduation Criteria
<!-- **Note:** *Not requirExcerpt — the full document is at the cited source: keps/sig-windows/5100-windows-dsr-and-overlay-support/README.md ↗