-
Notifications
You must be signed in to change notification settings - Fork 3.4k
cilium: add NodePortBindProtection to allow for opting out bind rejection #11188
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
Conversation
…tion Add an agent knob for expert users who wish to run backend Pods on the same ports as the NodePort service is exposed. We recently resolved this by making cgroup BPF hooks netns aware in the kernel and Cilium via work from d7bf451 ("bpf: fix init namespace handling in sock lb programs"). This works for 5.7 kernels. However, if there is a need for older kernels to deploy Pods in this way (or to opt out of the bind hooks entirely for different reasons), then one can control this setting through --node-port-bind-protection. The knob defaults to true (same as we do today), so that expert users can opt-out from it if they need to. With bind protection enabled: # ./daemon/cilium-agent [...] # bpftool cgroup tree CgroupPath ID AttachType AttachFlags Name /sys/fs/cgroup/unified 48126 connect4 48122 connect6 48127 post_bind4 <---+ bind prevention enabled by default 48123 post_bind6 <---` 48128 sendmsg4 48124 sendmsg6 48129 recvmsg4 48125 recvmsg6 [...] With bind protection disabled: # ./daemon/cilium-agent [...] --node-port-bind-protection=false # bpftool cgroup tree CgroupPath ID AttachType AttachFlags Name /sys/fs/cgroup/unified 49607 connect4 49604 connect6 49608 sendmsg4 49605 sendmsg6 49609 recvmsg4 49606 recvmsg6 [...] Reported-by: Rene Zbinden <rene.zbinden@postfinance.ch> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Please set the appropriate release note label. |
3 similar comments
Please set the appropriate release note label. |
Please set the appropriate release note label. |
Please set the appropriate release note label. |
test-docs-please |
test-me-please |
e8c6936
to
ecd8050
Compare
test-me-please |
restart-gke |
Hit #10118 on GKE |
test-gke |
test-gke |
From GKE CI:
|
test-gke |
Hit #10231 on GKE |
test-gke |
I'm probably missing some context, but is this still needed once #11210 is merged? Or is this still needed for pods in the host network? |
Yes , if users really want to opt-out on older kernels where this feature is not available. |
(All tests green, GKE one is randomly flaking & failing in unrelated areas. Only updating the doc nit from Tobias right now. GKE tests are running 4.14.138 kernel which does not run BPF nodeport anyway.) |
Add related documentation and options for helm to aid configuration for the bindProtection setting. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
ecd8050
to
3da5425
Compare
test-docs-please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this requires backport?
See commit msg