spring cloud kubernetes ribbon mode

11/24/2019

I am new to the Kubernetes world. I want to know which ribbon mode is best to use between the following :

spring.cloud.kubernetes.ribbon.mode supports POD and SERVICE modes.

  1. The POD mode is to achieve load balancing by obtaining the Pod IP address of Kubernetes and using Ribbon. POD mode uses the load balancing of the Ribbon Does not support Kubernetes load balancing, The traffic policy of Istio is not supported.

  2. the SERVICE mode is directly based on the service name of the Ribbon. Get The Kubernetes service is concatenated into service-name.{namespace}.svc.{cluster.domain}:{port} such as: demo1.default.svc.cluster.local:8080. the SERVICE mode uses load balancing of the Kubernetes service to support Istio’s traffic policy. I have used the service mode but in the logs of service A which is calling Service B having IP address of pods of service B

Logs

2019-11-24 12:31:38.220  INFO [personservice,,,] 6 --- [           main] c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client organizationservice initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=organizationservice,current list of Servers=[10.1.2.36:8085, 10.1.2.40:8085],Load balancer stats=Zone stats: {unknown=[Zone:unknown;      Instance count:2;     Active connections count: 0;       Circuit breaker tripped count: 0; Active connections per server: 0.0;]

Service A Config

spring:
  cloud:
    kubernetes:
      ribbon:
          mode: SERVICE
-- Chandresh Mishra
kubernetes
spring
spring-boot
spring-cloud
spring-cloud-kubernetes

0 Answers