Skip to content

Proposal: Support ECMP route #1188

Description

@yushoyamaguchi

Summary

Add a gws field to the route object in the CNI result to support ECMP (Equal-Cost Multi-Path) routing by allowing multiple next-hop gateways to be specified for a single destination.

Problem

The current route object only supports a single gw field:

{
"dst": "0.0.0.0/0",
"gw": "192.168.1.1"
}

This makes it impossible to express a multipath route at the CNI spec level. To install an ECMP route on Linux, multiple next-hops must be specified in a single route entry (via ip route add ... nexthop via A nexthop via B). There is no way to encode this intent in the currentspec.

Use case

Our use case is as follows:

  • In an OpenStack environment, we create multiple routers connected to the same L2 network.
  • This network is attached to worker VMs.
  • Inside the VM, we attach an additional interface to Pods using ipvlan (as a secondary interface).
  • For this interface, we want to configure ECMP routes where multiple OpenStack routers act as gateways.
Image

This requires the ability to define multiple equal-cost default routes in the configuration.

Proposal

Add an optional gws field (array of IP address strings) to the route
object:

{
"dst": "0.0.0.0/0",
"gws": ["192.168.1.1", "192.168.1.2"]
}

Semantics:

  • When gws is set, the route is installed as a multipath (ECMP) route using all listed next-hops
  • When only gw is set, behaviour is unchanged from today
  • (When both fields being set, it we should discuss how it should be handled)

Backward Compatibility

This is a purely additive, optional field. Existing configurations without gws are unaffected.
Runtimes and plugins that do not understand gws will silently ignore it via standard JSON unmarshaling behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions