Skip to content

Commit

Permalink
feat(#1510): add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SteKoe committed Oct 5, 2023
1 parent 3c2b0e2 commit 38622bf
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions spring-boot-admin-docs/src/site/asciidoc/_server-discovery.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[[spring-cloud-discovery-support]]
== Spring Cloud Discovery ==

The Spring Boot Admin Server can use Spring Clouds `DiscoveryClient` to discover applications. The advantage is that the clients don't have to include the `spring-boot-admin-starter-client`. You just have to add a `DiscoveryClient` implementation to your admin server - everything else is done by AutoConfiguration.
The Spring Boot Admin Server can use Spring Clouds `DiscoveryClient` to discover applications.
The advantage is that the clients don't have to include the `spring-boot-admin-starter-client`.
You just have to add a `DiscoveryClient` implementation to your admin server - everything else is done by AutoConfiguration.

[[spring-cloud-discovery-static-config]]
=== Static Configuration using SimpleDiscoveryClient ===

Spring Cloud provides a `SimpleDiscoveryClient`. It allows you to specify client applications via static configuration:
Spring Cloud provides a `SimpleDiscoveryClient`.
It allows you to specify client applications via static configuration:

[source,xml]
.pom.xml
Expand Down Expand Up @@ -36,14 +39,20 @@ spring:
----

=== Other DiscoveryClients ===
Spring Boot Admin supports all other implementations of Spring Cloud's `DiscoveryClient` (https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#service-discovery-eureka-clients/[Eureka], https://docs.spring.io/spring-cloud-zookeeper/docs/current/reference/html/#spring-cloud-zookeeper-discovery[Zookeeper], https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#spring-cloud-consul-discovery[Consul], https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/#discoveryclient-for-kubernetes[Kubernetes], ...). You need to add it to the Spring Boot Admin Server and configure it properly.

Spring Boot Admin supports all other implementations of Spring Cloud's `DiscoveryClient` (https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#service-discovery-eureka-clients/[Eureka], https://docs.spring.io/spring-cloud-zookeeper/docs/current/reference/html/#spring-cloud-zookeeper-discovery[Zookeeper], https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#spring-cloud-consul-discovery[Consul], https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/#discoveryclient-for-kubernetes[Kubernetes], ...).
You need to add it to the Spring Boot Admin Server and configure it properly.
An <<getting-started#discover-clients-via-spring-cloud-discovery,example setup using Eureka>> is shown above.

=== Converting ServiceInstances ===

The information from the service registry are converted by the `ServiceInstanceConverter`. Spring Boot Admin ships with a default and Eureka converter implementation. The correct one is selected by AutoConfiguration.
The information from the service registry are converted by the `ServiceInstanceConverter`.
Spring Boot Admin ships with a default and Eureka converter implementation.
The correct one is selected by AutoConfiguration.

TIP: You can modify how the information from the registry is used to register the application by using SBA Server configuration options and instance metadata. The values from the metadata takes precedence over the server config. If the plenty of options don't fit your needs you can provide your own `ServiceInstanceConverter`.
TIP: You can modify how the information from the registry is used to register the application by using SBA Server configuration options and instance metadata.
The values from the metadata takes precedence over the server config.
If the plenty of options don't fit your needs you can provide your own `ServiceInstanceConverter`.

NOTE: When using Eureka, the `healthCheckUrl` known to Eureka is used for health-checking, which can be set on your client using `eureka.instance.healthCheckUrl`.

Expand Down Expand Up @@ -75,6 +84,10 @@ user.password
| health.path
| The path is appended to the service URL and will be used for the health-checking. Ignored by the `EurekaServiceInstanceConverter`.
| `${spring.boot.admin.discovery.converter.health-endpoint}`

| group
| The group is used to group services in the UI by the group name instead of application name.
|
|===

.Discovery configuration options
Expand Down Expand Up @@ -111,6 +124,7 @@ user.password
|===

=== CloudFoundry ===

If you are deploying your applications to CloudFoundry then `vcap.application.application_id` and `vcap.application.instance_index` *_must_* be added to the metadata for proper registration of applications with Spring Boot Admin Server.
Here is a sample configuration for Eureka:

Expand Down

0 comments on commit 38622bf

Please sign in to comment.