Skip to content

Conversation

@Fredi-raspall
Copy link
Contributor

@Fredi-raspall Fredi-raspall commented Dec 15, 2025

On top of #1126

@Fredi-raspall Fredi-raspall requested a review from a team as a code owner December 15, 2025 18:04
@Fredi-raspall Fredi-raspall requested review from qmonnet and removed request for a team December 15, 2025 18:04
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/multigw_failover branch 3 times, most recently from 61eb9b4 to 427604c Compare December 15, 2025 22:07
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch from 3e5f0b3 to 52aee41 Compare December 16, 2025 11:16
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/multigw_failover branch 3 times, most recently from e51f49f to 65ecf36 Compare December 16, 2025 14:47
Copy link
Contributor

@mvachhar mvachhar left a comment

Choose a reason for hiding this comment

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

This looks fine but we need a k8s implementation since #1146 cuts us over to k8s by default for vlab tests and we'll cut over shortly to agentless mode everywhere.

@mvachhar
Copy link
Contributor

There are some clippy lints that ought to be addressed. Also, for gRPC we should update the fuzzers in gateway-proto for the new fields before this merges. I've added dont't merge to this PR until someone verifies that those fuzzers were added.

@mvachhar mvachhar added the dont-merge Do not merge this Pull Request label Dec 16, 2025
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/multigw_failover branch from 65ecf36 to 9329e28 Compare December 16, 2025 15:04
@Fredi-raspall Fredi-raspall added dont-merge Do not merge this Pull Request and removed dont-merge Do not merge this Pull Request labels Dec 16, 2025
@Fredi-raspall
Copy link
Contributor Author

There are some clippy lints that ought to be addressed. Also, for gRPC we should update the fuzzers in gateway-proto for the new fields before this merges. I've added dont't merge to this PR until someone verifies that those fuzzers were added.

You probably mean fuzzers for k8s?

@Fredi-raspall
Copy link
Contributor Author

This looks fine but we need a k8s implementation since #1136 cuts us over to k8s by default for vlab tests and we'll cut over shortly to agentless mode everywhere.

You probably mean #1146 ?

@mvachhar
Copy link
Contributor

This looks fine but we need a k8s implementation since #1136 cuts us over to k8s by default for vlab tests and we'll cut over shortly to agentless mode everywhere.

You probably mean #1146 ?

Yep, fixed my comment.

@mvachhar
Copy link
Contributor

There are some clippy lints that ought to be addressed. Also, for gRPC we should update the fuzzers in gateway-proto for the new fields before this merges. I've added dont't merge to this PR until someone verifies that those fuzzers were added.

You probably mean fuzzers for k8s?

No, there are fuzzer generators for gRPC in gateway-proto that should be updated. We can skip that if we roll in the k8s stuff here I suppose.

@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/multigw_failover branch from 82484d3 to 1f36e23 Compare December 16, 2025 21:27
Adds a tiny crate to set the gateway name in a static
variable that can be set only once. The name will be
set either from the cmd line arguments or by retrieving
the hostname from the OS.

Signed-off-by: Fredi Raspall <[email protected]>
The argument, currently optional, will allow setting the name of
the gateway.

Signed-off-by: Fredi Raspall <[email protected]>
Augment LaunchConfiguration with GeneralConfigSection that may
include general, global settings.

Signed-off-by: Fredi Raspall <[email protected]>
Set the gateway name from the cmd line --name argument.
If no --name is provided, set the gateway name from the hostname
provided by the OS. Fail to start if the gatway name cannot be set.

With this, the gateway name defaults to the hostname but can always
be overriden with --name.

Signed-off-by: Fredi Raspall <[email protected]>
Adds a fixture so that we can annotate tests such that
we make sure that the gateway name is seen as set from
those tests. Sample:

    #[test]
    #[wrap(with_gw_name())]
    fn test_potato() {
        let gw_name = get_gw_name().unwrap();
        println!("Hello {gw_name}");
    }

This is Daniel's.

Signed-off-by: Fredi Raspall <[email protected]>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch from bcccd52 to 7ac3866 Compare December 16, 2025 21:28
This does not change the behavior of the configuration, but will
allow adding more functionality later on.

Signed-off-by: Fredi Raspall <[email protected]>
Extend the BGP Community type to be able to hold a community as
a string.

Signed-off-by: Fredi Raspall <[email protected]>
This commits augments the configuration model and code with the
new grpc version that includes new configurations to
support HA with multiple gateways. This includes:
  - grpc v0.19.0 and
  - gateway v0.32.0 (k8s interface)

There was no way to make all these changes across multiple commits.

Summary of changes:
   1) configuration includes a list of gateway groups. A gateway
     group (identified by a name), represents a set of gateways. For
     each member in the set, a gateway group contains:
       - name of gateway
       - priority within the group
       - ipaddress of the gateway (loopback interface)
   2) the configuration also includes a priority-to-community map.
     This map indicates the BGP community to use network-wide
     depending on nodes' priorities.
   3) Note: the priority in a group is DECOUPLED from the priority
     in the community table. Group priorities only express ordering;
     i.e. their absolute value only matters in relation to other
     priorities. They are simply used to order gateways in a group
     in terms of preference or importance. That ordering (position)
     is what determines the community with which prefix peerings
     should be advertised.
   4) Vpc peerings are augmented with the name of a gateway group.
     From that gateway group, the name of the gateway and its
     position within the group, and the community table, we
     determine whether the gw should advertise a prefix and
     with what community.

Signed-off-by: Fredi Raspall <[email protected]>
Extend the route-map for advertising routes in a VPC so that
routes get tagged with communities.

Signed-off-by: Fredi Raspall <[email protected]>
Signed-off-by: Fredi Raspall <[email protected]>
Some configuration objects related to addresses contain a mask
length which is unnecessary. Add methods to attempt to convert
those anyway, ignoring the mask.

Signed-off-by: Fredi Raspall <[email protected]>
Do not fail if no community has been specified.
We relax this for the time being in order to test.

Signed-off-by: Fredi Raspall <[email protected]>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/multigw_failover branch from 1f36e23 to 7b6868b Compare December 16, 2025 21:38
Base automatically changed from pr/fredi/gwname_cmdline to main December 16, 2025 23:14
Comment on lines 353 to 357
#[test]
#[traced_test]
#[wrap(with_gw_name())]
#[allow(clippy::too_many_lines)]
fn test_full_config() {
Copy link
Member

Choose a reason for hiding this comment

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

Could we call let _ = set_gw_name("test-gw"); at the beginning of function build_sample_config() in the same file instead, please? This would avoid adding the wrapping for each test.

Same for stateless NAT test (there's just one test at the moment, but I'm adding new ones).

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

Labels

dont-merge Do not merge this Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants