Skip to content
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

cmd: Disable local node routes when endpoint routes are enabled #28324

Merged

Conversation

gandro
Copy link
Member

@gandro gandro commented Sep 28, 2023

The command-line description of enable-endpoint-routes states: "Use per endpoint routes instead of routing via cilium_host". This description however has not been true: Even with per-endpoint routes enabled, Cilium would still install the local node route (i.e. "routing via cilium_host") unless explicitly disabled.

Not only is the local node route (which installs a single route based on the local pod CIDR) redundant to per-endpoint routes (which installs a route per endpoint), it also does not work on IPAM modes that do not have a local pod CIDR, such as ENI or Azure.

On Azure, GKE, and in the MultiPool CI, we already disabled the local node route explicitly when enabling per-endpoint routes, but in many other cases (ENI, as well as most of our CI (see
github/actions/cilium-config)) we forgot to disable local node routes explicitly when per-endpoint routes are enabled. Therefore, this commit improves UX by automatically disabling the local node route if per-endpoint routes are enabled. This approach was discussed at the Cilium Community meeting on June 7, 2023.

As an alternative to this change, we could also introduce a new tri-mode flag (i.e. "per-endpoint routes", "local node route", "none"), but such a change might introduce unnecessary churn if we decide to remove the local node routes further down the road.

@gandro gandro added area/daemon Impacts operation of the Cilium daemon. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Sep 28, 2023
@gandro gandro requested review from a team as code owners September 28, 2023 14:43
@gandro
Copy link
Member Author

gandro commented Sep 28, 2023

/test

Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helm related changes lgttm ✔️

Copy link
Contributor

@learnitall learnitall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed PR description. The doc changes you included look great, but there is one extra place that I believe still needs an update- similar to the multi-pool IPAM docs:

Configuration
-------------
The following configuration options must be set to run the datapath on GKE:
* ``gke.enabled: true``: Enables the Google Kubernetes Engine (GKE) datapath.
Setting this to ``true`` will enable the following options:
* ``ipam: kubernetes``: Enable :ref:`k8s_hostscope` IPAM
* ``routing-mode: native``: Enable native routing mode
* ``enable-endpoint-routes: true``: Enable per-endpoint routing on the node
* ``enable-local-node-route: false``: Disable installation of the local node route

Can you please update this page and then re-request a review from me?

@gandro
Copy link
Member Author

gandro commented Oct 2, 2023

@learnitall I've updated the highlighted section as follows:

diff --git a/Documentation/network/concepts/routing.rst b/Documentation/network/concepts/routing.rst
index 002407eaa24d..1e912248d477 100644
--- a/Documentation/network/concepts/routing.rst
+++ b/Documentation/network/concepts/routing.rst
@@ -296,7 +296,7 @@ The following configuration options must be set to run the datapath on GKE:
   * ``ipam: kubernetes``: Enable :ref:`k8s_hostscope` IPAM
   * ``routing-mode: native``: Enable native routing mode
   * ``enable-endpoint-routes: true``: Enable per-endpoint routing on the node
-  * ``enable-local-node-route: false``: Disable installation of the local node route
+   (automatically disables the local node route).
  * ``ipv4-native-routing-cidr: x.x.x.x/y``: Set the CIDR in which native routing
   is supported.

@gandro gandro force-pushed the pr/gandro/auto-disable-local-node-routes branch from 7455cbb to 579dcd4 Compare October 2, 2023 09:19
@gandro gandro requested review from learnitall and removed request for youngnick October 2, 2023 09:20
The command-line description of `enable-endpoint-routes` states: "Use
per endpoint routes instead of routing via cilium_host". This
description however has not been true: Even with per-endpoint routes
enabled, Cilium would still install the local node route unless
explicitly disabled.

Not only is the local node route (which installs a single route based on
the local pod CIDR) redundant to per-endpoint routes (which installs a
route per endpoint), it also does not work on IPAM modes that do not
have a local pod CIDR, such as ENI or Azure.

On Azure, GKE, and in the MultiPool CI, we already disabled the local
node route explicitly when enabling per-endpoint routes, but in many
other cases (ENI, as well as most of our CI (see
github/actions/cilium-config)) we forgot to disable local node routes
explicitly when per-endpoint routes are enabled. Therefore, this commit
improves UX by automatically disabling the local node route if
per-endpoint routes are enabled. This approach was discussed at the
Cilium Community meeting on June 7, 2023.

As an alternative to this change, we could also introduce a new tri-mode
flag (i.e. "per-endpoint routes", "local node route", "none"), but such
a change might introduce unnecessary churn if we decide to remove the
local node routes further down the road.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro force-pushed the pr/gandro/auto-disable-local-node-routes branch from 579dcd4 to da9758f Compare October 2, 2023 10:28
@gandro
Copy link
Member Author

gandro commented Oct 2, 2023

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 2, 2023
@gandro gandro merged commit 207eb7a into cilium:main Oct 2, 2023
61 checks passed
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. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants