Deploy custom configuration files, modules, and source deployments on JBoss EAP for Openshift

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform (Openshift)
    • 4
    • 3
  • Red Hat JBoss Enterprise Application Platform (JBoss EAP)
    • 8
    • 7
  • Custom modules
  • Source-based WAR deployments

Issue

Resolution

  1. Create a source repository for the deployment

  2. Place configuration/standalone-openshift.xml within the configuration directory. Anything in that directory will be copied to JBOSS_ROOT/standalone/configuration.

  3. Place custom modules under the modules directory within your source repository. The modules directory will be recursively copied to JBOSS_ROOT/modules so they need to have the correct directory structure.

    Note: some modules like mysql modules are already included in the base image and there is a template to support the configuration, Content from github.com is not included.eap6-mysql-sti.json

     $ find /opt/eap/modules/ |grep mysql
     ./system/layers/openshift/com/mysql
     ./system/layers/openshift/com/mysql/main
     ./system/layers/openshift/com/mysql/main/mysql-connector-java.jar
     ./system/layers/openshift/com/mysql/main/module.xml
    
     $ find  /opt/eap/modules/ |grep postgres
     ./system/layers/openshift/org/postgresql
     ./system/layers/openshift/org/postgresql/main
     ./system/layers/openshift/org/postgresql/main/postgresql-jdbc.jar
     ./system/layers/openshift/org/postgresql/main/module.xml
    

    NOTE: Here is a list of Included JBoss Modules

  4. Add any deployments under the deployments directory in your source repository. If you want to build the deployment, you can put a pom.xml file at the root of the source. Openshift will use the Maven goal package.

Root Cause

Openshift deployments use the the S2I process (Source to Image) to generate an image from a base image and source repository. For more information and details, see How the JBoss EAP for OpenShift S2I Process Works

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.