Skip to main content
Redhat Developers  Logo
  • 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 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

    • OpenShift AI learning
    • 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.
    • Explore the solution
  • 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

    • Access product downloads to start building and testing right away.
    • 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.
    • Explore the benefits

Deploy a Java application using Helm, Part 1

October 19, 2021
Daniel Oh
Related topics:
DevOpsHelmJavaKubernetes
Related products:
Red Hat JBoss Enterprise Application PlatformRed Hat OpenShift

    To deploy enterprise Java applications with Red Hat JBoss Enterprise Application Platform (JBoss EAP) servers to Red Hat OpenShift, developers have usually needed to learn how to use OpenShift templates or Operators to specify Kubernetes and OpenShift resources such as build config, deployment, volume, environment variables, and application image. This article, the first of a two-part series, explains a simpler way to deploy an enterprise Java application to OpenShift using Helm charts, and how to connect the application to a PostgreSQL database.

    Note: In Part 2, learn how to make this application a bootable JAR using JBoss EAP Extension Pack (XP) with a Helm chart. 

    Helm: Simplifying application deployment on Kubernetes

    Deployment practices are not familiar to application developers because resource definition has traditionally been determined by the IT operations team. When moving rapidly into the DevOps era, developers need to take more responsibility to set appropriate resources in alignment with cloud microservices.

    To solve these problems for developers, Helm was designed to simplify application deployment on Kubernetes. Helm is a software package manager similar to the DNF package manager in Fedora and the Windows Package Manager. Package managers allow developers to install software tools and maintain them (e.g., upgrade, delete, and patch) quickly using a command-line interface or graphical user interface (GUI).

    Developers can install a particular collection of files representing Kubernetes resources by using a Helm chart. When the chart is installed, it is managed by a release. The developer can delete or upgrade the release on demand to make application deployment changes.

    OpenShift also supports a Helm chart to deploy applications with multiple runtime environments, including JBoss EAP. Developers can select and install a Helm chart from OpenShift's developer perspective. Then they can upgrade, roll-back, and uninstall an existing Helm chart (release) during the application lifecycle.

    At the end of this article, you will have a traditional enterprise Java application running on clustered JBoss EAP servers that connect to a PostgreSQL database using the JBoss EAP Helm chart, as shown in Figure 1.

    Note: The Helm charts for JBoss EAP 7.4 are a technology preview feature on OpenShift 4.8, so support is limited when you use these features in production environments.

    Application Development process using JBoss EAP and a PostgreSQL
    Figure 1. Application development process using JBoss EAP and a database.

    Installing a JBoss EAP Helm chart

    Go to the developer console in OpenShift and navigate to the Topology view. Create a new project named eap-helm-demo by clicking the Add to Project icon on the left top and entering EAP into the search box. Then select the Eap74 v1.1.0 Helm chart and click Install Helm Chart, as shown in Figure 2.

    Adding the JBoss EAP 7.4 Helm chart
    Figure 2. Adding the JBoss EAP 7.4 Helm chart.

    Now define a specific build, image, and deployment for an example Todo back-end application. Switch to the YAML view to add Source-to-Image (S2I) build and deploy configurations, as shown in Figure 3.

    Adding the S2I configurations
    Figure 3. Adding the S2I configurations.

    JBoss EAP 7.4 provides a galleon feature pack to add data sources, content trimming, and MicroProfile specifications for enterprise Java applications. Three feature packs (cloud-server, postgresql-datasource, and ejb) are installed while the S2I build runs. The following snippet shows how you can define S2I mode with a galleon feature pack for a PostgreSQL data source in the build section, as well as how to set the clustered servers (with three replicas) in the deploy section:

    build:
      mode: s2i
      s2i:
        featurePacks:
          - org.jboss.eap:eap-datasources-galleon-pack:7.4.0.GA-redhat-00003
        galleonLayers: cloud-server,postgresql-datasource,ejb
      env:
        - name: ARTIFACT_DIR
          value: todo-backend/target
     deploy:
      replicas: 3

    Click the Install button after you add the custom configuration to the YAML file. You can find the entire YAML configuration at the Todo back-end repository.

    Note: You will probably see an ErrImagePull or ImagePullBackOff message in the resources, as shown in Figure 4. No worries—your JBoss EAP 7.4 application is building successfully, but your deployment will report ErrImagePull and ImagePullBackOff until the build is complete.

    ErrImagePull during deployment
    Figure 4. ErrImagePull during deployment.

    Deploying a PostgreSQL database

    Let’s now deploy a new PostgreSQL database to communicate with the JBoss EAP servers. Right-click on the Topology view, then select Database in the pop-up menu. Next, enter postgres into the search box and click on the PostgreSQL (Ephemeral) template, as shown in Figure 5.

    Creating a PostgreSQL database from the OpenShift console
    Figure 5. Creating a PostgreSQL database from the OpenShift console.

    Click Instantiate Template and fill in the following fields, as shown in Figure 6, leaving the other fields at their default values.

    • Database Service Name: todos-db
    • PostgreSQL Connection Username: todos-db
    • PostgreSQL Connection Password: todos-db
    • PostgreSQL Database Name: todos-db

    Then click Create, as shown in Figure 6.

    Key values in the PostgreSQL template
    Figure 6. PostgreSQL configuration in the "Instantiate Template" screen.

    Once the application build is complete, your image is automatically rolled out as shown in Figure 7. Create a connector between the JBoss EAP pod and the PostgreSQL pod via the drag-and-drop feature in the Topology view.

    Successful build and deployment for JBoss EAP application and PostgreSQL
    Figure 7. Successful build and deployment of your JBoss EAP application and PostgreSQL database.

    When you click Open URL, a new web page opens automatically. Copy the route URL for the next step.

    Testing the enterprise Java application

    When the deployment is complete, visit your Todo front-end application by opening a new window in a web browser and pasting in the route URL you copied in the previous step. Then click the go button shown in Figure 8.

    Todo front-end GUI
    Figure 8. Todo front-end GUI.

    Now you should be able to add, update, and remove items in the to-do list, as shown in Figure 9.

    To-do list
    Figure 9. To-do list.

    What’s next

    This article has shown how to deploy traditional enterprise Java applications to the cloud on Red Hat OpenShift using a Helm chart. The JBoss EAP Helm chart lets Java developers specify the application runtime environment on JBoss EAP in terms of build strategy, source repository, galleon feature packs, and server replication (clustering). The procedures shown in this article are much easier for developers than using OpenShift templates or Kubernetes Operators.

    Read next: The next article in this series walks you through how to make this application a bootable JAR using JBoss EAP Extension Pack (XP) with a Helm chart.

    Additional resources:

    • JBoss EAP Quickstarts
    • Getting Started with JBoss EAP for OpenShift Container Platform
    • Instructions for developing Jakarta EE applications for Red Hat JBoss Enterprise Application Platform
    Last updated: July 25, 2023

    Related Posts

    • Deploy .NET applications on Red Hat OpenShift using Helm

    • Deploy Node.js applications to Red Hat OpenShift with Helm

    • Advanced Helm support in the OpenShift 4.5 web console

    • Deploy Helm charts with Jenkins CI/CD in Red Hat OpenShift 4

    Recent Posts

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    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

    Chat Support

    Please log in with your Red Hat account to access chat support.