Skip to content
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

Support endpointslices - Prefer Same zone traffic to save costs #1446

Open
1 of 2 tasks
szuecs opened this issue Jun 14, 2020 · 6 comments
Open
1 of 2 tasks

Support endpointslices - Prefer Same zone traffic to save costs #1446

szuecs opened this issue Jun 14, 2020 · 6 comments

Comments

@szuecs
Copy link
Member

szuecs commented Jun 14, 2020

Right now in kubernetes dataclient we use endpoints to get lb pool members. These are flat ip port tuples.

In Kubernetes there is a new feature endpointslices that have topology which enables us to have endpoints for specific zones for example. With this we can optimize traffic costs, because same zone traffic costs less than cross zone traffic.
See also KEP topology per endpoint and KEP API

In a discussion in slack a user wrote:

for us, the cost savings are huge. We've already implemented it in a few places in the application and it's saved about 5% of our total AWS bill.

5% is huge, and I think we to have have more priority for this

see also:

Steps

@szuecs szuecs changed the title Prefer Same zone traffic to save costs Support endpointSlices - Prefer Same zone traffic to save costs Sep 30, 2020
@szuecs
Copy link
Member Author

szuecs commented Nov 27, 2020

@szuecs szuecs changed the title Support endpointSlices - Prefer Same zone traffic to save costs Support endpointlices - Prefer Same zone traffic to save costs Jun 8, 2021
@szuecs
Copy link
Member Author

szuecs commented Jul 10, 2021

See also https://twitter.com/a_sykim/status/1413492899258400770?s=21 for changes in kubernetes 1.22

@szuecs szuecs changed the title Support endpointlices - Prefer Same zone traffic to save costs Support endpointslices - Prefer Same zone traffic to save costs Oct 12, 2022
@szuecs
Copy link
Member Author

szuecs commented Jun 16, 2023

kubernetes/enhancements#4003 is an interesting change proposal within kubernetes

@szuecs
Copy link
Member Author

szuecs commented Jun 22, 2023

A quick hack to enable endpointslices usage would be to have an annotation on ingress or routegroup to force service use instead of endpoints https://kubernetes.io/docs/concepts/services-networking/topology-aware-routing/

@AlexanderYastrebov
Copy link
Member

A quick hack to enable endpointslices usage would be to have an annotation on ingress or routegroup to force service use instead of endpoints

I think we have a flag for that introduced by #2088

@szuecs
Copy link
Member Author

szuecs commented Jun 22, 2023

@AlexanderYastrebov yes but by annotation would reduce the blast radius to test. If you have a cluster with a few pods and hug number of pods side-by-side than the few pods can easily be impaired.

Example you have a backend with 8 pods, 3 in zone A and B and 2 in C.
Now skipper-ingress has 4 pods, 1 in zone A and B and 2 in C.
NLB and other internal clients will spread the load across all 4 skipper pods and now skipper has 50% traffic in C and only 25% in A and B. Now let's assume we use zone aware routing in skipper, then you will get 50% traffic to C but you have 8 pods, so you serve 50% traffic with 25% of your pods. Would you think it's a great solution?
I don't think it is, but this would be the way how it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants