示例
Spring Cloud Kubernetes 遵循 Spring Cloud 接口,旨在使您的应用程序透明地消费 Kubernetes 原生服务。
在您的应用程序中,您需要将 spring-cloud-kubernetes-discovery
依赖添加到类路径中,并移除任何包含 DiscoveryClient
实现的其他依赖项(例如 Eureka 发现客户端)。这同样适用于 PropertySourceLocator
,您需要将 spring-cloud-kubernetes-config
添加到类路径中,并移除任何包含 PropertySourceLocator
实现的其他依赖项(例如配置服务器客户端)。
以下项目重点展示了这些依赖项的使用,并演示了如何在任何 Spring Boot 应用程序中使用这些库
-
Spring Cloud Kubernetes 示例:此仓库中包含的示例。
-
Spring Cloud Kubernetes 完整示例:Minions 和 Boss
-
Spring Cloud Kubernetes 完整示例:SpringOne Platform Tickets Service
-
结合 Spring Cloud Kubernetes Discovery 和 Config 的 Spring Cloud Gateway
-
结合 Spring Cloud Kubernetes Discovery 和 Config 的 Spring Boot Admin