<p>i have a (spring boot/spring cloud) application (micro-service 'MS' architecture) built with netflix tools and which i want to deploy it on kubernetes cluster (one master and 2 minions) to get advantage from its orchestration fact.</p>

<p>By the way, i created a kube-dns service on the cluster and i tried also to mount an eureka service (named eurekaservice) with 3 pods.
From the other side, i run a micro-service with the next eureka configuration:</p>

<pre><code>client:
  serviceUrl:
    defaultZone: http://eurekaservice:8761/eureka/
</code></pre>

<p>The good news is that every eureka pod on the cluster get notified about the new mounted MS instance. The bad news was that when the MS goes down, only one eureka pod get notified and the others no.
Another thing, is that when i see the MS logfile, while mounted, it shows me the next errors:</p>

<pre><code>Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: 2016-12-01 06:01:54.469 ERROR 1 --- [nio-8761-exec-1] c.n.eureka.resources.StatusResource: Could not determine if the replica is available

Dec 01 09:01:54 ctc-cicd3 docker-current[1465]:
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: java.lang.NullPointerException: null
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at com.netflix.eureka.resources.StatusResource.isReplicaAvailable(StatusResource.java:90)
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at com.netflix.eureka.resources.StatusResource.getStatusInfo(StatusResource.java:70)
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at org.springframework.cloud.netflix.eureka.server.EurekaController.status(EurekaController.java:63)
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Dec 01 09:01:54 ctc-cicd3 docker-current[1465]: at java.lang.reflect.Method.invoke(Method.java:606)


Dec 01 09:02:16 ctc-cicd3 docker-current[1465]: 2016-12-01 06:02:16.918  WARN 1 --- [nio-8761-exec-8] com.netflix.eureka.InstanceRegistry      : DS: Registry: lease doesn't exist, registering resource: MS - gateway-bbn50:MS:8090
Dec 01 09:02:16 ctc-cicd3 docker-current[1465]: 2016-12-01 06:02:16.919  WARN 1 --- [nio-8761-exec-8] c.n.eureka.resources.InstanceResource    : Not Found (Renew): MS - gateway-bbn50:MS:8090
Dec 01 09:02:16 ctc-cicd3 docker-current[1465]: 2016-12-01 06:02:16.927  INFO 1 --- [nio-8761-exec-5] com.netflix.eureka.InstanceRegistry      : Registered instance id 12.16.64.2 with status UP
Dec 01 09:02:17 ctc-cicd3 docker-current[1465]: 2016-12-01 06:02:17.061  INFO 1 --- [io-8761-exec-10] com.netflix.eureka.InstanceRegistry      : Registered instance id 12.16.64.2 with status UP
Dec 01 09:02:46 ctc-cicd3 docker-current[1465]: 2016-12-01 06:02:46.932  WARN 1 --- [nio-8761-exec-9] com.netflix.eureka.InstanceRegistry      : DS: Registry: lease doesn't exist, registering resource: MS - gateway-bbn50:MS:8090
</code></pre>

<p>I think what was causing the problem is that replicas was unable to see each others.</p>

<p>how can i resolve this issue!!</p>

<p>The problem here is that Eureka is a stateful app and you cannot scale it by just increasing the number of replicas.</p>

<p>See the Eureka "peer awereness" docs : <a href="http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html" rel="nofollow">http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html</a></p>
