apple / swift-service-discovery

A service discovery API for Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

K8s-based service discovery

m0wfo opened this issue · comments

Hey all, sorry for posting here but I couldn't find a good sub-category for service discovery on the swift server forum- just a heads up that we've started on an implementation (albeit an alpha-ish one) based on the protocols in this library to solve our problem of pod discovery in a Kubernetes environment. We also had to roll our own one-class fixed-list implementation for local dev where a k8s api is not available, not sure if there's a better way of doing that.

Anyway, progress so far, FWIW is here, if there's any community appetite for this then we're ok with scheduling some time to update documentation, e.t.c.

A k8s-based impl would be awesome @m0wfo.

We also had to roll our own one-class fixed-list implementation for local dev where a k8s api is not available, not sure if there's a better way of doing that.

There is InMemoryServiceDiscovery that supports static/fixed list. Does it not fit for your use-case?

There is InMemoryServiceDiscovery that supports static/fixed list. Does it not fit for your use-case?

@yim-lee somehow this passed me by, awesome, thank you. We went the route of watching the api for changes vs using DNS for reasons of convergence speed; we need to be aware of new pods reasonably quickly, although I guess DNS-based discovery would have more universal appeal.

Watching the API for changes is also a totally valid and useful strategy, we did that with akka's management/discovery packages as well -- if you could make that into a small package implementing the API I'm sure people would find it useful (one of the reasons is just that -- convergence time, but the other one being records the other one being about readyness checks though I'm told this is resolved nowadays (previously it was not possible to see non-ready members via DNS, now it's possible to enable that I think)

Think you could make a small package for what you've implemented? It'd definitely help the community @m0wfo :-)

We'll schedule some time internally to spruce up the docs and write some tests, it's looking like second half of Jan at this point.

Sounds great, thanks!

@ktoso @yim-lee Found some time to add some documentation and start integration testing this- I guess I'll close this as either tuplestream/swift-k8s-service-discovery or the Swift Forum is a better place to discuss future changes.

Sounds good, looking forward to it 👍