-
Notifications
You must be signed in to change notification settings - Fork 138
Document bpfKubeProxyHealthzPort conflict when kube-proxy cannot be disabled #2575
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,6 +185,38 @@ kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyIptable | |
|
|
||
| If both `kube-proxy` and `BPFKubeProxyIptablesCleanupEnabled` is enabled then `kube-proxy` will write its iptables rules and Felix will try to clean them up resulting in iptables flapping between the two. | ||
|
|
||
| You should also set `bpfKubeProxyHealthzPort` to `0` to disable the health check server in $[prodname]'s BPF kube-proxy replacement, which by default binds to port 10256 and would conflict with the Kubernetes `kube-proxy` already running on the node. The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. | ||
|
|
||
| ```bash | ||
| kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyHealthzPort": 0}}' | ||
| ``` | ||
|
|
||
| ### MKE: Change the VXLAN port before enabling eBPF | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this PR includes changes from the other PR #2574 . Can you separate them? |
||
|
|
||
| :::caution | ||
|
|
||
| MKE uses Docker Swarm overlay networking, which creates VXLAN devices on UDP port 4789 inside Docker network namespaces. | ||
| When $[prodname] switches to eBPF mode on kernels where BTF is available (typically v5.8+), Felix creates the `vxlan.calico` device in | ||
| flow mode, which acts as a catch-all on its UDP port. The kernel rejects this when another VXLAN device (Docker Swarm's) | ||
| already holds the same port, causing `vxlan.calico` to stay DOWN with `address already in use` errors. | ||
|
|
||
| **You must change the VXLAN port before enabling eBPF on MKE clusters:** | ||
|
|
||
| ```bash | ||
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | ||
| ``` | ||
|
|
||
| Wait for all calico-node pods to recreate the VXLAN device on the new port, then verify on each node: | ||
|
|
||
| ```bash | ||
| kubectl exec -n calico-system <calico-node-pod> -- ip -d link show vxlan.calico | ||
| ``` | ||
|
|
||
| Confirm the device shows `dstport 4790` (or your chosen port) and is UP before proceeding. | ||
| Ensure that the chosen UDP port is allowed by your underlying network between all nodes. | ||
|
|
||
| ::: | ||
|
|
||
| ### Enable eBPF mode | ||
|
|
||
| To enable eBPF mode, change the `spec.calicoNetwork.linuxDataplane` parameter in the operator's `Installation` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,21 @@ can do that by setting `--kube-proxy-mode=disabled` and `--kube-default-drop-mas | |
|
|
||
| More details can be found in [the MKE documentation](https://docs.mirantis.com/mke/current/install/predeployment/configure-networking/cluster-service-networking-options.html) | ||
|
|
||
| :::caution VXLAN port conflict | ||
|
|
||
| MKE's Docker Swarm overlay networking uses UDP port 4789 for its own VXLAN devices. In eBPF mode, when BTF is available on the node (typically kernel v5.8+), | ||
| $[prodname] creates the `vxlan.calico` device in flow mode, which conflicts with Docker Swarm's use of the same port. | ||
| You must change the VXLAN port before enabling eBPF: | ||
|
|
||
| ```bash | ||
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | ||
| ``` | ||
|
Comment on lines
+178
to
+186
|
||
|
|
||
| Ensure the chosen UDP port is allowed by your underlying network between all nodes. | ||
| See [Troubleshoot eBPF mode](troubleshoot-ebpf.mdx#mke-vxlan-device-down) for more details. | ||
|
|
||
| ::: | ||
|
|
||
| </TabItem> | ||
|
|
||
| </Tabs> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -185,6 +185,38 @@ kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyIptable | |||||
|
|
||||||
| If both `kube-proxy` and `BPFKubeProxyIptablesCleanupEnabled` is enabled then `kube-proxy` will write its iptables rules and Felix will try to clean them up resulting in iptables flapping between the two. | ||||||
|
|
||||||
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258; note that 10257 may be used by containerd). | ||||||
|
||||||
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258; note that 10257 may be used by containerd). | |
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258), avoid typical Kubernetes reserved ports such as 10257 and 10259, and verify port availability by checking which ports are currently in use on your nodes. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -175,6 +175,21 @@ can do that by setting `--kube-proxy-mode=disabled` and `--kube-default-drop-mas | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| More details can be found in [the MKE documentation](https://docs.mirantis.com/mke/current/install/predeployment/configure-networking/cluster-service-networking-options.html) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| :::caution VXLAN port conflict | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| MKE's Docker Swarm overlay networking uses UDP port 4789 for its own VXLAN devices. In eBPF mode, when BTF is available on the node (typically kernel v5.8+), | ||||||||||||||||||||||||||||||||
| $[prodname] creates the `vxlan.calico` device in flow mode, which conflicts with Docker Swarm's use of the same port. | ||||||||||||||||||||||||||||||||
| You must change the VXLAN port before enabling eBPF: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | ||||||||||||||||||||||||||||||||
|
Comment on lines
+182
to
+185
|
||||||||||||||||||||||||||||||||
| You must change the VXLAN port before enabling eBPF: | |
| ```bash | |
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | |
| You must configure $[prodname] to use a different VXLAN port after installing the Tigera Operator and Calico CRDs, but before enabling eBPF. For example: | |
| ```bash | |
| cat <<EOF | kubectl apply -f - | |
| apiVersion: crd.projectcalico.org/v1 | |
| kind: FelixConfiguration | |
| metadata: | |
| name: default | |
| spec: | |
| vxlanPort: 4790 | |
| EOF |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,6 +326,38 @@ kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyIptable | |
|
|
||
| If both `kube-proxy` and `BPFKubeProxyIptablesCleanupEnabled` is enabled then `kube-proxy` will write its iptables rules and Felix will try to clean them up resulting in iptables flapping between the two. | ||
|
|
||
| You should also set `bpfKubeProxyHealthzPort` to `0` to disable the health check server in $[prodname]'s BPF kube-proxy replacement, which by default binds to port 10256 and would conflict with the Kubernetes `kube-proxy` already running on the node. The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. | ||
|
|
||
| ``` | ||
| kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyHealthzPort": 0}}' | ||
| ``` | ||
|
Comment on lines
+329
to
+333
|
||
|
|
||
| ### MKE: Change the VXLAN port before enabling eBPF | ||
|
|
||
| :::caution | ||
|
|
||
| MKE uses Docker Swarm overlay networking, which creates VXLAN devices on UDP port 4789 inside Docker network namespaces. | ||
| When $[prodname] switches to eBPF mode on kernels where BTF is available (typically v5.8+), Felix creates the `vxlan.calico` device in | ||
| flow mode, which acts as a catch-all on its UDP port. The kernel rejects this when another VXLAN device (Docker Swarm's) | ||
| already holds the same port, causing `vxlan.calico` to stay DOWN with `address already in use` errors. | ||
|
|
||
| **You must change the VXLAN port before enabling eBPF on MKE clusters:** | ||
|
|
||
| ```bash | ||
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | ||
| ``` | ||
|
|
||
| Wait for all calico-node pods to recreate the VXLAN device on the new port, then verify on each node: | ||
|
|
||
| ```bash | ||
| kubectl exec -n calico-system <calico-node-pod> -- ip -d link show vxlan.calico | ||
| ``` | ||
|
|
||
| Confirm the device shows `dstport 4790` (or your chosen port) and is UP before proceeding. | ||
| Ensure that the chosen UDP port is allowed by your underlying network between all nodes. | ||
|
|
||
| ::: | ||
|
|
||
| ### Enable eBPF mode | ||
|
|
||
| **The next step depends on whether you installed $[prodname] using the operator, or a manifest:** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -203,6 +203,21 @@ can do that by setting `--kube-proxy-mode=disabled` and `--kube-default-drop-mas | |
|
|
||
| More details can be found in [the MKE documentation](https://docs.mirantis.com/mke/current/install/predeployment/configure-networking/cluster-service-networking-options.html) | ||
|
|
||
| :::caution VXLAN port conflict | ||
|
|
||
| MKE's Docker Swarm overlay networking uses UDP port 4789 for its own VXLAN devices. In eBPF mode, when BTF is available on the node (typically kernel v5.8+), | ||
| $[prodname] creates the `vxlan.calico` device in flow mode, which conflicts with Docker Swarm's use of the same port. | ||
| You must change the VXLAN port before enabling eBPF: | ||
|
|
||
| ```bash | ||
| kubectl patch felixconfiguration default --type merge -p '{"spec":{"vxlanPort":4790}}' | ||
| ``` | ||
|
Comment on lines
+206
to
+214
|
||
|
|
||
| Ensure the chosen UDP port is allowed by your underlying network between all nodes. | ||
| See [Troubleshoot eBPF mode](troubleshoot-ebpf.mdx#mke-vxlan-device-down) for more details. | ||
|
|
||
| ::: | ||
|
|
||
| </TabItem> | ||
|
|
||
| </Tabs> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -318,6 +318,12 @@ kubectl patch felixconfiguration default --patch='{"spec": {"bpfKubeProxyIptable | |||||
|
|
||||||
| If both `kube-proxy` and `BPFKubeProxyIptablesCleanupEnabled` is enabled then `kube-proxy` will write its iptables rules and Felix will try to clean them up resulting in iptables flapping between the two. | ||||||
|
|
||||||
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258; note that 10257 may be used by containerd). | ||||||
|
||||||
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258; note that 10257 may be used by containerd). | |
| You should also change `bpfKubeProxyHealthzPort` to an unused port to avoid conflicting with the Kubernetes `kube-proxy`'s default health check port (10256). The Kubernetes `kube-proxy` can serve the health check equally well, so there is no degradation. Changing the health check port of the Kubernetes `kube-proxy` is typically not possible on managed platforms such as AKS. Choose a port that is not already in use on your nodes (for example, 10258); note that other Kubernetes control plane components commonly use ports such as 10257 and 10259, so verify an unused port on your nodes with tools like `ss` or `netstat` before selecting one. |
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.
This states that
bpfKubeProxyHealthzPort: 0disables the embedded health check server, but the generated Felix config reference (calico-enterprise/_includes/components/FelixConfig/config-params.json) currently documents this parameter only as an integer port and does not mention0as a disable value. Please add a version/feature gate note (and link) for when0is supported, or change the guidance to selecting an unused port (as in the versioned docs).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.
@tomastigera Is this valid?