spring-cloud / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Apache License 2.0
3.45k stars 1.03k forks source link

Is there a way to bypass Ribbon and request directly by host name, thus make envoy intercept the request and do service discovery and load-balancing in the case of Istio integration. #318

Closed idouba closed 5 years ago

idouba commented 5 years ago

Ribbon get service and ServiceInstance and select a target IP to forward a request to service instance. In case of kubernetes, it is like just replace discovery client from eureka to k8s, and get service instance list from kube-apiserver instead of eureka server. Thus ribbon interpret service name to podIp and send the request.

As for Istio, client side load-balancing should be provided by Envoy, which can do load-balancing for app besides SC based ones. In case of Istio&SpringCloud,it seems that ribbon should be disabled, and use service name directly, that is set the service name in HTTP Host: header will be ok. Is there a recommend config or annotation to do that safely . And spring-cloud-kubernetes-istio is introduced a istio-client to interact with Istio APIs enabling us to discover traffic rules, not what requirement described before.

idouba commented 5 years ago

298

idouba commented 5 years ago

233

315

geoand commented 5 years ago

@spencergibb @salaboy Any comments?

spencergibb commented 5 years ago

You can certainly not use ribbon. There is no requirement.

idouba commented 5 years ago

@spencergibb Thanks. What's is SC‘s’ officially recommended solution to integrate Istio's data plane envoy? For SC dev(or ops), they do NOT need modify their code. The main idea may looks like this: image

spencergibb commented 5 years ago

I mean, not including ribbon and using dns names should just work.

salaboy commented 5 years ago

@idouba I remember that I got that working by just adding "http:" to the prefix instead of using "lb" that try to use ribbon. Can you check what is the prefix that you are using>?

spring-projects-issues commented 5 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues commented 5 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.