How Kong can be integrated with Consul - microservices

I would like to know the use of Consul and its integration with Kong.
I understand Kong can be used as an API gateway specifically for micro-service architecture. Correct me if I am wrong. I have read integration between Kong and Consul. But I am failing to understand the real usage of Consul.
Appreciate your help.

You can make Kong work with Consul by specifying the dns_resolver property (in the kong.conf configuration file) to point to your Consul server (or by setting the KONG_DNS_RESOLVER=<xxx> environment variable).
By doing so, you are forcing Kong to use Consul to resolve hostname addresses in the upstream_url of your APIs.

Related

Service discovery in kubernetes/ spring boot

What are the benefits to use "spring service discovery kubernetes" instead of using directly the Service DNS coming from Kubernetes?
I mean, If I deploy in kubernetes 2 services (service-a and service-b), and service-b exposes a Rest API.
service-a can easily connect to service-b using the url "http://service-b/...".
Question #1. In order to let service-a be able to connect to service-b using the service DNS, service-b has to be deployed before service-a?
Question #2. What are the pros/cons using the spring discovery?
Question #1:
No, the order in which you deploy the services is not important to use the kubernetes DNS services to resolve the ips, the only thing here is that if you deploy serviceA after serviceB, you will have in serviceA as an environment variable the ip of serviceB but not the inverse.
Question #2:
The spring service discovery is an alternative to the native kubernetes service discovery and it is used by other spring cloud projects like spring-cloud-eureka to perform the service discovery. The only pros I see in this approach is that you can custom the load balancing algorithm tath you can use to spread the load among the different instances

Spring Loadbalancer Configuration without a discovery server

I am currently working on a POC about client side load balancing. 
I thought to use Spring Cloud Loadbalancer for that. But unlike Netflix Ribbon, I could not find a way to configure Spring Cloud Loadbalancer to work without a discovery server such as Eureka. 
Please could you let me know if there is a way to configure it to work without a discovery server (just by giving a list of ip addresses) .
Thanks

Configure kong api gateway with service discovery

I have a bunch of rest services. I want to have a kong api gateway implemented at the front. I dont want to go into kong admin api and manually add all the exposed api.
Can i take help of any service discovery implementation like eureka or consul to autoconfigure my apis to Kong.
I'm afraid not.
Kong's configurations are stored in postgres and updated through the admin API, you can write your own program to import.

Server-side load balancing and Third-Party discovery with Zuul & Consul / Eureka

we are planning to built our next projects using microservices-architecture and we have already defined that we want to use Zuul as API-Gateway. Right now we have to decide which service registry we will use:
Consul or Eureka.
We want to use server-side load balancing (via Zuul itself). Is it possible to do this while combining Zuul with Consul or Eureka?
Furthermore, we don’t want to use self-registration pattern! Our plan is to use Third-Party registration! Is it possible while combining Zuul with Consul or Eureka? Which tools can be used for this? Are there alternatives for Registrator which works for Docker?
Thanks a lot in advance for your help!

Microservices Config and eureka service which one to start first?

I am creating a simple project in microservices using spring boot and netflix OSS to get my hands dirty. I have created two services
config service which has to register itself in discovery(eureka)
service.
discovery service which requires config service to be running to get its configuration.
Now when I am starting these services, both services fails due to inter dependency. What are the best practices resolve this issue and which one to start first.
PS:- I know I am creating circular dependency, But what is the way to deal with situation like this where I want to keep eureka configuration also with the config server
Thanks
I believe that you can find the answer for your question in the official spring cloud config server documentation:
Here: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_spring_cloud_config_client
Basically you have to choose between a "Config First Bootstrap" or "Discovery First Bootstrap".
From the docs:
"If you are using a `DiscoveryClient implementation, such as Spring Cloud Netflix and Eureka Service Discovery or Spring Cloud Consul (Spring Cloud Zookeeper does not support this yet), then you can have the Config Server register with the Discovery Service if you want to, but in the default "Config First" mode, clients won’t be able to take advantage of the registration.
If you prefer to use DiscoveryClient to locate the Config Server, you can do that by setting spring.cloud.config.discovery.enabled=true (default "false"). The net result of that is that client apps all need a bootstrap.yml (or an environment variable) with the appropriate discovery configuration. (...)"

Resources