Open
Conversation
Signed-off-by: Ivan Porta <porta.ivan@outlook.com>
Collaborator
|
The 2.18 and edge docs were updated with this PR, but I assume the 2.19 docs need to be updated too? This note in the docs goes back to 2.12. At what point was |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documentation mention that it does not support
trafficDistribution, but we do support it.Summary
If we enable
spec.trafficDistributionfor a Service, Kubernetes will populatehints.forZoneson the correspondingEndpointSliceendpoints. The Destination controller watches these Services resources and processes keep track of the hints. (Source code).At that point,
endpointTranslatorkicks in, specificallyfilterAddresses, and processes endpoints as follows:Reproduction
Consider the following setup:
A Fortio client generating traffic (10 concurrent connections, 100 QPS) deployed on a node in zone apne2-az1.
A simple HTTP echo server with 5 replicas, spread across all (zones) nodes via podAntiAffinity. The Service uses trafficDistribution: PreferSameZone.
The resulting pods look like:
You can also see that the EndpointSlice is populated with hints.forZones by kubernetes, which Linkerd destination will later consume:
If we check the Destination logs, we can see we are hitting the “hints” path in endpointTranslator:
For convenience, I used the Linkerd Dashboard to visualize the traffic:
Even with 10 parallel connections at 100 QPS, all traffic flows to simple-app-v1-658f5cffc4-fhsnf, which is deployed in the same zone as the client (apne2-az1).
If we remove trafficDistribution: PreferSameZone from the Service, the zone becomes empty in Destination logs and endpointTranslator falls back to returning all endpoints. In this case (because I enabled and then disabled trafficDistribution), the logs show:
As result the traffic is spread across all available endpoints.
Reference: