Stork Reference Guide
This guide is the companion from the Stork Getting Started Guide. It explains the configuration and usage of SmallRye Stork integration in Quarkus.
Essa tecnologia é considerada preview. In preview, backward compatibility and presence in the ecosystem is not guaranteed. Specific improvements might require changing configuration or APIs, and plans to become stable are under way. Feedback is welcome on our mailing list or as issues in our GitHub issue tracker. Para obter uma lista completa de possíveis status, consulte nosso FAQ. |
Supported clients
The current integration of Stork supports:
-
the Reactive REST Client
-
the gRPC clients
Warning: The gRPC client integration does not support statistic-based load balancers.
Available service discovery and selection
Check the SmallRye Stork website to find more about the provided service discovery and selection.
Using Stork in Kubernetes
Stork provides a service discovery support for Kubernetes, which goes beyond what Kubernetes provides by default. It looks for all the pods backing up a Kubernetes service, but instead of applying a round-robin (as Kubernetes would do), it gives you the option to select the pod using a Stork load-balancer.
To use this feature, add the following dependency to your project:
<dependency>
<groupId>io.smallrye.stork</groupId>
<artifactId>stork-service-discovery-kubernetes</artifactId>
</dependency>
implementation("io.smallrye.stork:stork-service-discovery-kubernetes")
For each service expected to be exposed as a Kubernetes Service, configure the lookup:
quarkus.stork.my-service.service-discovery.type=kubernetes
quarkus.stork.my-service.service-discovery.k8s-namespace=my-namespace
Stork looks for the Kubernetes Service with the given name (my-service
in the previous example) in the specified namespace.
Instead of using the Kubernetes Service IP directly and let Kubernetes handle the selection and balancing, Stork inspects the service and retrieves the list of pods providing the service. Then, it can select the instance.
For a full example of using Stork with Kubernetes, please read the Using Stork with Kubernetes guide.