Quarkus is a Kubernetes-native Java framework that offers a great developer experience, providing extensions for most modern development and management needs while enabling you to write imperative and reactive code. Red Hat OpenShift is a unified platform to run your applications at scale while offering a great developer experience for managing applications and their infrastructure. Quarkus and OpenShift are a great combination. Simply put, the combination of OpenShift and Quarkus helps application engineering teams to become highly productive and have a reliable runtime for their applications at scale.
This article shows how you can quickly deploy your applications to OpenShift without worrying about build configs, pipelines, YAML, and deployment configs. We'll use the Source2Image (S2I) approach, in which you specify only the Git repo where the code sits, and OpenShift automatically deploys and make the application available at a URL.
Deploy your Quarkus application to OpenShift
For the demonstration, we'll use the Developer Sandbox for Red Hat OpenShift (available as a no-cost subscription) to deploy our Quarkus application to OpenShift.
Follow the instructions below to create a basic application. Once your application is ready, you'll publish it to a Git repository. For the sake of simplicity, let’s use a readily available Quarkus repository from https://github.com/quarkusio/quarkus-quickstarts.
- Sign up for the free Developer Sandbox for Red Hat OpenShift.
- Start your Developer Sandbox (Figure 1).
- Choose the Import from Git option under the +Add section (Figure 2).
Figure 2: Select the Import from Git option in the Developer Sandbox. - Input your Git repo URL (Figure 3). Once you input the repo URL, OpenShift automatically fills in the config to run your application. In this case, we are working with a directory in a larger repository and hence we specify the directory path where our application exists.
Figure 3: Enter the Git repository URL. - Click Create (Figure 4).
- Wait for OpenShift to build your application (Figure 5).
Figure 5: The build in progress. - Once the process is done, click on the upper-right icon to open your application URL, as shown in Figure 7.
Figure 7: Click the icon to open the application URL. - Congrats—your Quarkus application is now available on OpenShift! (Figure 8).
Figure 8: The Quarkus application upon successful deployment.
Conclusion
You can replicate the same steps on the cluster to deploy Quarkus applications on OpenShift. For more information and to stay updated about Quarkus on OpenShift, visit the Red Hat build of Quarkus product page.
Last updated: September 19, 2023