vert-x3 / vertx-service-discovery

Some tools one can use for doing microservices with Vert.x
Apache License 2.0
114 stars 67 forks source link

Kubernetes service discovery does not removed replaced services #27

Closed cescoffier closed 8 years ago

amoAHCP commented 8 years ago

I can take a look at it if you want... do you have some additional informations? Andy

cescoffier commented 8 years ago

So, I realized it using the REST endpoint provided by the service discovery. When a pod is replaced, the service is not removed.

For instance I get this:

vertx-http-server UP 597ebb31-a33e-4fc8-918b-f8458c1c40e2
vertx-http-server UP 7afc9462-4b12-4af0-93ac-bf273a72c7e1

While it should see only one. One of the pod has been destroyed, while the service is still there. The issue is (I would guess) around https://github.com/vert-x3/vertx-service-discovery/blob/master/vertx-service-discovery-bridge-kubernetes/src/main/java/io/vertx/servicediscovery/kubernetes/KubernetesServiceImporter.java#L279. Either we don't get the notification, or we can't find the matching record.

cescoffier commented 8 years ago

To reproduce it, just take an application exposing a HTTP server. Check that it is discovered, then update it (or redeploy whatever you prefer), I've the service twice.

amoAHCP commented 8 years ago

OK.. thx... I'll take a look

cescoffier commented 8 years ago

Shame on me.... It was duplicated because the Kubernetes importer was instantiated twice. So not a bug.

cescoffier commented 8 years ago

Sorry for the noise.