bitwalker / bitwalker/libcluster

Use watch for Kubernetes strategy

Open
#139 3 comments 8 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
2.2k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.