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

Use watch for Kubernetes strategy #139

Open
dnsbty opened this issue Aug 14, 2020 · 3 comments
Open

Use watch for Kubernetes strategy #139

dnsbty opened this issue Aug 14, 2020 · 3 comments

Comments

@dnsbty
Copy link

dnsbty commented Aug 14, 2020

Thanks for creating an amazing library that makes clustering so much simpler!

Kubernetes has the ability to watch a given resource. When it is watched, the transfer encoding is set to chunked, and any updates after the specified version will be sent down in new chunks. This way the node wouldn't have to poll the endpoint every 5 seconds, but could create a long-lived connection to it and then just update whenever new chunks are received. I believe this would allow for node list updates to occur much closer to real-time.

Are there any drawbacks to supporting watch requests?

Would there be support for a PR implementing this?

If yes, would it make more sense to update the existing Cluster.Strategy.Kubernetes module or to create a new one like Cluster.Strategy.KubernetesWatched or something like that?

It seems like the high-level functionality will be exactly the same but more performant. That being said, I don't know when the watch capability was added to Kubernetes, so there is potential that it would be a breaking change for those who might be on older version. The docs reference watch in version 1.14, but I haven't looked further back than that.

@dnsbty
Copy link
Author

dnsbty commented Aug 18, 2020

I'm going to go ahead and start working on this. I'll just replace the current strategy for now, and we can discussion potential separation at the PR stage.

The watch can also be simulated with the -w flag in kubectl if you're interested in seeing how this works:

kubectl get endpoints -l app=level10 -w -o json

@complexsplit
Copy link

@dnsbty Have you made any progress on this?

@dnsbty
Copy link
Author

dnsbty commented Apr 12, 2024

@complexsplit I haven't. I ended up moving away from Kubernetes for the project I was working on. You (or someone else) is more than welcome to pick this up and I'm happy to give advice if needed though.

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

No branches or pull requests

2 participants