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.
This technology is considered preview. En la preview, la compatibilidad con versiones anteriores y la presencia en el ecosistema no están garantizadas. Las mejoras específicas podrían requerir cambios en la configuración o en las API, y los planes para convertirse en estables están en marcha. Los comentarios son bienvenidos en nuestra lista de correo o como problemas en nuestro GitHub issue tracker. For a full list of possible statuses, check our FAQ entry. |
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.