Using xDS gRPC
Esta página explica cómo habilitar el uso de xDS gRPC en su aplicación Quarkus.
| This Quarkus xDS gRPC integration currently doesn’t support building native executables due to the issues with shaded grpc-netty library while running native IT tests. |
Configurar el proyecto
Añada la extensión Quarkus gRPC xDS a su archivo de construcción:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-xds</artifactId>
</dependency>
implementation("io.quarkus:quarkus-grpc-xds")
This transitively adds io.quarkus:quarkus-grpc extension dependency.
|
Configuración del servidor
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Tipo |
Por defecto |
|---|---|---|
Explicitly enable use of XDS. Environment variable: Show more |
boolean |
|
Use secure credentials. Environment variable: Show more |
boolean |
|
Ejemplo de configuración del servidor
Para activar el servidor xDS, utilice la siguiente configuración.
xDS must be explicitly enabled on the server, then verify you use it on the right xDS server port (default is 9000).
If you want to use XdsServerCredentials set xds.secure to true.
quarkus.grpc.server.xds.enabled=true
#quarkus.grpc.server.xds.secure=true
quarkus.grpc.server.port=30051
When xDS is configured, plain-text is automatically disabled.
|
Configuración del cliente
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Tipo |
Por defecto |
|---|---|---|
Explicitly enable use of XDS. Environment variable: Show more |
boolean |
|
Use secure credentials. Environment variable: Show more |
boolean |
|
Optional explicit target. Environment variable: Show more |
string |
| When xDS target property is used, name resolver, host, and port are not used |
Ejemplo de configuración de cliente
Para activar xDS de cliente, utilice la siguiente configuración.
You can either explicitly enable xDS or you use xds name resolver,
and make sure you point it to the right xDS server port (default is 9000).
If you want to use XdsChannelCredentials set xds.secure to true.
#quarkus.grpc.clients.<client-name>.xds.enabled=true
#quarkus.grpc.clients.<client-name>.xds.secure=true
quarkus.grpc.clients.<client-name>.name-resolver=xds
quarkus.grpc.clients.<client-name>.port=30051
When xDS is configured, plain-text is automatically disabled.
|
Ejemplo de configuración de Kubernetes
A continuación se muestra un ejemplo de configuración adicional (necesaria) cuando se utiliza xDS gRPC con Istio Service Mesh en Kubernetes.
quarkus.kubernetes.ports.grpc.container-port=30051
quarkus.kubernetes.annotations."inject.istio.io/templates"=grpc-agent
quarkus.kubernetes.annotations."proxy.istio.io/config"={"holdApplicationUntilProxyStarts": true}