Skip to content

Use watch for Kubernetes strategy #139

@dnsbty

Description

@dnsbty

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions