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
Extract tunnel options to simplify override, and inject them through hive #29051
Conversation
/test |
ec18ab2
to
7a6ed14
Compare
/test |
Marking ready for review, to start gathering feedback. Please ignore the first commit, as it is a stripped down version of #29053, which should be merged first. |
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.
ci-structure 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.
LGTM, thanks! Left a comment but don't let it block merging.
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.
Loader changes 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.
One log message nitpick, and one question wrt to upgrade behaviour. Both could be addressed as follow-on PR if needed. Otherwise lgtm, thank you very much Marco!
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! Just a non-blocking newbie question.
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.
@giorio94 Nice work Marco!
7a6ed14
to
e1f729b
Compare
Rebased onto main and dropped the temporary commit. Additionally added a new commit extending the upgrade notes to document the behavioral difference with respect to Cilium configured in native routing mode with DSR Geneve enabled. |
/test |
e1f729b
to
7ee3b3a
Compare
Fixed a test failing due to a mismatch of integer types. |
/ci-runtime |
/test |
Certain features (e.g., egress gateway, high-scale ipcache, ...) require the configuration of the tunnel device also then the primary routing mode is set to native routing, as some traffic may need to flow through it. Currently, every affected code path needs ad-hoc checks, which is getting more and more complex with the addition of new features. This commit consolidates the tunnel-related options, that is protocol, port, device name and whether it requires MTU adaptation, into a single struct, initialized based on the user configuration and the requests of additional features, and propagated through hive. Specifically, different modules can now request the configuration of the tunnel device (regardless of the primary routing mode) through the injection of the appropriate enabler object. Additional validation constraints can be specified if a given feature is compatible only with a specific encapsulation protocol. This change introduces a small functional difference, because now the tunnel protocol flag is always respected, and no longer defaulted to geneve when Cilium is configured in native routing mode, and DSR Geneve is enabled. This prevents causing unexpected tunnel changes when turning on/off other features (DSR Geneve in this case). The primary routing mode is still represented by the TunnelingEnabled() function, both to reduce the scope of this change and because it is currently accessed also before the initialization of the hive. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Historically, the tunnel protocol was defaulted to geneve when Cilium was configured in native routing mode and DSR Geneve was enabled. This is no longer the case since the last commit, and the tunnel protocol flag is now always respected (possibly triggering an error if incompatible), so that we don't cause unexpected tunnel changes when turning on/off other features. Hence, let's document in the upgrade notes that users now need to explicitly configure the tunnel protocol to geneve when using DSR Geneve. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
7ee3b3a
to
1397972
Compare
Rebased onto main to fix conflict |
/test |
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.
@giorio94 Thanks for the updates!
Note that Marco wrote up a draft for how we could do auto-selection of the tunnel protocol in some scenarios: #29267. Let's continue any discussion there. |
Reflect the config change from cilium#29051 in the kubeproxy-free docs for DSR-Geneve. Fixes: cilium#30845 Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Certain features (e.g., egress gateway, high-scale ipcache, ...) require
the configuration of the tunnel device also then the primary routing
mode is set to native routing, as some traffic may need to flow through
it. Currently, every affected code path needs ad-hoc checks, which is
getting more and more complex with the addition of new features.
This commit consolidates the tunnel-related options, that is protocol,
port, device name and whether it requires MTU adaptation, into a single
struct, initialized based on the user configuration and the requests of
additional features, and propagated through hive. Specifically, different
modules can now request the configuration of the tunnel device (regardless
of the primary routing mode) through the injection of the appropriate
enabler object. Additional validation constraints can be specified if a
given feature is compatible only with a specific encapsulation protocol.
This change introduces a small functional difference, because now the
tunnel protocol flag is always respected, and no longer defaulted to
geneve when Cilium is configured in native routing mode, and DSR
Geneve is enabled. This prevents causing unexpected tunnel changes
when turning on/off other features (DSR Geneve in this case).
The primary routing mode is still represented by the TunnelingEnabled()
function, both to reduce the scope of this change and because it is
currently accessed also before the initialization of the hive.
Fixes: #25769
Depends on: #29053