-
Notifications
You must be signed in to change notification settings - Fork 2
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
controller: reconciliation workflows #9
Conversation
Introduces new reconciler abstractions `Dispatcher` and `Subscriber`: * `Dispatcher`: runs an optional precondition reconciliation function and then dispatches the reconciliation event to a list of subsequent reconcilers. * `Subscriber`: calls the reconciler function of the first subscription that matches the event Additionally: - controller topology was also simplified: no longer stored with the controller, since it's currently being rebuilt at every event (this can change in the future) - propagation of a new ResourceEvent struct through reconciliation calls: stores info about the API resource, event type (create/update/delete), old and new objects - kuadrant controller example updated to leverage the changes above: - new reconciliation workflow: 1. log event 2. save topology to file 3. effective policies 4. (gateway deleted) delete SecurityPolicy / (other events) reconcile SecurityPolicies 4. (gateway deleted) delete AuthorizationPolicy / (other events) reconcile AuthorizationPolicies - reconcilers moved to an internal package examples/kuadrant/reconcilers - docs: envoy gateway and multiple gateway providers docs moved to examples/kuadrant/docs - fix bug in the build of Istio AuthorizationPolicy rules: missing HTTPRoute hostnames Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
gwapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" | ||
|
||
"github.com/kuadrant/policy-machinery/machinery" | ||
|
||
kuadrantapis "github.com/kuadrant/policy-machinery/examples/kuadrant/apis" | ||
) | ||
|
||
var ( | ||
RateLimitPolicyKind = schema.GroupKind{Group: SchemeGroupVersion.Group, Kind: "RateLimit"} |
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.
RateLimitPolicyKind = schema.GroupKind{Group: SchemeGroupVersion.Group, Kind: "RateLimit"} | |
RateLimitPolicyKind = schema.GroupKind{Group: SchemeGroupVersion.Group, Kind: "RateLimitPolicy"} |
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.
Time to start writing tests 😜
Signed-off-by: Guilherme Cassolato <[email protected]>
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.
Verified both envoy-gateway.md
and multiple-gateway-providers.md
are working as expected.
Looks good to me 👍
Introduces new reconciler abstractions
Workflow
andSubscriber
:Workflow
: runs an optional precondition reconciliation function, then dispatches the reconciliation event to a list of concurrent reconciliation tasks, and runs an optional postcondition reconciliation function.Subscriber
: calls the reconciler function of the first subscription that matches the event (resource, event type, object name)Additionally:
examples/kuadrant/reconcilers
examples/kuadrant/docs