Adding weights to service entry endpoints#704
Conversation
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rshriram, ymesika The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@ymesika: changing LGTM is restricted to assignees, and only istio/api repo collaborators may be assigned issues. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
|
||
| // The load balancing weight associated with the endpoint. Endpoints | ||
| // with higher weights will receive proportionally higher traffic. | ||
| uint32 weight = 6; |
There was a problem hiding this comment.
How does this work in conjunction with route destination weights? When do you use which?
There was a problem hiding this comment.
Route destination weights are for a set of endpoints.. a service version etc. This is within an envoy cluster (i.e. a route destination if you will), where you can have one single service instance receive more traffic than other service instances in the same version.
The weights here are used in the multicluster scenario where you use the ingress gateway address as the endpoint for a host (foo.ns1.global) in the remote cluster. If the service is present in many clusters, then you would have multiple ingrss gateway endpoints here. In such a scenario, we need a way to specify the weight associated with each gateway (proportional to the number of pods of that service in that cluster).
ZackButcher
left a comment
There was a problem hiding this comment.
LGTM but this is just a proxy for the Envoy endpoint weight field then we should say something about the allowed values (1 to 128) in the comment on the field.
|
|
||
| // The load balancing weight associated with the endpoint. Endpoints | ||
| // with higher weights will receive proportionally higher traffic. | ||
| uint32 weight = 6; |
There was a problem hiding this comment.
Didn't Envoy just go through a whole exercise in defining multi-dimensional weights for load balancing? Should we use the same here?
There was a problem hiding this comment.
And to answer my own question: not yet. They still use a uint32 today, and must be in the range 1-128. We should probably add a comment about the allowed range here.
There was a problem hiding this comment.
we can normalize in code across all endpoints in a cluster. No point in asking users to normalize
|
|
||
| // The load balancing weight associated with the endpoint. Endpoints | ||
| // with higher weights will receive proportionally higher traffic. | ||
| uint32 weight = 6; |
There was a problem hiding this comment.
Doesn't make sense - why would the weight be associated with the ServiceEntry ( the full set of endpoints) ? I think it needs to be part of the endpoint.
There was a problem hiding this comment.
Sorry, missed the indentation.
/lgtm
|
I see this has been merged already, but isn't the weight here actually capacity? If this is meant to be used to show how many Endpoints are behind a Gateway. |
|
Yep. The weight here is capacity. But the term weight is more well understood - service has N endpoints each with a different weight. |
* add dynamic state to attribute list Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * Adding weights to service entry endpoints Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * undo
* Adding weights to service entry endpoints (#704) * add dynamic state to attribute list Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * Adding weights to service entry endpoints Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * undo * update protolock Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
…stio#706) * Adding weights to service entry endpoints (istio#704) * add dynamic state to attribute list Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * Adding weights to service entry endpoints Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> * undo * update protolock Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
The endpoint weights correspond to Envoy's LB endpoint weights. This will allow service entries for remote cluster endpoints to carry weights.
Signed-off-by: Shriram Rajagopalan shriramr@vmware.com