-
Notifications
You must be signed in to change notification settings - Fork 934
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
Per-project uplink IP quotas #14631
Per-project uplink IP quotas #14631
Conversation
c83d52d
to
d9df773
Compare
d9df773
to
ad6e23d
Compare
@minaelee Thanks for the early review, every comment was addressed as you suggested. |
Thanks! Sorry, I missed that it was marked as Draft. Looks great! |
ad6e23d
to
cf466fa
Compare
@tomponline @markylaing Some observations on this:
Manual tests are looking fine so far so I am opening this for review, feel free to look whenever you are able. |
I think we should have separate ipv4 and ipv6 quotas as the routes on the uplinks are defined per protocol. |
I'm not quite following here. We aren't checking if IPs are being taken away from other networks, but rather whether the quota for the project that the IP usage has exceeded the quota. For any managed networks in the default project they should still be limited by the quota set on the default project (which is likely to be nothing).
I think that probably makes sense. The default project has features.networks so that should be fine. |
Let's make this a topic for our one to one tomorrow so I can better explain. |
Going back to draft to implement suggested changes. |
1a05029
to
41d59cd
Compare
41d59cd
to
1b11281
Compare
This originally contained tests for canonical/lxd#14631, but we moved the tests to the lxd ovn test suite and this was repurposed to just fix a wrong string that refers to a bridge network as physical.
8cd98b6
to
d630e2a
Compare
This factors out common logic for allocating uplink addresses to network forwards and load balancers. Pre-requisite for #14631
2c3824c
to
3cc7b25
Compare
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
We check for the current uplink IP usage on the validator function for two reasons: - Show a more informative error message in case the provided value is not appropriate. - Avoing doing the expensive computation of uplink IP usage unless a config key was provided for a valid uplink network. Signed-off-by: hamistao <[email protected]>
… to projects Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
This is useful to prevent newly created ovn networks to exceed the allowed quota for uplink IPs in its project Signed-off-by: hamistao <[email protected]>
Signed-off-by: hamistao <[email protected]>
It has a couple lines of unrelated tests thrown in as well, such as testing a forward/load-balancer can't use listen addresses outside uplink routes. Signed-off-by: hamistao <[email protected]>
3cc7b25
to
2e5ca4f
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.
Thanks!
…#14867) As discussed in #14631 (comment). Changes to LXD CI tests will probably be needed in order to reflect these changes. Pre-requisite for #14882, for the sole reason I used the `checkUplinkUse` in my follow up implementation.
// shortdesc: Quota of IPv4 addresses from a specified uplink network that can be used by entities in this project | ||
projectConfigKeys["limits.networks.uplink_ips.ipv6."+networkName] = validate.Optional(uplinkIPLimitValidator(s, projectName, networkName, "ipv6")) |
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.
Caught while writing weekly news, there is a typo in short description: IPv4
-> IPv6
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.
Thanks for catching this, will fix in a minute
Introduces per-network project uplink IP limits, adding a
limits.networks.uplink_ips.NETWORK_NAME
configuration key to projects.This config key defines the maximum value of IPs made available on a network named NETWORK_NAME to be assigned as uplink IPs for entities inside a cetain project.