-
Notifications
You must be signed in to change notification settings - Fork 881
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
Fix for #1739 breaks localPref for different prefix lengths #2345
Comments
Collect logs attached. |
Correction on our configuration, copy and paste error.
|
thanks a lot for raising this! if adv.AggregationLength != newAdv.AggregationLength && adv.AggregationLengthV6 != newAdv.AggregationLengthV6 {
return true
} since both of the AggregationLengthV6 are equal (unspecified) even though you might not care about v6 (I guess not since your pool is v4 only), and we return false later (on something valid for the wrong reasons). Can you try only as a hack for now to specify a different aggregationLengthV6 to your advs as well and see if it reaches a good state? |
@oribon Thanks for the response! Let me work with my team and see if we can test this workaround in the next few days. |
For some clarity when someone takes this: an advertisement for a service (together with its aggregation length) should have at most one localpref defined. The bug mentioned here happens because in the |
@oribon With the above configuration, I am able to apply the BGP advertisement with different 'aggregationLength/aggregationLengthV6' while specifying 'localPref' for a single resource sharing the same IP address pool (default). Can you please help confirm if the above configuration is valid? Should two BGP advertisements sharing the same address pool can contain the same 'localPref'? |
I would be happy to work on this one:) |
@pratik705 yeah it seems fine (as a hack) assuming the pool is v4 only. @AlinaSecret thanks! assigning this to you :) |
@oribon Just want to share my observarions: If I set localPref to same value then it works even with same aggregationLengthV6.[1]
|
That is intended, what shouldn't work is specifying different localprefs for the same advertisement (combined with its aggregation length). What this bug is saying is that a configuration is denied even though the aggregation lengths are different (the v4 ones which are the only ones that matter in this case) - see my other comment or lmk if it's still not clear :) |
Thanks for the info @oribon |
MetalLB Version
0.13.11
Deployment method
Not relevant
Main CNI
Calico
Kubernetes Version
1.26.10
Cluster Distribution
Platform9
Describe the bug
When upgrading from MetalLB v0.13.7 to v0.13.11, our team experienced an issue when applying BGPAdvertisements that resulted in the following error:
This message/fix was introduced in #1820 as a result of the issue described in #1739. That issues provides an example of two BGPAdvertisements using the same aggregationLength of /32 and different localPref values. However, the upstream documentation at https://metallb.universe.tf/configuration/_advanced_bgp_configuration/ claims that different localPref values can be used when the aggregationLength is different.
To Reproduce
To reproduce the issue, one could apply a configuration similar to that described in https://metallb.universe.tf/configuration/_advanced_bgp_configuration/.. Our local configuration looks like the following:
Applying both results in the following:
Expected Behavior
Currently, the code compares localPref values and fails if they're not equal.
https://github.com/metallb/metallb/blob/main/internal/config/config.go#L841-L850
If localPref values can actually be different based on the aggregationLength of the advertisement (same pool), we'd expect no error. If this is not intended behavior, then the documentation at https://metallb.universe.tf/configuration/_advanced_bgp_configuration/ needs to be updated.
Additional Context
N/A
I've read and agree with the following
I've read and agree with the following
The text was updated successfully, but these errors were encountered: