-
Notifications
You must be signed in to change notification settings - Fork 18
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
Policy engine cleanup #534
Conversation
@zivnevo just heads up |
63c8672
to
1fcd74e
Compare
This is somewhat more than a cleanup - it changes the algorithm for selecting the destination peer for an egress request.
Now we have
While the new algorithm is more coherent and has simpler implementation, we may lose some performance in the (rare?) cases where imports have a large number of sources. @elevran , @kfirtoledo , your thoughts? |
Where do you lose performance? |
One correction is that in step 2, if peer is unreachable, it is not marked as failed, but rather is "delayed". To be more precise, per each egress connection, the load-balancing scheme yields some ordering (or shuffling if you may) of the list of import sources. |
I am ok with the new algorithm, but I'm not really sure about its impact on performance because anyway most of the time is spent on opening a connection to the destination in another cluster. |
1ca7657
to
79ebe1f
Compare
} | ||
// Decide makes allow/deny decisions for the queried connection between src and dest. | ||
// The decision, as well as the deciding policy, is recorded in the returned DestinationDecision struct. | ||
func (pdp *PDP) Decide(src, dest WorkloadAttrs, ns string) (*DestinationDecision, error) { |
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.
q: why is ns
not part of either source or destination attributes?
// Decide makes allow/deny decisions for the queried connection between src and dest. | ||
// The decision, as well as the deciding policy, is recorded in the returned DestinationDecision struct. | ||
func (pdp *PDP) Decide(src, dest WorkloadAttrs, ns string) (*DestinationDecision, error) { | ||
decision := DestinationDecision{Destination: dest} |
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.
nit: are we ok with the default values of the other fields?
I think performance is a secondary concern. A side issue is whether we want to mask failures by retrying internally in the gateway or let the client handle retries the way they see fit by failing to connect. |
This commit moves code from the policyengine package to the authz package. It also includes a re-writing of the load balancer. Signed-off-by: Or Ozeri <oro@il.ibm.com>
No description provided.