Chapter 12. Helm chart use case
Helm is an open source package manager that enables you to build, deploy, and maintain your JBoss EAP XP 5.0 applications on OpenShift.
You can use Helm chart with JBoss EAP XP 5.0 to:
- Build your application from a Maven project hosted on a Git repository using OpenShift Source-to-Image (S2I).
- Deploy an application image on OpenShift with deep integration using an OpenShift cluster (TLS configuration, public route to expose the application, and so on).
- Build your application image with Helm chart and use the JBoss EAP XP operator to deploy the image.
- Build an application image for JBoss EAP XP using other methods and use the Helm chart.
- You can build your Java application with JBoss EAP XP 5.0 to create a Bootable Jar or a Jakarta deployment (similar to JBoss EAP 8.0).
-
If your Java application is a Bootable Jar, the Helm Chart for JBoss EAP XP 5.0 can be used to build the application image (using its default
build.modeset tobootable-jar). -
If your Java application is a Jakarta deployment, you can build the application image using source-to-Image (similarly to JBoss EAP 8.0) by setting the Helm Chart’s
build.modetos2i
12.1. Building and deploying JBoss EAP XP applications using Helm chart Copy linkLink copied to clipboard!
You can build your JBoss EAP XP application using Helm chart by configuring the build and deploy values. You must provide a URL to the Git repository that hosts your application code in your build configuration, the output is an ImageStreamTag resource that contains the built application image. To deploy your application, you must provide an ImageStreamTag resource that contains your built application image. The output is your deployed application and other related resources you can use to access your application from inside and outside OpenShift.
Prerequisites
- You have access to the OpenShift Development Console.
- You have the source code of your JBoss EAP XP application hosted in a Git repository.
- Your application is a Maven project.
-
You have configured your application to use the
org.jboss.eap.plugins:eap-maven-pluginto provision your JBoss EAP XP 5.0 server.
- This procedure focuses only on using the OpenShift Development Console.
- Some form sections are collapsed by default. Click > to expand and view its content.Additionally, you do not need to updated these sections to proceed.
Procedure
Log in to OpenShift Development Console.
- On the dropdown menu, click on Helm.
- On the the top right corner click create and then click on Helm Release.
- Select JBoss EAP XP 5.
- Click create and select configure via YAML view.
Build your application image from the source repository:
build: uri: <git repository URL of your application> mode: s2i
build: uri: <git repository URL of your application> mode: s2iCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Enter the secret in the
buildsection with thesourceSecretkey:build: uri: <git repository URL of your application> mode: s2i sourceSecret: <name of secret login to your Git repository>
build: uri: <git repository URL of your application> mode: s2i sourceSecret: <name of secret login to your Git repository>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
- If your application has been successfully deployed, you should see a deployed badge next to the Helm release on OpenShift Development Console.
12.1.1. Using Helm chat with Source-to-Image on JBoss EAP XP Copy linkLink copied to clipboard!
Use the eap-maven-plugin from the application pom.xml to provision your JBoss EAP server. Ensure that this plugin is configured in the OpenShift profile, the default profile, or any other active profile, with the OpenShift profile taking precedence over all others.
You must set build.mode to S2I. This is because the default value is bootable-jar for JBoss EAP XP Helm chart.
The build.s2i.featurePacks, build.s2i.galleonLayers and build.s2i.channels fields have been deprecated.
12.1.2. Using Helm chart with Bootable JAR on JBoss EAP XP Copy linkLink copied to clipboard!
In JBoss EAP XP 5.0 you can build your application as a Bootable JAR for more information about how you can do this see The Bootable JAR.
Additionally, in JBoss EAP XP 5.0 you can configure Helms Chart for JBoss EAP XP 5.0 to build an application based on Bootable JAR.
Prerequisites
- You have logged into the OpenShift Development Console.
- You have the source code of your JBoss EAP XP application hosted in a Git repository.
-
Your application is a Maven project. You have configured your application to create a bootable JAR using Maven plugin
org.wildfly.plugins:wildfly-jar-maven-plugin. To learn more see Creating a bootable JAR Maven project.
12.1.2.1. Building your application image using Bootable JAR Copy linkLink copied to clipboard!
You can build your JBoss EAP XP application image with Bootable using Helms chart by configuring the build section on the OpenShift Development Console.
-
If you are building the application with the Helm chart, you must specify the
build.urlfield with the Git URL that references your Git repository. -
You must set the
build.modefield tobootable-jar.
12.2. OpenShift volumes for persistent data storage in Helm chart for JBoss EAP XP Copy linkLink copied to clipboard!
OpenShift volumes enable containers to store and share data from various sources, including cloud storage, network file systems (NFS), or host machines. You can use Helm chart, an OpenShift package manager, to deploy applications in a consistent and reproducible manner. By adding a volume mount to a Helm chart, you can enable your application to persist data across deployments.
12.2.1. Mounting a volume with a Helm chart on JBoss EAP XP Copy linkLink copied to clipboard!
This procedure explains how to mount a secret as a volume using a Helm chart on JBoss EAP XP. Additionally, you can also use it to mount a ConfigMap. This action enables the application to securely access and use the data, protecting it from unauthorized access or tampering. For example, by mounting a secret as a volume, the sensitive data that you store in the secret appears as a file in the POD running the deployment where the secret has been mounted.
Prerequisites
- You have access to the OpenShift Development Console
-
You have created a
secret. For example, you have created a secret namedeap-app-secretthat refers to a file likekeystore.jks. -
You have identified a location where to mount the secret in the container’s file system. For example, the directory
/etc/jgroups-encrypt-secre-secret-volumeis where the secret file, such askeystore.jksis mounted. - The source code of your JBoss EAP XP application hosted in a Git repository.
- Your application is a Maven project.
-
You have configured your application to use the
org.jboss.eap.plugins:eap-maven-pluginto provision your JBoss EAP XP 5.0 server.
Procedure
Log in to OpenShift Development Console.
- On the dropdown menu, click on Helm.
- On the the top right corner click create and then click on Helm Release.
- Select JBoss EAP XP 5.
- Click create and select configure via YAML view.
Edit the YAML file specifying the volume in the
deploy.volumesfield and configure the secret to be used. You must provide the name of the volume and the secretName of the secret:volumes: - name: eap-jgroups-keystore-volume secret: secretName: eap-app-secretvolumes: - name: eap-jgroups-keystore-volume secret: secretName: eap-app-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the volume on the file system using the
deploy.volumeMountsin the deployment configuration:volumeMounts: - name: eap-jgroups-keystore-volume mountPath: /etc/jgroups-encrypt-secret-volume readOnly: truevolumeMounts: - name: eap-jgroups-keystore-volume mountPath: /etc/jgroups-encrypt-secret-volume readOnly: trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow When the pod starts, the container mounts the keystore.jks file at
/etc/jgroups-encrypt-secret-volume/keystore.jkslocation.