Chapter 6. Building Red Hat Data Grid for OpenShift Images
The JBoss Data Grid images were automatically created during the installation of OpenShift along with the other default image streams and templates.
You can change the JBoss Data Grid configuration in the image using the S2I process or by using a modified Data Grid for OpenShift image.
6.1. Using the Data Grid for OpenShift image Source-to-Image (S2I) Process
The recommended method to run and configure the Data Grid for OpenShift image is to use the OpenShift S2I process together with the application template parameters and environment variables.
The S2I process for the Data Grid for OpenShift image works as follows:
-
If there is a pom.xml file in the source repository, a Maven build is triggered with the contents of
$MAVEN_ARGSenvironment variable. -
By default the
packagegoal is used with theopenshiftprofile, including the system properties for skipping tests (-DskipTests) and enabling the Red Hat GA repository (-Dcom.redhat.xpaas.repo.redhatga). The results of a successful Maven build are copied to JDG_HOME/standalone/deployments. This includes all JAR files from the directory within the source repository specified by
$ARTIFACT_DIRenvironment variable. The default value of$ARTIFACT_DIRis the target directory.- Any JAR, WAR, and EAR in the deployments source repository directory are copied to the JDG_HOME/standalone/deployments directory.
The JBoss Data Grid server supports only JAR deployments, which can include custom filters and converters. The JBoss Data Grid server does not support WAR and EAR deployments.
All files in the configuration source repository directory are copied to JDG_HOME/standalone/configuration.
NoteIf you want to use a custom JBoss Data Grid configuration file, it should be named clustered-openshift.xml.
- All files in the modules source repository directory are copied to JDG_HOME/modules.
Refer to the Artifact Repository Mirrors section for additional guidance on how to instruct the S2I process to utilize the custom Maven artifacts repository mirror.
6.2. Using a Modified Data Grid for OpenShift image
An alternative method is to make changes to the image, and then use that modified image in OpenShift.
The JBoss Data Grid configuration file that OpenShift uses inside the Data Grid for OpenShift image is JDG_HOME/standalone/configuration/clustered-openshift.xml, and the JBoss Data Grid startup script is JDG_HOME/bin/openshift-launch.sh.
You can run the Data Grid for OpenShift image in Docker, make the required configuration changes using the JBoss Data Grid Management CLI (JDG_HOME/bin/jboss-cli.sh), and then commit the changed container as a new image. You can then use that modified image in OpenShift.
It is recommended that you do not replace the OpenShift placeholders in the Data Grid for OpenShift image configuration file, as they are used to automatically configure services (such as messaging, datastores, HTTPS) during a container’s deployment. These configuration values are intended to be set using environment variables.
6.3. Binary Builds
To deploy existing applications on OpenShift, you can use the binary source capability.
See Example Workflow: Deploying binary build of EAP 6.4 / EAP 7.1 Infinispan application together with Data Grid for OpenShift image for an end-to-end example of a binary build.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.