0
点赞
收藏
分享

微信扫一扫

Spring Cloud & Kubernetes


​​spring-cloud-kubernetes​​(Kubernetes integration with Spring Cloud):该组件主要提供三方面的内容:

  1. 将KubernetesClient注入到Spring Cloud应用中,用于服务发现,将一个Spring Cloud 应用,作为Kubernetes Service部署时,就是服务注册;使用K8s的服务注册发现能力代替了Spring Cloud Netflix的服务注册发现组件Eureka;
  2. 让Spring Cloud应用可以使用K8s集群中的对象,如ConfigMap,Secrets等
  3. Spring Cloud中其他组件的适配
    具体如下:
    spring-cloud-kubernetes项目提供了如下的能力
  4. DiscoveryClient for Kubernetes
  5. KubernetesClient autoconfiguration
  6. PropertySource
  7. ConfigMap PropertySource
  8. Secrets PropertySource
  9. PropertySource Reload
  10. Pod Health Indicator
  11. Transparency (its transparent whether the code runs in or outside of Kubernetes)
  12. Kubernetes Profile Autoconfiguration
  13. Ribbon discovery in Kubernetes
  14. Zipkin discovery in Kubernetes
  15. ConfigMap Archaius Bridge

Architecture

spring-cloud-kubernetes-archaius:将Kubernetes中指定的ConfigMap的配置信息放到archaius中;
spring-cloud-kubernetes-config:Kubernetes提供了ConfigMap来给应用配置Key-Value形式的信息,Spring Cloud Kubernetes Config模块使Spring Boot应用在启动或者热重载时可以使用Kubernetes ConfigMap中的信息;spring-cloud-kubernetes-config通过扩展PropertySource接口提供了读取ConfigMap和Secret的能力;
spring-cloud-kubernetes-core:构建一个可以连接到Kubernetes Master的KubernetesClient对象;
spring-cloud-kubernetes-discovery:实现了spring-cloud-common里的DiscoveryClient接口;也就是说只要是依赖DiscoveryClient接口用于服务发现的Spring Cloud的组件,比如说Zuul,就都支持Kubernetes了;
spring-cloud-kubernetes-ribbon:实现了ribbon的ServerList接口,用于支持ribbon客户端负载均衡;Spring Cloud提供的RPC三件套,Ribbon/Feign/Hystrix,支持了最底层的Ribbon,这三个就全都可以在Kubernetes上用了;


举报

相关推荐

0 条评论