Skip to content

feat: support dynamic RouteConfiguration expansion for multi-tunnel gateways - #3338

Closed
MircoBarone wants to merge 1 commit into
liqotech:masterfrom
MircoBarone:PR14-multitunnel-gw-node
Closed

MircoBarone wants to merge 1 commit into
liqotech:masterfrom
MircoBarone:PR14-multitunnel-gw-node

Conversation

@MircoBarone

@MircoBarone MircoBarone commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Part of the multi-tunnel WireGuard implementation (8th PR related to #3225).

When managing return traffic from WireGuard gateway interfaces to cluster pods, routing rules are defined in RouteConfiguration resources (e.g., --gw-node and -extcidr). These resources are created during the initial Liqo installation, before peering occurs, and are shared across all gateways.

Previously, these resources used a hardcoded incoming interface (iif: liqo-tunnel).

In a multi-tunnel setup:

  • Each gateway instance may be configured with a different number of WireGuard interfaces.
  • Statically expanding the rules in the shared RouteConfiguration resources is impractical, as it would bloat the resources and require continuous synchronization based on the maximum number of interfaces across all active gateways.

To address this, this PR introduces a dynamic placeholder mechanism (liqo-tunnel*) in the RouteConfiguration resources. Each gateway's RouteConfigurationBinding controller expands the placeholder locally according to its configured number of WireGuard interfaces.

Changes

  • Added the --num-interfaces flag (default: 1) to the gateway container. The value is populated in both gateway client and server templates based on the number of ports.
  • Added validation during gateway startup to ensure --num-interfaces >= 1.
  • Updated internalnode_k8s.go and pod_k8s.go to generate RouteConfiguration resources using iif: liqo-tunnel* instead of the static iif: liqo-tunnel.
  • Extended RouteConfigurationBindingReconciler to store both the tunnel interface prefix and the list of concrete tunnel interface names for the local gateway instance (e.g., liqo-tunnel0, liqo-tunnel1).
  • Introduced expandRules() in RouteConfigurationBindingReconciler.Reconcile() to expand iif: liqo-tunnel* placeholder rules into one rule per local WireGuard interface before applying kernel routing rules and routes.

@adamjensenbot

Copy link
Copy Markdown
Collaborator

Hi @MircoBarone. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • feat: 🚀 New Feature
  • fix: 🐛 Bug Fix
  • refactor: 🧹 Code Refactoring
  • docs: 📝 Documentation
  • style: 💄 Code Style
  • perf: 🐎 Performance Improvement
  • test: ✅ Tests
  • chore: 🚚 Dependencies Management
  • build: 📦 Builds Management
  • ci: 👷 CI/CD
  • revert: ⏪ Reverts Previous Changes

@github-actions github-actions Bot added the feat Adds a new feature to the codebase label Jul 24, 2026
@MircoBarone
MircoBarone force-pushed the PR14-multitunnel-gw-node branch from 1b696fb to 2e1dce5 Compare July 24, 2026 11:03
@MircoBarone
MircoBarone force-pushed the PR14-multitunnel-gw-node branch from 2e1dce5 to ca152d6 Compare July 24, 2026 11:36
- Expand <node>-gw-node and <node>-extcidr routes using a placeholder resolved by the gateway based on interface count
@MircoBarone
MircoBarone force-pushed the PR14-multitunnel-gw-node branch from ca152d6 to ff1fd7c Compare August 19, 2026 18:29
@pull-request-size pull-request-size Bot added size/M and removed size/L labels Aug 19, 2026
@MircoBarone
MircoBarone marked this pull request as draft August 19, 2026 18:38
@MircoBarone
MircoBarone marked this pull request as ready for review August 20, 2026 17:19
@MircoBarone
MircoBarone marked this pull request as draft August 25, 2026 20:21
@MircoBarone

Copy link
Copy Markdown
Contributor Author

Closed in favor of #3363

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

Labels

feat Adds a new feature to the codebase size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants