-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Cilium native hostport only listens on a internal IP, unlike CNI portmap #12116
Copy link
Copy link
Closed
Labels
area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.Impacts bpf/ or low-level forwarding details, including map management and monitor messages.kind/bugThis is a bug in the Cilium logic.This is a bug in the Cilium logic.kind/community-reportThis was reported by a user in the Cilium community, eg via Slack.This was reported by a user in the Cilium community, eg via Slack.priority/highThis is considered vital to an upcoming release.This is considered vital to an upcoming release.
Metadata
Metadata
Labels
area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.Impacts bpf/ or low-level forwarding details, including map management and monitor messages.kind/bugThis is a bug in the Cilium logic.This is a bug in the Cilium logic.kind/community-reportThis was reported by a user in the Cilium community, eg via Slack.This was reported by a user in the Cilium community, eg via Slack.priority/highThis is considered vital to an upcoming release.This is considered vital to an upcoming release.
Bug report
Cilium v1.8 release candidates include a native bpf hostport feature to replace CNI portmap chaining (#10359) implemented in #10592. In testing, it seems this feature is a partial implementation of CNI portmap.
When CNI portmap is used in a CNI conflist (with any CNI provider, not just Cilium), Kubernetes Pods that set a hostPort proxy any traffic on that host port to the container.
For example, a PodSpec above would allow the web app to be accessed via multiple host IPs - hostPort maps multiple interface addresses (unless a single hostIP is set https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#containerport-v1-core).
In Cilium v1.8.0-rc3 the hostport feature works as described in docs, but its always picking the node's own internal IP, which doesn't satisfy the use cases CNI portmap had.
So its not a bug per-se, more that the implementation isn't a drop-in for CNI portmap yet, unless the node's internal IP is the only address you are interested in. (imo) Most uses of CNI portmap to support containers with hostPort are using it to listen on any of the available host addresses.
For myself, I have to fallback to certain pods that could use hostPort to just using full hostNetwork.
General Information