Conversation
b15a1b3 to
2f8af02
Compare
2f8af02 to
e6350b4
Compare
1dc1dc5 to
6e33de7
Compare
|
Test run on 19/03: Endpointslices for the above application: Port-forwarded a routesrv pod, this pod's zone is set to eu-central-1c Response This returns the correct set of Endpoints. But when I got the same set of endpoints when I queried for Updated JTBD: Updated Tasks:
|
|
Test run on 20/3: The application has the following: Results: /routes/eu-central-1b - returns 3 endpoints as expected /routes/eu-central-1c - returns 6 endpoints as expected Context Currently dataclient does not do filtering based on zone. There should be two code paths:
JTBD When I configure skipper to use dataclient directly (without routesrv) in a multi-zone Kubernetes cluster / I want the dataclient to filter endpoints by my configured zone with threshold-based fallback / So that my skipper instance gets zone-aware routes without needing routesrv as an intermediary When I configure routesrv to use dataclient to serve zone-specific routes / I want the dataclient to return all endpoints with zone metadata unfiltered / So that routesrv can perform dynamic per-request zone filtering based on the requested zone Tasks
|
8f58563 to
751dc5e
Compare
dataclients/kubernetes/testdata/ingressV1/zone-aware-traffic/all-zones-topology-zone-b.eskip
Outdated
Show resolved
Hide resolved
dataclients/kubernetes/testdata/ingressV1/zone-aware-traffic/all-zones-3-addr.eskip
Outdated
Show resolved
Hide resolved
dataclients/kubernetes/testdata/routegroups/zone-aware-traffic/all-zones-differrent-zone.eskip
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| eps = state.GetEndpointsByService(ic.zone, ns, svcName, protocol, servicePort) | ||
| if state.enableEndpointSlices { |
There was a problem hiding this comment.
Kubernetes deprecated endpoints in favor of endpointslices and we used this switch only to enable it when it was more recent.
I think we can get rid of this.
Let's do the cleanup in a different PR.
szuecs
left a comment
There was a problem hiding this comment.
some small changes should be enough
751dc5e to
e7d1884
Compare
|
👍 |
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de> Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
- update formatAndSet to filter based on zone
- update ServeHTTP based on zone
- add handler for `/routes/{zone}`
- add testcase - only 1 has been added; currently it fails (potentially we are losing zone information when LoadAll() is called)
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
- update filtering logic - todo: add more test cases Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
…ts if the condition endpoints >= minEndpoints is met - update logic in ServeHTTP - return all zone unaware endpoints if the above condition is not met - add one more test case - currently failing need to check Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
…d zoneUnaware endpoints - fix route construction in ingress - update formatAndSet() to only store shallow copies of the route - add test cases Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
…quality check works Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
…one metadata - Ensure route construction always creates LBEndpoints with zone labels - Implement threshold-based zone filtering in routesrv when serving routes - Update expectations of testing zone-aware-routing in dataclient Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
d935e61 to
3a72be5
Compare
|
rebased on master |
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
|
👍 |
MustafaSaber
left a comment
There was a problem hiding this comment.
I did one run, but I think I need to have another deeper run after discussion.
dataclients/kubernetes/testdata/ingressV1/zone-aware-traffic/all-zones-3-addr.eskip
Outdated
Show resolved
Hide resolved
dataclients/kubernetes/testdata/ingressV1/zone-aware-traffic/all-zones-topology-zone-b.eskip
Outdated
Show resolved
Hide resolved
dataclients/kubernetes/testdata/routegroups/zone-aware-traffic/all-zones-3-addr.eskip
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| func eqStrings(left, right []string) bool { | ||
| func eqLBEndpoints(left, right []*LBEndpoint) bool { |
There was a problem hiding this comment.
maybe this should be just another function? This is more of a general one while we change to more specific one, or we can implement string for LBEndpoint and just use it.
There was a problem hiding this comment.
We cannot have LBEndpoint as string because we need zone information, unless I misunderstood this.
There was a problem hiding this comment.
It's an internal function and if it is not in use anymore we can drop it.
| return result | ||
| } | ||
|
|
||
| func LBEndpointString(eps []*LBEndpoint) []string { |
There was a problem hiding this comment.
Since we sort, why not just implement Sting and use eqString?
There was a problem hiding this comment.
String() on what and how to you suggest to use it?
We have a String() in LBEndpoint and use it in LBEndpointString(), so what is the suggestion?
There was a problem hiding this comment.
What I meant is something like
type LBEndpoints []*LBEndpoint
func (eps LBEndpoints) String() string {
if len(sl) == 0 {
return ""
}
return strings.Join(sl, ", ")
}
func (ep LBEndpoint) String() string {
return fmt.Sprintf("%s/%s", ep.Zone, ep.Address)
}So we can just run eqStrings(lc.LBEndpoints.String(), rc.LBEndpoints.String()) but if eqStrings is internal and not used anywhere else then it's fine to delete.
There was a problem hiding this comment.
eqStrings is not used anywhere.
|
|
||
| type LBEndpoint struct { | ||
| Address string | ||
| Zone string |
There was a problem hiding this comment.
We don't seem to use this anywhere in this package
There was a problem hiding this comment.
see routesrv, the problem is that dataclients.LoadAll() returns []*eskip.Routes and to pass around zone information by endpoint we need to have this struct for routesrv.
Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
|
Somewhere in the merge process this PR got messed up, I do not see changes from this PR here :/ |
|
|
||
| for i := range left { | ||
| if left[i] != right[i] { | ||
| if left[i].Address != right[i].Address || left[i].Zone != right[i].Zone { |
There was a problem hiding this comment.
unrelated question.
is that situation possible - left[i].Address == right[i].Address && left[i].Zone != right[i].Zone?
There was a problem hiding this comment.
I do not think this is possible, because each pod gets assigned a unique IP within a cluster and a pod exists in a zone. Probably this could come if there is stale data, i.e. a pod dies, new one comes and there is some time with stale data. But I need to double check on this.
There was a problem hiding this comment.
Any time there is only one unique IP per pod, stale data would not change it, because then you would also have one unique IP per pod, maybe the pod does not exist, but the IP is unique at the old point of time.
check zone parameter for filtering mode - [x] When zone is empty (routesrv mode), return all endpoints with zone metadata - [x] When zone is set (direct skipper mode), filter by zone with threshold fallback - [x] Verify dataclient and routesrv modes work correctly --------- Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de> Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com> Co-authored-by: Sandor Szücs <sandor.szuecs@zalando.de> Signed-off-by: greeshma1196 <greeshma.mathew@gmail.com>
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
|
I added a couple of missing tests that are only somewhat related to routesrv. These basically test that the change does not change valkey endpoints (these tests were completely missing before). |
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
|
👍 |
/routes/:zone