Skip to content

Commit

Permalink
Fix attributes path, include all deps in docs and some refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
aureamunoz committed Sep 18, 2024
1 parent 264cbf9 commit 11a8021
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 113 deletions.
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
<artifactId>stork-service-registration-static-list</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-registration-eureka</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-test-utils</artifactId>
Expand Down
9 changes: 2 additions & 7 deletions docs/docs/load-balancer/least-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ For each service expected to use a least-response-time selection, configure the

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=least-requests
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=least-requests
```

[//]: # (Supported attributes are the following:)
Supported configuration properties are the following:

[//]: # ()
[//]: # (--8<-- "../load-balancer/least-requests/target/classes/META-INF/stork-docs/least-requests-lb-attributes.txt")
--8<-- "target/attributes/META-INF/stork-docs/least-requests-lb-attributes.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ For each service expected to use a least-response-time selection, configure the

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=least-response-time
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=least-response-time
```

Expand Down Expand Up @@ -72,4 +68,8 @@ score(n) = \delta^{n - n_{max}} * \frac{\sum_i t_i * w_i}{\sum_i w_i} =
\delta^{n - n_{max}} * \frac{\sum_i t_i * \delta^{n - n_i}}{\sum_i \delta^{n - n_i}}
$$

The `declining-factor` should be in $(0, 1]$ , the default is $0.9$. Using a lower value makes the older response times less important.
The `declining-factor` should be in $(0, 1]$ , the default is $0.9$. Using a lower value makes the older response times less important.

Supported configuration properties are the following:

--8<-- "target/attributes/META-INF/stork-docs/least-response-time-lb-attributes.txt"
8 changes: 2 additions & 6 deletions docs/docs/load-balancer/power-of-two-choices.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,14 @@ For each service expected to use a random service selection, configure the `load

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=power-of-two-choices
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=power-of-two-choices
```

Supported attributes are the following:
Supported configuration properties are the following:

--8<-- "../load-balancer/power-of-two-choices/target/classes/META-INF/stork-docs/power-of-two-choices-lb-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/power-of-two-choices-lb-attributes.txt"
6 changes: 1 addition & 5 deletions docs/docs/load-balancer/random.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ For each service expected to use a random service selection, configure the `load

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=random
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=random
```

Supported attributes are the following:

--8<-- "../load-balancer/random/target/classes/META-INF/stork-docs/random-lb-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/random-lb-attributes.txt"
4 changes: 0 additions & 4 deletions docs/docs/load-balancer/round-robin.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ However, you can also configure it explicitly as follows:

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=round-robin
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=round-robin
```
6 changes: 1 addition & 5 deletions docs/docs/load-balancer/sticky.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@ To use the `sticky` load service selection strategy, set the load balancer type

=== "stork standalone"
```properties
stork.my-service.service-discovery.type=...
stork.my-service.service-discovery...=...
stork.my-service.load-balancer.type=sticky
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-discovery.type=...
quarkus.stork.my-service.service-discovery...=...
quarkus.stork.my-service.load-balancer.type=sticky
```


The following attributes are supported:

--8<-- "../load-balancer/sticky/target/classes/META-INF/stork-docs/sticky-lb-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/sticky-lb-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-discovery/composite.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Remember to define the services that make up your composite service.

These are all the parameters of the composite service discovery:

--8<-- "../service-discovery/composite/target/classes/META-INF/stork-docs/composite-sd-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/composite-sd-attributes.txt"
24 changes: 1 addition & 23 deletions docs/docs/service-discovery/consul.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,4 @@ For each service that should get the service instances from Consul, configure th

Consul service discovery is configured with the following parameters:

--8<-- "../service-discovery/consul/target/classes/META-INF/stork-docs/consul-sd-attributes.txt"

## Service registration

Stork also provides the ability to register services using Consul as backend.

### Service registration configuration

For each service that should register the service instances in Consul, configure the service registrar `type`:

=== "stork standalone"
```properties
stork.my-service.service-registrar.type=consul
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-registrar.type=consul
```

Consul service registrar is configured with the following parameters:

--8<-- "../service-discovery/consul/target/classes/META-INF/stork-docs/consul-sr-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/consul-sd-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-discovery/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ All in all, your configuration could look as follows:

All the available parameters are as follows:

--8<-- "../service-discovery/dns/target/classes/META-INF/stork-docs/dns-sd-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/dns-sd-attributes.txt"
27 changes: 1 addition & 26 deletions docs/docs/service-discovery/eureka.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Stork looks for the service with the given name (`my-service` in the previous ex

Supported attributes are the following:

--8<-- "../service-discovery/eureka/target/classes/META-INF/stork-docs/eureka-sd-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/eureka-sd-attributes.txt"

The `application` attribute is optional.
It uses the Stork service name (`my-service` in the previous configuration) if not set.
Expand All @@ -50,28 +50,3 @@ Using this attribute prevents load-balancing as you will always select a single
The `secure` attribute indicates if you want the _secure virtual address_ of the application instance.
If set to `true`, unsecured instances are filtered out from the available instances.

## Service registration

Stork also provides the ability to register services using Eureka as backend.

### Service registration configuration

For each service that should register the service instances in Eureka, configure the service registrar `type`:

=== "stork standalone"
```properties
stork.my-service.service-registrar.type=eureka
stork.my-service.service-registrar.eureka-host=localhost
stork.my-service.service-registrar.eureka-port=8761
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-registrar.type=eureka
quarkus.stork.my-service.service-registrar.eureka-host=localhost
quarkus.stork.my-service.service-registrar.eureka-port=8761
```

Eureka service registrar is configured with the following parameters:

--8<-- "../service-discovery/eureka/target/classes/META-INF/stork-docs/eureka-sr-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-discovery/knative.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Stork inspects the _Knative Service_ and retrieves the url of the service.

Supported attributes are the following:

--8<-- "../service-discovery/knative/target/classes/META-INF/stork-docs/knative-sd-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/knative-sd-attributes.txt"


## Caching the service instances
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/service-discovery/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Then, it can select the instance.

Supported attributes are the following:

--8<-- "../service-discovery/kubernetes/target/classes/META-INF/stork-docs/kubernetes-sd-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/kubernetes-sd-attributes.txt"


## Caching the service instances
Expand Down
24 changes: 1 addition & 23 deletions docs/docs/service-discovery/static-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,4 @@ For each service that should use the static list of service instances configure

These are all the static service discovery parameters:

--8<-- "../service-discovery/static-list/target/classes/META-INF/stork-docs/static-sd-attributes.txt"

## Service registration

Stork also provides the ability to register services using Static list as backend.

### Service registration configuration

For each service that should register the service instances in a static list, configure the service registrar `type`:

=== "stork standalone"
```properties
stork.my-service.service-registrar.type=static
```

=== "stork in quarkus"
```properties
quarkus.stork.my-service.service-registrar.type=static
```

Static service registrar is configured with the following parameters:

--8<-- "../service-discovery/consul/target/classes/META-INF/stork-docs/static-sr-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/static-sd-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-registration/consul.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ quarkus.stork.my-service.service-registrar.type=consul

Consul service registrar is configured with the following parameters:

--8<-- "../service-registration/consul/target/classes/META-INF/stork-docs/consul-sr-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/consul-sr-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-registration/eureka.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ quarkus.stork.my-service.service-registrar.eureka-port=8761

Eureka service registrar is configured with the following parameters:

--8<-- "../service-registration/eureka/target/classes/META-INF/stork-docs/eureka-sr-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/eureka-sr-attributes.txt"
2 changes: 1 addition & 1 deletion docs/docs/service-registration/static-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ quarkus.stork.my-service.service-registrar.type=static

Static service registrar is configured with the following parameters:

--8<-- "../service-registration/consul/target/classes/META-INF/stork-docs/static-sr-attributes.txt"
--8<-- "target/attributes/META-INF/stork-docs/static-sr-attributes.txt"
5 changes: 3 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nav:
- Round Robin: 'load-balancer/round-robin.md'
- Random: 'load-balancer/random.md'
- Least Requests: 'load-balancer/least-requests.md'
- Response Time: 'load-balancer/response-time.md'
- Least Response Time: 'load-balancer/least-response-time.md'
- Power Of Two Choices: 'load-balancer/power-of-two-choices.md'
- Sticky: 'load-balancer/sticky.md'
- Custom Load Balancer: 'load-balancer/custom-load-balancer.md'
Expand Down Expand Up @@ -93,7 +93,8 @@ markdown_extensions:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.snippets
- pymdownx.snippets:
base_path: !relative $config_dir
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.smartsymbols
Expand Down
22 changes: 22 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-registration-static-list</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-registration-consul</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-registration-eureka</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-spring-boot-config</artifactId>
Expand All @@ -107,11 +115,20 @@
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-discovery-eureka</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-discovery-dns</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-discovery-kubernetes</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-discovery-knative</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-load-balancer-random</artifactId>
Expand All @@ -131,5 +148,10 @@
<artifactId>stork-load-balancer-least-response-time</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-load-balancer-sticky</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

0 comments on commit 11a8021

Please sign in to comment.