Difference between Eureka Discovery vs Service Registry (PCF) - spring-boot

In start.spring.io, I can find Eureka Discovery and Service Registry (PCF), seems like they are the same. what's the different between them?

They indeed are same. PCF's Service Registry is based on Eureka.
You may subscribe for the already available service, instead of running your own discovery service.
Here is the reference to PCF documentation:
https://docs.pivotal.io/spring-cloud-services/1-3/common/service-registry/

Related

Service Discovery within Kubernetes

When deploying a set of SpringBoot microservice applications in a Kubernetes cluster, should I include any kind of service discovery client libraries in my SpringBoot application to leverage kubernetes-native-service-discovery? If not, how a caller service calls another microservice in the same cluster?
Thanks in advance.
A service in kubernetes can be invoked as mentioned below for example an http service. An service has to be created and associated with pod. Please refer kubernetes services documentation for various services.
http://<service-name>:<port>
No other changes are required from application end. Please refer kubernetes official documentation for resolution details

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

Eureka service discovery not working in Azure

I have 2 micro-services that register with Eureka. I run the projects locally and call one micro-service from another using Feign & Ribbon and everything works fine.
However when I deploy everything to Azure it no longer works.
I can see the services registered in eureka dashboard but when I click on a particular service I get an url like this http://100.79.xxxx.xx:xxxx and after loading for a while I get a connection timeout. Same happens in code when one micro-service calls the other through Eureka.
I also added this setting to eureka clients but it didn't help:
eureka.instance.prefer-ip-address: false
It seems that the IP addresses of services instances are not reachable.
Is there a way to make Eureka work on Azure? Thanks 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. (...)"

eureka force service registration from application.yml

I want to register in my Eureka instance a ElasticSearch service (and some others) with a hardcoded IP.
The idea here is that my other services (like Zuul) could access those services using ribbon.
It would be optimal to set those services in my Eureka's application.yml
Is it possible? And how?
It is not a feature that eureka supports.

Resources