Skip to content

Conversation

aroradaman
Copy link
Member

@aroradaman aroradaman commented Oct 7, 2025

Picking up from #4964

  • One-line PR description: Service acceleration for Kube-proxy using netfilter’s flowtable infrastructure
  • Other comments:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/network Categorizes an issue or PR as relevant to SIG Network. labels Oct 7, 2025
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 7, 2025
@aroradaman
Copy link
Member Author

/assign @danwinship @aojea
/cc @adrianmoisey

aojea and others added 2 commits October 8, 2025 21:58
Use the kernel flowtables infrastructure to allow kube-proxy users to
accelerate service traffic.

Change-Id: Iee638c8e86a4d17ddbdb30901b4fb4fd20e7dbda
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aroradaman
Once this PR has been reviewed and has the lgtm label, please ask for approval from aojea and additionally assign wojtek-t for approval. For more information see the 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

@danwinship
Copy link
Contributor

So I still have the same concern I had before: there is no reason given for limiting this to only Service traffic. Of course, the reason the earlier KEP proposed it that way is because kube-proxy was the only place where SIG Network could insert this code (even though it barely interacted with the rest of kube-proxy). But, as Calico already demonstrated, a network plugin could implement the same functionality for both Service and non-Service traffic, without needing anything from kube-proxy. (In fact, it would want to disable kube-proxy's own offloading.)

Given that we are now planning to make kindnet a SIG Network project, I think the right answer is to implement offload there. But apparently we already do implement it there, so mission accomplished?

(The other possibility is to add a "usage hint" field to Service, which kube-proxy could then take advantage of to know that certain kinds of optimizations, like offload, were useful, kubernetes/kubernetes#127259 (comment). Then it would make sense to implement offload in kube-proxy, for Services that were hinted in a way that indicated they'd benefit from it.)

@adrianmoisey
Copy link
Member

(The other possibility is to add a "usage hint" field to Service, which kube-proxy could then take advantage of to know that certain kinds of optimizations, like offload, were useful, kubernetes/kubernetes#127259 (comment). Then it would make sense to implement offload in kube-proxy, for Services that were hinted in a way that indicated they'd benefit from it.)

I like this idea.
My concern with the current proposal, is that if I want to change how this feature works, it requires me configuring kube-proxy, something we normally don't do often.
Accessing this feature via the Services API would be nicer, and give more control.

Signed-off-by: Daman Arora <[email protected]>

### Service API Extension

Users can set the `TrafficHint` field to opt in to fastpath acceleration for a Service. In the future, this field can also be leveraged to enable other dataplane optimizations
Copy link
Member

Choose a reason for hiding this comment

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

I very much like the opt-in nature of this. If users ignore the feature, nothing changes.

// TrafficHint indicates the expected traffic behavior of a Service.
// Service implementations may use this hint to apply dataplane optimizations, which can vary
// depending on the type of optimization and the technology used to program the dataplane.
type TrafficHint string
Copy link
Member

Choose a reason for hiding this comment

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

Is there any need to leave space in the API to allow for configuration?
I don't know what the future holds with other expansions here, but what if other modes require settings?
For example: with LongLived, may be we need to configure how long before it takes the fast path?
Or with a reduced conntrack timeout, it may need a configuration as to how long

My question here may come with a lot of inexperience, so it may not be valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that while writing this, but realised it will make the Service API too complicated.

I think we can use gateway-api later to have different types of services maybe separate kinds for LondLivedService, or ShortLivedService and specs for each kind can have configurable attributes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will defer to @danwinship @aojea @thockin for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants