Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

10 reasons to develop Quarkus applications on Red Hat OpenShift

January 15, 2021
Jeff Beck
Related topics:
JavaKubernetesQuarkusServerless
Related products:
Red Hat OpenShift

    Combining Quarkus with Red Hat OpenShift provides an ideal environment for creating scalable, fast, and lightweight applications. Quarkus significantly increases developer productivity with tooling, pre-built integrations, application services, and more. This article presents 10 reasons why you should develop your Quarkus applications on OpenShift.

    Reason 1: One-step OpenShift deployment

    You don’t have to be an OpenShift expert to deploy Quarkus applications. The Quarkus OpenShift extension automatically generates OpenShift resources, making it easy to get started. The extension provides multiple deployment options, including Jib, Docker, and Source-to-Image (S2i). It also creates a DeploymentConfig, which triggers an automatic redeployment whenever a change is detected in the ImageStream.

    Here is a simple example of a Quarkus deployment on OpenShift:

    //deploy JVM-based app on OpenShift
    //add OpenShift extension
    mvn quarkus:add-extension -Dextensions="openshift"
    
    //application.properties
    quarkus.s2i.base-jvm-image=
    quarkus.openshift.expose=true
    
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: Deploying Quarkus on OpenShift.

    Reason 2: One-step serverless function deployment

    Quarkus applications, especially those compiled to native code, are ideal for serverless applications due to their small size and fast boot times. The Quarkus OpenShift extension also makes it easy to deploy and scale Knative serverless services. As a developer, you don’t need to worry about server provisioning or maintaining the underlying infrastructure. You simply write your code and package it in a container for deployment.

    Here is an example of a serverless function deployment:

    //deploy serverless knative app on OpenShift
    //add OpenShift extension
    mvn quarkus:add-extension -Dextensions="openshift"
    
    //application.propertiesquarkus.s2i.base-jvm-image=
    quarkus.kubernetes.deployment-target=knative
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: Using Knative via OpenShift Serverless.

    Reason 3: Live coding

    The traditional Java development workflow is a major drain on productivity. It can take minutes to complete each iteration in a cycle. The Quarkus live coding feature solves this problem. Figure 1 illustrates an example workflow when running in development mode.

    The write and refresh development cycle in Quarkus
    Figure 1: The write and refresh development cycle in Quarkus.

    Here's the command to run Quarkus in development mode:

    mvn compile quarkus:dev
    

    Given this command, Quarkus checks to see if any application source files have changed. If they have, Quarkus transparently compiles the changed files and redeploys the application.

    Learn more: Live coding with Quarkus.

    Reason 4: Remote development and debugging

    You can also do live coding remotely, in development mode, in a clustered OpenShift or Kubernetes environment. Any changes you make locally will be immediately visible in the clustered environment. Remote development and debugging lets you create applications in the same environment where your applications will run. The key is building a mutable application:

    //application.properties
    quarkus.package.type=mutable-jar
    quarkus.live-reload.password=abc123
    quarkus.kubernetes.env.vars.QUARKUS_LAUNCH_DEVMODE=true
    
    //Deploy
    mvn clean install -Dquarkus.kubernetes.deploy=true
    
    //Start
    mvnw quarkus:remote-dev -Dquarkus.live-reload.url=
    

    Learn more: Building Quarkus applications in remote development mode.

    Reason 5: Access to OpenShift ConfigMaps and secrets

    Quarkus includes a kubernetes-config extension that lets you use Kubernetes ConfigMaps and secrets as a configuration source. You never even have to mount them into the pod running your Quarkus application. Instead, your Quarkus application reads ConfigMaps and secrets directly from the Kubernetes API server using the Kubernetes client:

    //application.properties
    quarkus.kubernetes-config.enabled=true
    quarkus.kubernetes-config.secrets.enabled=true
    quarkus.kubernetes-config.config-maps=
    
    mvn clean package -Dquarkus.kubernetes.deploy=true
    

    Learn more: The Quarkus kubernetes-config extension.

    Reason 6: Health endpoints

    Quarkus uses the MicroProfile Health specification (via the SmallRye extension) to provide information about the application state, such as availability and status. This information is useful in cloud environments where automated processes must frequently determine whether to discard or restart an application. Most Quarkus client extensions have built-in health status enabled by default:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="smallrye-health"
    
    //validate health extension
    mvnw compile quarkus:dev
    curl http://localhost:8080/health/live
    
    //org.acme.microprofile.health.SimpleHealthCheck class
    package org.acme.microprofile.health;
    import org.eclipse.microprofile.health.HealthCheck;
    import org.eclipse.microprofile.health.HealthCheckResponse;
    import org.eclipse.microprofile.health.Liveness;
    import javax.enterprise.context.ApplicationScoped;
    
    @Liveness
    @ApplicationScoped
    
    public class SimpleHealthCheck implements HealthCheck {
    
    @Override
    public HealthCheckResponse call() {
    return HealthCheckResponse.up("Simple health check");
    }
    }
    

    Learn more: Using the MicroProfile Health specification in Quarkus.

    Reason 7: Application metrics support

    Quarkus uses the Micrometer extension to support capturing runtime and application metrics. These metrics provide insight into what is happening inside the application. You can also format Micrometer extension metrics for processing with tools like Prometheus and Grafana, which support analysis and visualization:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="micrometer"
    
    //validate health extension
    mvnw compile quarkus:dev
    
    //Code snippet to discover, count, store, and record prime numbers
    @Path("/")
    public class PrimeNumberResource {
    
    private final LongAccumulator highestPrime = new LongAccumulator(Long::max, 0);
    
    private final MeterRegistry registry;
    
    PrimeNumberResource(MeterRegistry registry) {
    this.registry = registry;
    // Create a gauge to obtain the highest observed prime number
    registry.gauge("prime.number.max", this,PrimeNumberResource::highestObservedPrimeNumber);}
    
    // Return the highest observed prime value
    long highestObservedPrimeNumber() {
    return highestPrime.get();}
    }
    

    Learn more: The MicroProfile Metrics API in Quarkus.

    Reason 8: Tracing support

    Quarkus uses the MicroProfile OpenTracing specification (via the SmallRye extension) to provide distributed tracing across services for interactive web applications. The SmallRye extension includes the default Jaeger tracer to monitor and troubleshoot transactions in a distributed system:

    //add Kubernetes-config extension
    mvn quarkus:add-extension -Dextensions="smallrye-opentracing"
    
    //validate health extension
    mvnw compile quarkus:dev
    
    //REST endpoints are automatically traced. Here's how to trace additional methods
    import javax.enterprise.context.ApplicationScoped;
    import org.eclipse.microprofile.opentracing.Traced;
    
    @Traced
    @ApplicationScoped
    public class FrancophoneService {
    public String bonjour() {
    return "bonjour";}
    }
    

    Learn more: Using OpenTracing in Quarkus applications.

    Reason 9: Developer tooling

    You might come for the performance, but you'll stay for the developer productivity. Developer tooling makes it even easier to develop and deploy Quarkus applications on OpenShift. Here are a few examples:

    • IDE support: Quarkus utilizes the Quarkus Language Server to support your favorite IDE, including VSCode, Eclipse, IntelliJ, and more.
    • Build tools: Quarkus also supports Maven and Gradle build tools.
    • Codestarts: Extension codestarts include code examples and documentation to make it easier for developers new to Quarkus to create applications.

    Reason 10: Compatibility with Spring APIs

    Spring is a dominant Java framework for developers, but Spring applications were not designed for cloud-native environments like OpenShift. Quarkus, on the other hand, was created and optimized for the cloud. As a result, Quarkus can reduce cloud-resource efficiency by up to 64%.

    If you need cloud-native efficiency but prefer to stick with the framework you know, Quarkus provides a Spring-compatibility layer. This means you can create applications using the Spring APIs you are familiar with, including data, web, config, security, dependency injection, and more. Here's an example of Spring web development in Quarkus:

    //Spring Web example
    import java.util.List;
    import org.springframework.web.bind.annotation.*;
    
    @RestController
    @RequestMapping("/person")
    public class PersonController {
    @GetMapping(path = "/greet/{id}", produces = "text/plain")
    
    public String greetPerson(@PathVariable(name = "id") long id) {
    String name="";
    return name;
    }
    
    @GetMapping(produces = "application/json")
    public Iterable findAll() {
    return personRepository.findAll();
    }
    

    Learn more: Quarkus for Spring developers.

    Get started with Quarkus

    I hope the availability of developer tooling, pre-built integrations, and application services inspires you to develop your first Quarkus application on OpenShift. These additional resources will help you get started:

    • Interactive tutorials: The Quarkus homepage includes numerous interactive tutorials that walk you through building Quarkus applications in a pre-configured OpenShift environment.
    • Generate a Quarkus project: Quarkus project initializers make it easy to select extensions and generate sample applications for both the community and Red Hat builds of Quarkus.
    • OpenShift access: Red Hat provides several options for accessing an OpenShift environment, including the developer sandbox shown in Figure 2.
      The sandbox include quick starts, samples, and a variety of deployment options.
      Figure 2: The OpenShift developer sandbox.

      Learn more about the possibilities of using a Red Hat OpenShift 4 cluster on your computer, in your datacenter, and more.

     

    Last updated: January 2, 2024

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI