cilium: add option to configure service annotation-based dispatch#35064
Merged
cilium: add option to configure service annotation-based dispatch#35064
Conversation
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>
015b66c to
736c60a
Compare
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>
736c60a to
a9e43d6
Compare
Member
Author
|
/test |
Member
julianwiedmann
left a comment
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(see commit desc)