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
cilium: bpf-based hostport implementation #10592
Merged
Merged
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
borkmann
added
wip
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
area/daemon
Impacts operation of the Cilium daemon.
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
labels
Mar 16, 2020
borkmann
added this to In progress (1.8)
in 1.9 kube-proxy removal & general dp optimization
Mar 16, 2020
tklauser
reviewed
Mar 16, 2020
borkmann
force-pushed
the
pr/bpf-host-port
branch
4 times, most recently
from
March 16, 2020 21:39
ae0add1
to
1da3d05
Compare
borkmann
changed the title
cilium: bpf-based hostport implementation [wip]
cilium: bpf-based hostport implementation
Mar 16, 2020
test-me-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 16, 2020 22:48
1da3d05
to
279ca43
Compare
test-me-please |
test-docs-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 16, 2020 23:20
279ca43
to
6bbc8c2
Compare
test-docs-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 17, 2020 20:42
59221bc
to
c4d9f1a
Compare
test-docs-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 17, 2020 21:17
c4d9f1a
to
e02b3bc
Compare
test-me-please |
test-docs-please |
test-me-please |
joestringer
approved these changes
Mar 18, 2020
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 18, 2020 12:23
e02b3bc
to
830c317
Compare
test-me-please |
test-docs-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 18, 2020 12:39
830c317
to
3baae90
Compare
test-me-please |
test-docs-please |
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 18, 2020 17:09
3baae90
to
19cac1e
Compare
(prior docs test was green) |
test-me-please |
(prior travis ci was green, x86 is green here, arm64 flaky in unrelated spot) |
In order to use hostPort today, users can only consume it via deploying Cilium through --set global.cni.chainingMode=portmap in order to then have iptables set up for each pod that specifies a hostPort. We almost have all the BPF infrastructure in place for natively supporting BPF based hostPort. This work implements the hostPort feature as a service mapping. It is part of the kube-proxy-free implementation since it depends on NodePort infrastructure. Example: # ./daemon/cilium-agent --identity-allocation-mode=crd --enable-ipv6=true --enable-ipv4=true --disable-envoy-version-check=true --tunnel=disabled --k8s-kubeconfig-path=$HOME/.kube/config --kube-proxy-replacement=strict --enable-l7-proxy=false # cat hostport.yaml apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80 hostPort: 90 # kubectl apply -f ./hostport.yaml pod/nginx created # ./cilium/cilium service list ID Frontend Service Type Backend 1 10.96.0.1:443 ClusterIP 1 => 192.168.178.29:6443 2 10.96.0.10:53 ClusterIP 1 => 10.29.6.103:53 2 => 10.29.24.228:53 3 10.96.0.10:9153 ClusterIP 1 => 10.29.6.103:9153 2 => 10.29.24.228:9153 4 192.168.178.29:90 HostPort 1 => 10.29.245.35:80 From own node: # curl 192.168.178.29:90 <!DOCTYPE html> <html> <head> [...] From remote node: root@tank:~# curl 192.168.178.29:90 <!DOCTYPE html> <html> <head> [...] The HostPort implementation is a hybrid of ClusterIP and NodePort in terms of implementation in that making it reachable on the own node is just a single service map entry (as opposed to further exposing it via loopback address, etc) and for external traffic the backend is always local to the node and can be mapped from any port. Fixes: #10359 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Document the new HostPort mapping feature under the advanced section and add Helm support for it. I've also added a small setup validation as I think it's quite useful. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Add connectivity test cases from internal and external. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann
force-pushed
the
pr/bpf-host-port
branch
from
March 18, 2020 20:32
19cac1e
to
7616447
Compare
test-me-please |
borkmann
moved this from In progress (1.8)
to Done
in 1.9 kube-proxy removal & general dp optimization
Mar 18, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/daemon
Impacts operation of the Cilium daemon.
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
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 msg.
This change is