Deploying your gRPC Service in Kubernetes

This page explains how to deploy your gRPC service in Quarkus in Kubernetes. We’ll continue with the example from the Getting Started gRPC guide.

Configuring your project to use the Quarkus Kubernetes extension

Add the Quarkus Kubernetes extension to your build file:


Next, we want to expose our application using the Kubernetes Ingress resource:


The Quarkus Kubernetes will bind the HTTP server using the port name http and the gRPC server using the port name grpc. By default, the Quarkus application will only expose the port name http, so only the HTTP server will be publicly accessible. To expose the gRPC server instead, set the property in your
If you configure Quarkus to use the same port for both HTTP and gRPC servers with the property quarkus.grpc.server.use-separate-server=false, then you don’t need to change the default target-port.

Finally, we need to generate the Kubernetes manifests by running the command in a terminal:

quarkus build
./mvnw install
./gradlew build

Once generated, you can look at the target/kubernetes directory:

└── kubernetes.json
└── kubernetes.yml

You can find more information about how to deploy the application in Kubernetes in the the Kubernetes guide.

Using gRPC Health probes

By default, the Kubernetes resources do not contain readiness and liveness probes. To add them, import the Smallrye Health extension to your build file:

More information about the health extension can be found in the Microprofile Health guide.

By the default, this extension will configure the probes to use the HTTP server (which is provided by some extensions like the Quarkus RESTEasy reactive extension). Internally, this probe will also use the generated gRPC Health services.

If your application does not use any Quarkus extension that exposes an HTTP server, you can still configure the probes to directly use the gRPC Health service by adding the property quarkus.kubernetes.readiness-probe.grpc-action-enabled=true into your configuration: