-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BPF] BPFExcludeCIDRsFromNAT allows excluding service IPs from being NATed #8338
Merged
marvin-tigera
merged 1 commit into
projectcalico:master
from
tomastigera:tomas-bpf-node-local-dns
Dec 21, 2023
Merged
[BPF] BPFExcludeCIDRsFromNAT allows excluding service IPs from being NATed #8338
marvin-tigera
merged 1 commit into
projectcalico:master
from
tomastigera:tomas-bpf-node-local-dns
Dec 21, 2023
Conversation
This file contains 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
marvin-tigera
added
release-note-required
Change has user-facing impact (no matter how small)
docs-pr-required
Change is not yet documented
labels
Dec 14, 2023
tomastigera
force-pushed
the
tomas-bpf-node-local-dns
branch
4 times, most recently
from
December 15, 2023 21:19
b5c7cb6
to
3e0c863
Compare
fasaxc
requested changes
Dec 20, 2023
…g NATed The main use case is node-local dns cache. In iptables mode with k8s provided kube-proxy, the cache installs such iptables rules that snatch the traffic before the kube-proxy rules, which would do the NAT. However, in ebpf NAT is done way before packets may hit iptables. Often they do not hit iptables at all. Therefore, we need to tell our kube-proxy, not to translate a service IP that we want to let dns cache to process. Unfortunatelly, we cannot annotate the service as the annotations are not propagate to the kube-proxy code by the k8s front-end. To setup a node-local dns cache, set BPFExcludeCIDRsFromNAT as follows: kubedns=`kubectl get svc kube-dns -n kube-system -o jsonpath={.spec.clusterIP}` BPFExcludeCIDRsFromNAT=$kubedns
tomastigera
force-pushed
the
tomas-bpf-node-local-dns
branch
from
December 20, 2023 19:19
3e0c863
to
5b3058a
Compare
tomastigera
changed the title
[BPF] BPFExcludeIPsFromNAT allows excluding service IPs from being NATed
[BPF] BPFExcludeCIDRsFromNAT allows excluding service IPs from being NATed
Dec 20, 2023
/merge-when-ready |
OK, I will merge the pull request when it's ready, leave the commits as is when I merge it, and leave the branch after I've merged it. |
fasaxc
approved these changes
Dec 21, 2023
3 tasks
tomastigera
added a commit
that referenced
this pull request
Feb 2, 2024
…v3.27 [release-v3.27] Auto pick #8338: BPFExcludeCIDRsFromNAT allows excluding service CIDRs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
docs-pr-required
Change is not yet documented
merge-when-ready
release-note-required
Change has user-facing impact (no matter how small)
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.
The main use case is node-local dns cache. In iptables mode with k8s provided kube-proxy, the cache installs such iptables rules that snatch the traffic before the kube-proxy rules, which would do the NAT.
However, in ebpf NAT is done way before packets may hit iptables. Often they do not hit iptables at all. Therefore, we need to tell our kube-proxy, not to translate a service IP that we want to let dns cache to process.
Unfortunatelly, we cannot annotate the service as the annotations are not propagate to the kube-proxy code by the k8s front-end.
To setup a node-local dns cache, set BPFExcludeCIDRsFromNAT as follows:
kubedns=
kubectl get svc kube-dns -n kube-system -o jsonpath={.spec.clusterIP}
BPFExcludeCIDRsFromNAT=$kubedns
fixes #4689
Description
Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.