-
Notifications
You must be signed in to change notification settings - Fork 361
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
SecurityPolicy crd not working correctly with multiple gateway controllers #2520
Comments
the problem might be that both controllers are listening SecurityPolicy and its changes. However, it should filter according targetRef "is this my task" or not. If I shutdown that another controller, things starts to work better. |
thanks for raising this issue, as of today there is no parent for any of the Policies, so every controller can reconcile it, which is the issue you are facing The better solution is to add an optional parent for a Policy, thinking out loud, it should be the controller name (versus GatewayClass name since some policies can attach to a Gatewayclass) similar to what exists in GatewayClass https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.GatewayController |
@arkodg could you help me little bit. I was investigating this and change zetaab@f83a3e9 makes it already work like should. However, there might be race condition if the controllers will reconcile the object in "wrong order". Example: 2 controllers: lets say called internal and external. We have securitypolicy that should be applied only to external controller. If the reconciling order is 1) external 2) internal following will happen:
Anyways it works already better than before. Is it worth of making PR of this, or should I add that new field to securitypolicy and make it possible to configure gatewayClass for securitypolicy object? |
@zetaab the solution here is some sort of partitioning, since we cannot control reconcile order (during restarts etc)
Id recommend trying out 1 for now (which is also better for performance, lesser amount of reconciliation), until we have some consensus on 2 |
looks like there is a better solution upstream
this status is unique per controller (per ancestor which has a controller field) so reconciliation by multiple controllers should be able to update their individual ancestor status without affecting each other |
but that also says:
so basically the another controller is not responsible of that policy at all. So it should not be added as status |
we cannot determine why a controller reconciling a policy targeting a gateway, cannot find the gateway
|
facing the same issue with BTP as in e2e test https://github.com/envoyproxy/gateway/actions/runs/8073622448/job/22057769156?pr=2665#step:6:2130 #2665 introduce merge gateways e2e test, that requires multiple-gatewayclass per controller feature. but this test will affects all the other test cases that have policies attached. because the new gatewayclass in controller will also update the policy status, even the policy is not belong to new GC's. so by fixing #2631, I think this issue can be resolved. assigning myself to these two issues. |
should be fixed by #2802 |
Description:
I have currently two different gateways installed (called internal and external). I am trying to create oidc and jwt SecurityPolicy to internal one. However, some configurations gets applied to external one and the auth itself does not work at all. If I try to create these policies to external one, it will somehow work. After I will apply cognito configurations to internal gateway I can see cognito configurations to be applied to external as well.
Repro steps:
install two different gateway controllers and then https://gist.github.com/zetaab/e70547adb70a8de61765387f36e8c23f
I have currently that configuration applied and I can see following in external envoyproxy (which should be only under internal gateway components):
it does not have any configuration that should be against cognito at all.
Environment:
kube 1.29.1
Logs:
The text was updated successfully, but these errors were encountered: