buraksezer / olric

Distributed, in-memory key/value store and cache. It can be used as an embedded Go library and a language-independent service.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kubernetes embedded member integration example

derekperkins opened this issue · comments

After poking around for a while, I ended up bypassing olric-cloud-plugin because it has compile errors with newer dependencies, plus bringing in hashicorp/go-discover really bloated our dependencies, when we are only interested in k8s. I just implemented the olric service discovery interface using k8s/client-go, and it works great in my limited testing. Here's a link to the gist, and I'm happy to contribute a PR with the example, but I wasn't sure if it made sense here, or if you were hoping to keep this in the cloud plugin repo.

https://gist.github.com/derekperkins/8f5232d897ccf5a20691a1556574cfce

Hey @derekperkins

Thank you for your contribution. I think we can publish your code snippet in the Olric repository. We may create a docs folder and add this kind of snippets there.

go-discovery is really bloated and I consider forking it and removing the least used pieces. Possibly, Kubernetes, GCE, and EC2 support should be enough.

Having a docs folder with all the examples would be nice.
We could even include how to setup olrid in a K8s deployment to be used as a server with other languages.

@derekperkins why not just use a headless service and DNS?

I think originally I was expecting this to work more like a watch, so it would respond faster via the api, but it's probably just as effective and much simpler to use a headless service.