此内容没有您所选择的语言版本。

Chapter 9. Deploying JBoss Data Grid for OpenShift with Custom Configuration Files


You can use the OpenShift ConfigMap API to create a deployment that uses custom configuration instead of using the source-to-image (S2I) build process.

Note
  • Changes to the configuration via ConfigMap do not cause pods to redeploy automatically. You must manually redeploy pods if you update standalone.xml.
  • JBoss Data Grid for OpenShift deployments that you create with custom configuration files do not support shared persistent volumes that you configure with the DATAGRID_SPLIT environment variable.

9.1. Setting Up the Configuration Files and Custom Template

Create a ConfigMap that contains your configuration files and mount it to a specific directory as follows:

  1. Mount your configuration files, the ConfigMap content, in the following directory:

    /opt/datagrid/standalone/configuration/user

    At a minimum, this directory must contain standalone.xml to configure JBoss Data Grid. This directory can also contain logging.properties, application-role.properties, and other properties files that are available with the JBoss Data Grid distribution.

    Note the following requirements for your custom configuration:

    • You must explicitly define all cache and endpoint configuration in standalone.xml. You cannot use environment variables to configure caches or endpoints after you create a deployment.
    • Your cache container must be named clustered so that the default ReadinessProbe works.

      <cache-container name="clustered">
        ...
      </cache-container>
      Copy to Clipboard Toggle word wrap
    • To encrypt client to server traffic, you must configure the server identity in standalone.xml. You cannot use environment variables to configure HTTPS after you create a deployment.
  2. Create a custom template for your JBoss Data Grid for OpenShift deployment.

    1. Ensure that the template exposes the required ports and services.
    2. Set the USER_CONFIG_MAP environment variable to a value of true.
Tip

Add placeholders to your custom standalone.xml if you want to make environment variables available in your deployment.

For example, the following is a placeholder for the JGROUPS_PING_PROTOCOL:

<!-- ##JGROUPS_PING_PROTOCOL## -->
Copy to Clipboard Toggle word wrap

Refer to clustered-openshift.xml to review the default XML file for JBoss Data Grid for OpenShift. This file contains all the available placeholders.

You can find examples for deployments with custom configuration in the following files:

9.2. Creating Deployments with Custom Configuration

To deploy JBoss Data Grid for OpenShift with a custom configuration, do the following:

  1. On your master host(s), log in as a cluster administrator or a user with project administrator access to the openshift namespace.

    $ oc login -u system:admin
    Copy to Clipboard Toggle word wrap
  2. Import your custom template into the openshift namespace.

    $ oc create -n openshift -f path/to/template.yaml
    Copy to Clipboard Toggle word wrap
  3. Create a ConfigMap from the directory where your custom configuration resides.

    • To create a ConfigMap with standalone.xml only, do the following:

      $ oc create configmap datagrid-config --from-file=./standalone.xml
      Copy to Clipboard Toggle word wrap
    • To create a ConfigMap with standalone.xml and other configuration files, do the following:

      $ oc create configmap datagrid-config \
        --from-file=path/to/configuration
      Copy to Clipboard Toggle word wrap

      Where path/to/configuration is the local directory that contains the configuration files.

      The ConfigMap name should match the name that you specify in your custom template. The example template uses the name datagrid-config.

  4. Deploy JBoss Data Grid for OpenShift with your custom configuration.

    $ oc new-app user-config
    Copy to Clipboard Toggle word wrap

    The application name should match the name that you specify in your custom template. The example template uses the name user-config.

    When you deploy JBoss Data Grid for OpenShift, the configuration files are copied to the /opt/datagrid/standalone/configuration directory for the application.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat