为什么使用尤里卡?

Why using Eureka?

我正在基于 Netflix Eureka and experimenting on top of spring-cloud 设置微服务,经过数周的研究和开发,问题出现了!

为什么我需要 Eureka 和 spring-cloud?

为什么不开发您的独立容器并将它们作为 pods 部署在 Kubernetes 上并从那里维护所有内容?

您也可以从 Kubernetes 支持负载平衡、服务注册、监控、容器化等。

以下是我能想到的几点:

在 Kubernetes 上您不需要,您可以使用 Kubernetes 平台的那些功能。

如果您想与 spring 云更紧密地集成,您可以查看:https://github.com/spring-cloud-incubator/spring-cloud-kubernetes

大多数请求的功能都可以由 Kubernetes 服务提供。这些作为环境变量公开给 pods 或者您可以使用 Kube DNS 来查找所需的服务。

我总结一下为什么使用Eurekaand/orKubernetes可以列为:

  • Java 仅
  • 开发者友好
  • 整个堆栈的服务器成本更低
  • 较少依赖 OPS
  • 关于开发者社区和教程的更多资源
  • 渐进式学习曲线

所以,

If you need some of your microservices in an other language or you can rely on your developers knowledge on Kubernetes are not afraid to spend a bit more time and money investing in your tech stack to have a wider and less dependent system then Kubernetes is the way to go.

另一方面

If you need a fast development well integrated with spring-boot stack with easy to use Java annotations without large involvement of DevOps then and less resource to train your developers then go for Eureka and spring-cloud stack.

有关更多详细信息以及比较图表和功能列表,请参阅 this article