如果我已经有 Kubernetes(或 mesos),为什么还需要使用 Spring Cloud?

If I have Kubernetes(or mesos) already, why do I need use Spring Cloud?

我是 Spring Cloud 的新手,对此我有点困惑。 Kubernetes 和 Spring Cloud 都是微服务框架。如果我已经有 Kubernetes(或 mesos),为什么还需要使用 Spring Cloud?我注意到许多项目同时使用它们。 Kubernetes 和 Spring Cloud 有什么区别?它们都可以提供服务发现、负载均衡等。 我真的很困惑。

Kubernetes 和 Spring 云解决了许多与微服务相同的问题,但采用不同的方法和技术。 Redhat 写了一篇很棒的文章对此进行了解释。主要内容如下:

Spring Cloud has a rich set of well integrated Java libraries to address all runtime concerns as part of the application stack. As a result, the Microservices themselves have libraries and runtime agents to do client side service discovery, load balancing, configuration update, metrics tracking, etc. Patterns such as singleton clustered services, batch jobs are managed in the JVM too.

Kubernetes is polyglot, doesn’t target only the Java platform, and addresses the distributed computing challenges in a generic for all languages way. It provides services for configuration management, service discovery, load balancing, tracing, metrics, singletons, scheduled jobs on the platform level, outside of the application stack. The application doesn’t need any library or agents for client side logic and it can be written in any language.

In some areas both platforms rely on similar third party tools. For example the ELK and EFK stacks, tracing libraries, etc.

Some libraries such as Hystrix, Spring Boot are useful equally well on both environments. There are areas where both platforms are complementary and can be combined together to create a more powerful solution (KubeFlix and Spring Cloud Kubernetes are such examples).

Source: https://developers.redhat.com/blog/2016/12/09/spring-cloud-for-microservices-compared-to-kubernetes/

为了更详细地了解差异和相似之处,我建议阅读完整的 article