-
Notifications
You must be signed in to change notification settings - Fork 6
Multi-gateway & Failover #1144
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
base: main
Are you sure you want to change the base?
Multi-gateway & Failover #1144
Conversation
61eb9b4 to
427604c
Compare
3e5f0b3 to
52aee41
Compare
e51f49f to
65ecf36
Compare
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.
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.
|
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. |
65ecf36 to
9329e28
Compare
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. |
82484d3 to
1f36e23
Compare
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]>
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]>
Signed-off-by: Fredi Raspall <[email protected]>
bcccd52 to
7ac3866
Compare
Signed-off-by: Fredi Raspall <[email protected]>
Signed-off-by: Fredi Raspall <[email protected]>
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]>
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]>
Signed-off-by: Fredi Raspall <[email protected]>
1f36e23 to
7b6868b
Compare
| #[test] | ||
| #[traced_test] | ||
| #[wrap(with_gw_name())] | ||
| #[allow(clippy::too_many_lines)] | ||
| fn test_full_config() { |
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.
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).
On top of #1126