Skip to content

Conversation

@tico88612
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

Some users want independent variables and hope to be able to configure them like tunnelProtocol.

Which issue(s) this PR fixes:

Fixes #12541

Does this PR introduce a user-facing change?:

Add cilium_routing_mode independent variable for Cilium routingMode

Some users want independent variables and hope to be able to configure
them like `tunnelProtocol`.

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 29, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 29, 2025
@tico88612
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhkarimi1383, tico88612

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@VannTen
Copy link
Contributor

VannTen commented Oct 6, 2025

At this point can't we just have a values-overrides thing which we'd feed directly to cilium cli ?

@mhkarimi1383
Copy link

At this point can't we just have a values-overrides thing which we'd feed directly to cilium cli ?

If we have tunnel_mode we should have routing_mode too since they are related, But we need some place to be able to pass some values/params in raw

@mhkarimi1383
Copy link

I'm unable to use kubespray without custom patch applied every time

It is a needed thing to set in some cases and it makes the kubespray unusable

identityAllocationMode: {{ cilium_identity_allocation_mode }}

routingMode: {{ cilium_routing_mode }}

Choose a reason for hiding this comment

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

if cilium_routing_mode is native, we should skip routingMode: {{ cilium_routing_mode }} entirely, otherwise, cilium complains.

Choose a reason for hiding this comment

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

I this should be allowed here and should be passed directly to cilium, for example if cilium introduce a new feature or something like that we can't handle, I think keeping this simple is a better approach

Copy link
Member Author

Choose a reason for hiding this comment

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

@ayoubfaouzi Why? If you skip this, that's not working. routingMode default is tunnel.

Choose a reason for hiding this comment

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

Oh sorry, what I wanted to say was, when I deployed kubespray with cilium as CNI, I want to use native routing mode, so no tunneling. I modified cilium_tunnel_mode to disabled as in the doc.

However cilium kept complaining about disabled, looks like it did not get it (should be only vxlan or geneve), so I had to edit the cm and completely get rid of cilium_tunnel_mode and add routing-mode: native.

Copy link
Member Author

@tico88612 tico88612 Oct 9, 2025

Choose a reason for hiding this comment

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

Or maybe you try an empty string? the cilium docs said cilium_tunnel_mode only accepted "", "vxlan", "geneve"

Choose a reason for hiding this comment

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

Yes, I am on same boat. cilium_tunnel_mode only accept vxlan or geneve. I tried empty string which started throwing errors.

For now I just kept tunnel-protocol to vxlan. Hope its acceptable value with routing mode native.

@VannTen
Copy link
Contributor

VannTen commented Oct 9, 2025

I don't understand why we'd need this when we already have cilium_extra_values. Isn't that enough to pass stuff to cilium-cli ?

@mhkarimi1383
Copy link

I don't understand why we'd need this when we already have cilium_extra_values. Isn't that enough to pass stuff to cilium-cli ?

It is needed as we have a separate variable for tunnelProtocol
They are needed together

@VannTen
Copy link
Contributor

VannTen commented Oct 9, 2025

The fact that one variable exists is not justification enough to add another one.
Is there a dependency between the two ? (as in, the value of one depend on the other)

From what I can see, the values.yml.j2 has already started duplicating the values of the helm chart, which is a nightmare for maintainability.

@tico88612 Am I missing something here ? The file feeded to cilium-cli looks like it has very little logic in it, basically just translate ansible variables into cilium-cli values.

(In that case we should IMHO stop adding to it and just use the extra values stuff which is already there).

@tico88612
Copy link
Member Author

To the best of my knowledge, for the existing variable cilium_tunnel_mode to be effective, cilium_routing_mode must be set to tunnel (which happens to be the official Cilium default).
However, some users set cilium_routing_mode to native, in which case cilium_tunnel_mode needs to be changed to an empty string. It can be said that there is a dependency between them.

That said, there are still some alternative approaches, which would end up looking like this:

cilium_tunnel_mode: ""

cilium_extra_values:
  routingMode: "native"

TBH, I'm actually quite hesitant about this point, and I don't want it to become another copied helm values.

@satishdotpatel
Copy link

I have used following setting to activate routing mode native.

cilium_config_extra_vars:
  routing-mode: "native"

This is what my current config view looks

# cilium config view | grep -e tunnel -e native
ipv4-native-routing-cidr                          10.233.0.0/16
routing-mode                                      native
tunnel-protocol                                   vxlan
tunnel-source-port-range                          0-0

Question, does this confuse cilium that routing mode is native but tunnel-protocol is vxlan so routing may create issue in future? I didn't find a way to delete tunnel-protocol flag using kubespray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a specific var for changing cilium routing mode

6 participants