This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Cloud Kubernetes 3.1.4!spring-doc.cn

Kubernetes native service discovery

Kubernetes itself is capable of (server side) service discovery (see: kubernetes.io/docs/concepts/services-networking/service/#discovering-services). Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (istio.io), a service mesh that is capable of load balancing, circuit breaker, failover, and much more.spring-doc.cn

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as {service-name}.{namespace}.svc.{cluster}.local:{service-port}.spring-doc.cn

Additionally, you can use Hystrix for:spring-doc.cn

  • Circuit breaker implementation on the caller side, by annotating the spring boot application class with @EnableCircuitBreakerspring-doc.cn

  • Fallback functionality, by annotating the respective method with @HystrixCommand(fallbackMethod=spring-doc.cn