Red Hat Training

A Red Hat training course is available for Red Hat Decision Manager

Chapter 3. Deploying Red Hat Decision Manager in your OpenShift environment

To deploy Red Hat Decision Manager in your OpenShift environment, use the OpenShift templates that are provided with Red Hat Decision Manager.

Prerequisites

You must complete the preparatory tasks as described in Chapter 2, Preparing to deploy Red Hat Decision Manager in your OpenShift environment.

Note

As an alternative to using the OpenShift web UI, you can use the oc command line tool to deploy the templates and set their parameters. For details, see the documentation for the version of OpenShift in your environment.

3.1. Deploying Decision Central and Decision Server

You can deploy Decision Central on the OpenShift infrastructure together with Decision Server. In this case, you can use Decision Central to manage the Decision Server and to develop new rules.

Procedure

  1. In the OpenShift Web UI, select Add to Project → Browse Catalog, search for decision, and then select the Red Hat Decision Manager 7.0 applications (Persistent with https) template.

    • If this template is not available, download the rhdm-7.0.1-openshift-templates.zip product deliverable file from the Software Downloads page for Red Hat Decision Manager 7.0. Extract the rhdm70-full.yaml file. Select Add to Project → Import YAML / JSON and then select or paste the rhdm70-full.yaml file. In the Add Template window, ensure Process the template is selected and click Continue.
  2. Set the following mandatory parameters:

    • Application Name: The name of the OpenShift application. It is used in the default URLs for Decision Central and Decision Server.
    • Decision Central Server Certificate Name: The name of the certificate in the keystore that you created in Section 2.3, “Creating the secrets for Decision Central”.
    • Decision Central Server Keystore Password: The password for the keystore that you created in Section 2.3, “Creating the secrets for Decision Central”.
    • KIE Server Certificate Name: The name of the certificate in the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”.
    • KIE Server Keystore Password: The password for the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”.
    • KIE Server ID: The name of the server template on the Decision Central that the Decision Server is to join. Set this parameter to any value. If you do not set it and then the Decision Server pod is restarted or scaled, each new instance of the server might join a new template.
    • ImageStream Namespace: The namespace where the image streams are available. If the image streams were already available in your OpenShift environment (see Section 2.1, “Ensuring the availability of image streams”), the namespace is openshift. If you have installed the image streams file, the namespace is the name of the OpenShift project.

      You can also set other parameters as necessary. In particular, you can change the username and password for the Maven repository that is built into Decision Central. Use the Maven repository username and Maven repository password fields.

      ATTENTION: Do not change the Maven repository URL field. If you change it, the Decision Server will work with a different Maven repository, but the Decision Central will still use its own built-in repository. Therefore, the Decision Central will not deploy services to the Decision Server.

  3. Click Create.

3.2. Deploying Decision Server using Source to Image (S2I)

You can deploy Decision Server on the OpenShift infrastructure using Source to Image (S2I). In this case, provide a Git repository with the source of your decision service. OpenShift automatically builds the source, installs the decision service into the Decision Server image, and starts the service. No further management of the image is required. If you want to use a new version of the decision service, you can build a new image. This option is often preferable for typical version management approaches (DevOps) in a containerized infrastructure.

You can deploy Decision Server using S2I with or without support for HTTPS.

Before you begin

Ensure that the complete source code for your decision service is available in a Git repository that the OpenShift server can access. The source code is built using a Maven process, so it must include a pom.xml file.

Procedure

  1. In the OpenShift Web UI, select Add to Project → Browse Catalog, search for decision, and then select the Red Hat Decision Manager Execution Server 7.0 S2I Ephemeral (no https) or Red Hat Decision Manager Execution Server 7.0 S2I (Ephemeral with https) template.

    • If this template is not available, download the rhdm-7.0.1-openshift-templates.zip product deliverable file from the Software Downloads page for Red Hat Decision Manager 7.0. Extract the rhdm70-kieserver-basic-s2i.yaml or rhdm70-kieserver-https-s2i.yaml file. Select Add to Project → Import YAML / JSON and then select or paste the file. In the Add Template window, ensure Process the template is selected and click Continue.
  2. Set the following mandatory parameters:

    • Application Name: The name of the OpenShift application. It is used in the default URLs for Decision Central and Decision Server.
    • KIE Server Certificate Name: The name of the certificate in the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”. Not available if you are configuring a server without HTTPS support.
    • KIE Server Keystore Password: The password for the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”. Not available if you are configuring a server without HTTPS support.
    • KIE Server Container Deployment: The identifying information of the decision service (KJAR file) that is built from your source. The format is: <containerId>=<groupId>:<artifactId>:<version>. You can provide two or more KJAR files using the | separator, for example: containerId=groupId:artifactId:version|c2=g2:a2:v2. The Maven build process must produce all these files from the source in the Git repository.
    • Git Repository URL: The URL for the Git repository that contains the source for your decision service.
    • Git Reference: The branch in the Git repository
    • Context Directory: The path to the source within the project downloaded from the Git repository
    • Artefact Directory: The path within the project that contains the required binary files (KJAR files and any other necessary files) after a successful Maven build. Normally this directory is the target directory of the build. However, you can provide prebuilt binaries in this directory in the Git repository
    • ImageStream Namespace: The namespace where the image streams are available. If the image streams were already available in your OpenShift environment (see Section 2.1, “Ensuring the availability of image streams”), the namespace is openshift. If you have installed the image streams file, the namespace is the name of the OpenShift project.

      You can also set other parameters as necessary. In particular, if the Maven build of your decision service pulls packages from a Maven repository, you can set the URL for a mirror repository and, if necessary, set the username and password to access the mirror repository. In this case, the build process will pull packages from the mirror repository instead of the configured original repository:

      • Maven mirror URL
      • Maven repository username
      • Maven repository password
  3. Click Create.

3.3. Deploying Decision Server without using Source to Image (S2I)

You can deploy Decision Server on the OpenShift infrastructure without Decision Central and without S2I. In this case, Decision Server can pick up a decision service from a Maven repository. You can configure the Decision Server to load a service automatically; alternatively, you can manage the Decision Server using Decision Central, a controller, or the API.

Before you begin

Ensure that the Maven repository for your decision service is available.

If you are planning to use Decision Central or a management console, ensure that it is installed and record its settings for controlling a KIE server.

Procedure

  1. In the OpenShift Web UI, select Add to Project → Browse Catalog, search for decision, and then select the Red Hat Decision Manager Execution Server 7.0 (Ephemeral with https) template.

    • If this template is not available, download the rhdm-7.0.1-openshift-templates.zip product deliverable file from the Software Downloads page for Red Hat Decision Manager 7.0. Extract the rhdm70-kieserver.yaml. Select Add to Project → Import YAML / JSON and then select or paste the rhdm70-kieserver.yaml file. In the Add Template window, ensure Process the template is selected and click Continue.
  2. Set the following mandatory parameters:

    • Application Name: The name of the OpenShift application. It is used in the default URLs for Decision Central and Decision Server.
    • KIE Server Certificate Name: The name of the certificate in the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”.
    • KIE Server Keystore Password: The password for the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”.
    • ImageStream Namespace: The name of the OpenShift project.

      You can also set other parameters as necessary. In particular:

      • If you want to set the Maven repository for retrieving the decision service, set the following parameters to point to the repository:

        • Maven repository URL
        • Maven repository username
        • Maven repository password
      • If you want to configure the Decision Server to load a decision service automatically, set the following parameter:

        • KIE Server Container Deployment: The identifying information of the decision service (KJAR file). The format is: <containerId>=<groupId>:<artifactId>:<version>. You can provide two or more KJAR files using the | separator, for example: containerId=groupId:artifactId:version|c2=g2:a2:v2. The Decision Server pulls the files from the Maven repository.
      • If you want to use Decision Central deployed on the same OpenShift infrastructure to manage the Decision Server, set the following parameter:

        • KIE server controller service: The OpenShift service name for the Decision Central
        • KIE server controller user: a user name for logging onto the Decision Central
        • KIE server controller password: The password for logging onto the Decision Central
        • KIE Server ID: The name of the server template on the Decision Central that this server is to join.
      • If you want to use Decision Central or a controller to manage the Decision Server, set the protocol, host, and port parameters according to the URL that you use to access the web user interface of the Decision Central or according to the configuration of the controller:

        • KIE server controller protocol (http or https)
        • KIE server controller host
        • KIE server controller port
        • KIE server controller user: a user name for logging onto the Decision Central or controller
        • KIE server controller password: The password for logging onto the Decision Central or controller
        • KIE Server ID: The name of the server template on the Decision Central or controller that this server is to join.
  3. Click Create.