Skip to content
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

Configurations not reconciled by Kuadrant operator #234

Open
Boomatang opened this issue Aug 23, 2023 · 5 comments
Open

Configurations not reconciled by Kuadrant operator #234

Boomatang opened this issue Aug 23, 2023 · 5 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@Boomatang
Copy link
Contributor

When kuadrant is configured using an AuthPolicy and RateLimitPolicy CRs, a user can still edit the configurations in the AuthConfig and Limitador CRs. These edits are not reverted by the kuadrant operator and leads to a misalignment in expect configurations.

Solution here would be for the kuadrant operator to monitor changes to the AuthConfig & Limitador CRs and reconcile configuration changes back to what is stated in the AuthPolicy & RateLimitPolicy.

Related Issue:

@Boomatang Boomatang added kind/bug Something isn't working target/current labels Aug 23, 2023
@Boomatang Boomatang changed the title Configurations not recociled on but Kuadrant operator Configurations not recociled by Kuadrant operator Aug 23, 2023
@Boomatang Boomatang self-assigned this Aug 23, 2023
@eguzki
Copy link
Contributor

eguzki commented Aug 23, 2023

This might be hard. If I change the limits of a Limitador CR manually, the operator needs to map a change of a limitador CR to (one or multiple) RLP CRs. This mapping needs to be designed in advance.

One possible implementation would be based on back reference annotations, that is, the Limitador CR has one annotation per RLP which has added configuration to it. When the limitador CR change event is handled, you read the CR and you know all of the RLP's that need to be reconciled. Not saying we must do that, just giving ideas

For authconfig change, it might be easier, because there is one-to-one mapping between authconfig and authpolicy. (easier to implement, but not simpler, though)

@eguzki eguzki changed the title Configurations not recociled by Kuadrant operator Configurations not reconciled by Kuadrant operator Aug 23, 2023
@Boomatang
Copy link
Contributor Author

I have some open questions that would be good to clear up.

  1. Do we expect more than one RPL to be attached to a single HttpRoute?
  2. Are multiple RPLs expected in a single namespace?
  3. Can RPLs attach across namespaces?
  4. what is different about how we handle RPLs that are attached to the gateway?

The same questions would apply to the AuthPolicies.

@guicassolato
Copy link
Contributor

1. Do we expect more than one RPL to be attached to a single HttpRoute?

No.

2. Are multiple RPLs expected in a single namespace?

Yes.

3. Can RPLs attach across namespaces?

No.

4. what is different about how we handle RPLs that are attached to the gateway?

Attaching a policy to a gateway works more or less as a "dynamic shortcut" to targeting all HTTPRoutes attached to and accepted by that gateway.

The RLP controller finds and goes through all those HTTPRoutes, and acts as if the RLP were attached to the routes directly (kinda). The resource that traces back to the policy (through the direct back-ref annotation) is the gateway though; not the route.

Any changes in the topology of the HTTPRoutes and parent gateways must be reconciled by the RLP controller. E.g.: new HTTPRoutes attaching to the gateway, HTTPRoutes that gets the parent gateway removed, or are deleted, etc. (This the "dynamic" part of the "shortcut".)

RLPs that target a gateway cannot specify routeSelectors, meaning all HTTPRouteRules of the HTTPRoute are implicitly selected.

The same questions would apply to the AuthPolicies.

The same principle should apply, although we haven't started working on AuthPolicy v2 yet, and therefore the current state of things might differ from this description.

@Boomatang
Copy link
Contributor Author

When using kuadrant a user is expected to create the RLPs for the required routes and kuadrant configures the limitador CR. Is there anything that would stop a user from configuring a second limitador CR in the name space that is not managed by limitador? If this is possible, is it expected behaviour?

@eguzki
Copy link
Contributor

eguzki commented Aug 24, 2023

Is there anything that would stop a user from configuring a second limitador CR in the name space that is not managed by limitador?

No, there isn't. If the user wants a limitador CR in her/his namespace, there is no conflict with the instance managed by kuadrant's control plane in the kuadrant's namespace. To be clear, the limitador operator is the one reconciling limitador CR's.

PS: There could be a conflict if two limitador instances share the same backend (i.e. redis). Each instance will have it's own limits (given by the Limitador CR), but counters could overlap and conflict.

@alexsnaps alexsnaps moved this to In Progress in Kuadrant Service Protection Sep 12, 2023
@alexsnaps alexsnaps added this to the v0.5.0 milestone Sep 12, 2023
@alexsnaps alexsnaps removed this from the v0.5.0 milestone Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: No status
Status: In Progress
Development

Successfully merging a pull request may close this issue.

4 participants