Comments (2)
hi, i saw your note in my email as well. i haven't really kept up with nerve development. i'm also not too familiar with service discovery in k8s.
off the top of my head, the biggest problem is going to be freshness. the original ZK implementation used ephemeral nodes that would expire after some time. the etcd implementation i see in the code also seems to use a ping mechanism that resets a TTL. for kubernetes API, i doubt there's an auto-expiring entry type.
it would be helpful to know what's consuming the entries you're putting into k8s. are you trying to discover out-of-cluster services the same as in-cluster services, perhaps by using coredns? without an auto-expiry, you'll end up with a bunch of stale entries in the dns name. if you want to use the k8s api directly in your application, you can probably set metadata about last ping time, and exclude entries that are too old -- but i don't recommend this pattern. one of the goals of smartstack was to remove service discovery concepts from inside applications.
a more smart-stacky approach would be to run a sidecar container as part of your pod, containing just a smartstack-aware proxy like haproxy w/ synapse or envoy. if you want to talk to your services outside of k8s from your services inside k8s, talk to them through the sidecar.
if your goal is to talk to your services inside of k8s from your sevices outside of k8s, then you'll probably want to direct your attention to synapse instead of nerve.
from nerve.
Thanks for response @igor47 . We are using Synapse on both K8S and outside K8S for service discovery, and Envoy as proxy service. On non-K8S side, we are using nerve to register services with Zookeeper. K8S registers services with K8S API server. Synapse running on both non-K8S and K8S discover services. Envoy is used to communicate between services.
In this setup, Synapse discovers services from both Zookeeper and K8S api server. We want Synapse to discover services from single location. Hence looking at options for Nerve to register services directly with K8S api server.
As you mentioned, the problem is with freshness. We are looking at couple of options like
- A proxy layer between nerve and K8S, which will take care of freshness
- Modify nerve to update K8S api server directly, use Envoy health checks and TTL stale entries
Both of above approaches have its own complexities. I am looking at any other ways of nerve registering services to K8S Api server
from nerve.
Related Issues (20)
- Install nerve in Ubuntu 20
- Project dependencies may have API risk issues
- Gem does not build on arm64 platform
- Unitialized constant error HOT 2
- Marathon support HOT 4
- nerve can silently stop watching a service! HOT 3
- Publish nerve 0.3.0 to rubygems.org HOT 1
- More than one reporter? HOT 5
- service_watcher does not exit properly in long sleep loop HOT 2
- Nerve ParseError HOT 2
- Nerve fails to restart on watcher failure HOT 3
- Dynamic Configuration HOT 2
- Please upgrade Bunny dependency
- serf Support HOT 4
- Connect to different zookeeper clusters async
- Should nerve consider a 3xx status to be successful? HOT 1
- cross dc services and failover HOT 4
- ZK connectivity failure with multiple watchers leads to permanent failure HOT 3
- Is this project still active? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerve.