Skip to content

Conversation

borkmann
Copy link
Member

(see commit desc)

@borkmann borkmann added area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/misc This PR makes changes that have no direct user impact. labels Sep 27, 2024
Add a new mode to Cilium's service handling which is similar to hybrid
SNAT/DSR but opts into DSR based on the user's annotation in the service
object.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
The nodeport_uses_dsr{4,6}() will be extended in upcoming commit to also
pass in the service object. The latter is not available in below scenarios,
therefore remove them for now. This only affects when DSR was enabled before
which is not in majority of cases. Side-effect is that hybrid mode adds more
SNAT entries when it detects a conflict. We need to see if this can later be
resurrected through different means.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Remove useless bpf-lb-dsr-l4-xlate as the non-default "backend" variant
never worked out in practive and noone ended up using it. "frontend" is
default and thus functionality-wise there are no changes.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
@borkmann borkmann force-pushed the pr/svc-dispatch2 branch 5 times, most recently from 015b66c to 736c60a Compare September 27, 2024 14:37
@borkmann borkmann marked this pull request as ready for review September 27, 2024 14:39
@borkmann borkmann requested review from a team as code owners September 27, 2024 14:39
Copy link
Contributor

@learnitall learnitall left a comment

Choose a reason for hiding this comment

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

🚀

Add a new mode to Cilium's service handling which is similar to hybrid
SNAT/DSR but opts into DSR based on the user's annotation in the service
object. The following Cilium agent settings need to be set:

  --bpf-lb-mode=annotation
  --bpf-lb-acceleration=native
  --bpf-lb-dsr-dispatch=ipip
  --devices=xyz

By default this will use SNAT for service handling, unless a service is
specifically annotated to do otherwise:

  apiVersion: v1
  kind: Service
  metadata:
    name: service-red
    namespace: example
    labels:
      color: red
    annotations:
      "service.cilium.io/type": "LoadBalancer"
      "service.cilium.io/mode": "dsr"
  spec:
    type: LoadBalancer
    ports:
    - port: 1234

Then, for the service DSR with IPIP dispatching will be used instead.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Add a small section into our KPR guide.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
@borkmann
Copy link
Member Author

/test

Copy link
Member

@brb brb left a comment

Choose a reason for hiding this comment

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

Nice!

@borkmann borkmann added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 27, 2024
@borkmann borkmann merged commit 188352a into main Sep 27, 2024
261 of 262 checks passed
@borkmann borkmann deleted the pr/svc-dispatch2 branch September 27, 2024 22:49
@maintainer-s-little-helper maintainer-s-little-helper bot removed ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Sep 27, 2024
Copy link
Member

@julianwiedmann julianwiedmann left a comment

Choose a reason for hiding this comment

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

Late to the party, but trying to stay in the loop for when I need to touch it next :)

joamaki added a commit to joamaki/cilium that referenced this pull request May 14, 2025
This ports the service forwarding mode annotation to the new control-plane
(cilium#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 14, 2025
This ports the service forwarding mode annotation to the new control-plane
(cilium#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 14, 2025
This ports the service forwarding mode annotation to the new control-plane
(cilium#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 15, 2025
This ports the service forwarding mode annotation to the new control-plane
(cilium#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki added a commit to joamaki/cilium that referenced this pull request May 19, 2025
This ports the service forwarding mode annotation to the new control-plane
(cilium#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request May 21, 2025
This ports the service forwarding mode annotation to the new control-plane
(#35064).

Signed-off-by: Jussi Maki <jussi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants