DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Deploying a Scala API on OpenShift With OpenShift Pipelines
  • Implement a Circuit Breaker for an Unavailable API Service Running in App Connect on CP4I Using Red Hat Service Mesh
  • Building GitOps Pipelines With Helm on OpenShift: Lessons From the Trenches
  • Microservices With Apache Camel and Quarkus (Part 5)

Trending

  • Spec-Driven Integration: Turning API Sprawl Into a Governed Capability Fleet for AI
  • Pragmatica Aether: Let Java Be Java
  • Product-Led Software Delivery: Intelligent Platforms for DevOps at Scale
  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Deploying a Quarkus App on OpenShift With S2I and OpenShift Pipelines

Deploying a Quarkus App on OpenShift With S2I and OpenShift Pipelines

Here's a quick guide to creating a pipeline to deploy your Quarkus app with S2I on OpenShift.

By 
Raffael Mendes user avatar
Raffael Mendes
·
Jul. 22, 21 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
4.8K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, I'll guide you through a simple way to deploy your Quarkus app on OpenShift by creating a Pipeline and using Source-to-Image(S2I) capabilities.

Pre-Requisites

You can create your free account on here and try OpenShift for free locally using Code Ready Containers, and for the app, we're deploying we'll be using a simple timezone converter camel route that is available here.

Installing OpenShift Pipelines

To install the Openshift pipelines operator we go to the Operator Hub and search for Openshift Pipelines.

OperatorHub

And we install with the recommended options.

Install operator

When the Operator is installed and ready we move on to deploy the application

The Quarkus S2I Configuration

For the S2I process to function correctly in Openshift, we need to create a folder called .s2i with a file called environment and add the following to the file

Properties files
 
MAVEN_S2I_ARTIFACT_DIRS=target/quarkus-app
S2I_SOURCE_DEPLOYMENTS_FILTER=app lib quarkus quarkus-run.jar
JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0
AB_JOLOKIA_OFF=true
JAVA_APP_JAR=/deployments/quarkus-run.jar

With this, we ensure the correct behavior of the S2I process.

Deploying the App and the Pipeline

Now we change for the developer perspective in Openshift and will add an application from there.

We'll choose +add -> From Git and add these values as per the screenshot below:

Git Repo Url: here

Git Reference: main

Context-dir: /quarkus-camel-tz-converter

quarkus git

For the builder image, we can use any of the java-11 available (openjdk-11-ubi8 or openjdk-11-el7) and we'll check the box that says Add pipeline, so it'll suggest a base template parameter for java based apps just like the screenshot below:

PipelinesWith that done we click on create and wait for our pipeline to execute. We can check by going to the Pipeline Runs screen.

camel examples

Testing the App

To test the app we can make a curl request to the route and see that our value is converted.

Shell
 
curl $(oc get route camel-examples-git -o jsonpath='{.spec.host}')/convert/2021-07-20%2011%3A30/UTC/Universal 
2021-07-20T11:30

Next Steps

A good next step is to deploy using the native builder image, but this will be covered in another article. Hope you all enjoy this simple way of deploying a Quarkus app on OpenShift.

app OpenShift Pipeline (software) Quarkus

Opinions expressed by DZone contributors are their own.

Related

  • Deploying a Scala API on OpenShift With OpenShift Pipelines
  • Implement a Circuit Breaker for an Unavailable API Service Running in App Connect on CP4I Using Red Hat Service Mesh
  • Building GitOps Pipelines With Helm on OpenShift: Lessons From the Trenches
  • Microservices With Apache Camel and Quarkus (Part 5)

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook