示例
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