Chapter 3. Environment with immutable servers
You can deploy an environment that includes one or more pods running Decision Server with preloaded services. Each Decision Server pod can be separately scaled as necessary.
In this case, any services (KJAR files) must be loaded onto a Decision Server at the time the image is created. You cannot load or unload services on a running Decision Server. The advantage of this approach is that the Decision Server with the services in it runs like any other containerized service and does not require specialized management. The Decision Server runs like any other pod on the OpenShift environment; you can use any container-based integration workflows as necessary.
When you create a Decision Server image, you must build your services using S2I (Source to Image). Provide a Git repository with the source of your services and other business assets; if you develop the services or assets in Decision Central, copy the source into a separate repository for the S2I build. OpenShift automatically builds the source, installs the process into the Decision Server image, and starts the process. No further management of the image is required. If you want to use a new version of the process, you can build a new image.
If you are using Decision Central for authoring services, you can extract the source for your process and place it into a separate Git repository (such as GitHub or an on-premise installation of GitLab) for use in the S2I build.
3.1. Extracting the source code from Decision Central for use in an S2I build
If you are using Decision Central for authoring services, you can extract the source code for your service and place it into a separate Git repository (such as GitHub or an on-premise installation of GitLab) for use in the S2I build.
Procedure
Use the following command to extract the source code:
git clone ssh://adminUser@decision-central-host:8001/MySpace/MyProject
git clone ssh://adminUser@decision-central-host:8001/MySpace/MyProject
Copy to Clipboard Copied! Replace:
-
adminUser
with the administrative user for Decision Central -
decision-central-host
with the host on which Decision Central is running -
MySpace
with the name of the Decision Central space in which the project is located -
MyProject
with the name of the project
-
- Upload the source code to another Git repository for the S2I build.
3.2. Deploying an immutable Decision Server
To deploy an immutable Decision Server, use the rhdm71-prod-immutable-kieserver.yaml
template file. You can extract this file from the rhdm-7.1.0-openshift-templates.zip
product deliverable file. You can download the file from the Software Downloads page.
When you deploy an immutable Decision Server, the deployment procedure retrieves the source code for any services that must run on this server, builds the services, and includes them in the server image.
Procedure
Use one of the following methods to deploy the template:
-
In the OpenShift Web UI, select Add to Project
Import YAML / JSON and then select or paste the rhdm71-prod-immutable-kieserver.yaml
file. In the Add Template window, ensure Process the template is selected and click Continue. To use the OpenShift command line console, prepare the following command line:
oc new-app -f <template-path>/rhdm71-prod-immutable-kieserver.yaml -p KIE_SERVER_HTTPS_SECRET=kieserver-app-secret
oc new-app -f <template-path>/rhdm71-prod-immutable-kieserver.yaml -p KIE_SERVER_HTTPS_SECRET=kieserver-app-secret
Copy to Clipboard Copied! In this command line:
-
Replace
<template-path>
with the path to the downloaded template file. -
Use as many
-p PARAMETER=value
pairs as needed to set the required parameters. You can view the template file to see descriptions for all parameters.
-
Replace
-
In the OpenShift Web UI, select Add to Project
Set the following parameters as necessary:
-
KIE Server Keystore Secret Name (
KIE_SERVER_HTTPS_SECRET
): The name of the secret for Decision Server, as created in Section 2.2, “Creating the secrets for Decision Server”. -
Application Name (
APPLICATION_NAME
): The name of the OpenShift application. It is used in the default URL for Decision Server. OpenShift uses the application name to create a separate set of deployment configurations, services, routes, labels, and artifacts. You can deploy several applications using the same template into the same project, as long as you use different application names. Also, the application name determines the name of the server configuration (server template) on the Decision Central that the Decision Server is to join. -
KIE Server Certificate Name (
KIE_SERVER_HTTPS_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 (
KIE_SERVER_HTTPS_PASSWORD
): The password for the keystore that you created in Section 2.2, “Creating the secrets for Decision Server”. -
KIE Server Container Deployment (
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 (
SOURCE_REPOSITORY_URL
): The URL for the Git repository that contains the source for your decision service. -
Git Reference (
SOURCE_REPOSITORY_REF
): The branch in the Git repository -
Context Directory (
CONTEXT_DIR
): The path to the source within the project downloaded from the Git repository -
Artifact Directory (
ARTIFACT_DIR
): 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 (
IMAGE_STREAM_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 isopenshift
. If you have installed the image streams file, the namespace is the name of the OpenShift project.
-
KIE Server Keystore Secret Name (
If your build includes dependencies that are not available on the public Maven tree and require a separate repository, set the parameters to provide this repository:
-
Maven repository URL (
MAVEN_REPO_URL
): The URL for the Maven repository. -
Maven repository username (
MAVEN_REPO_USERNAME
): The username for the Maven repository. -
Maven repository password (
MAVEN_REPO_PASSWORD
): The username for the Maven repository.
-
Maven repository URL (
If you want to use RH-SSO or LDAP authentication, complete the following additional configuration:
In the RH-SSO or LDAP service, create all user names in the deployment parameters. If you do not set any of the parameters, create users with the default user names. The created users must also be assigned to roles:
-
KIE_ADMIN_USER
: default user nameadminUser
, roles:kie-server,rest-all,admin,kiemgmt,Administrators
-
KIE_SERVER_USER
: default user nameexecutionUser
, roleskie-server,rest-all,guest
-
If you want to configure Red Hat Single Sign On (RH-SSO) authentication, an RH-SSO realm that applies to Red Hat Decision Manager must exist. A client within RH-SSO must also exist for
For the user roles that you can configure in RH-SSO, see Roles and users.
Use one of the following procedures:
If the client for Red Hat Decision Manager within RH-SSO already exists, set the following parameters in the template:
-
RH-SSO URL (
SSO_URL
): The URL for RH-SSO. -
RH-SSO Realm name (
SSO_REALM
): The RH-SSO realm for Red Hat Decision Manager. -
KIE Server RH-SSO Client name (
KIE_SERVER_SSO_CLIENT
): The RH-SSO client name for Decision Server. -
KIE Server RH-SSO Client Secret (
KIE_SERVER_SSO_SECRET
): The secret string that is set in RH-SSO for the client for Decision Server. -
RH-SSO Disable SSL Certificate Validation (
SSO_DISABLE_SSL_CERTIFICATE_VALIDATION
): Set totrue
if your RH-SSO installation does not use a valid HTTPS certificate.
-
RH-SSO URL (
To create the client for Red Hat Decision Manager within RH-SSO, set the following parameters in the template:
-
RH-SSO URL (
SSO_URL
): The URL for RH-SSO. -
RH-SSO Realm name (
SSO_REALM
): The RH-SSO realm for Red Hat Decision Manager. -
KIE Server RH-SSO Client name (
KIE_SERVER_SSO_CLIENT
): The name of the client to create in RH-SSO for Decision Server. -
KIE Server RH-SSO Client Secret (
KIE_SERVER_SSO_SECRET
): The secret string to set in RH-SSO for the client for Decision Server. -
KIE Server Custom http Route Hostname (
KIE_SERVER_HOSTNAME_HTTP
): The fully qualified host name to use for the HTTP endpoint for Decision Server. If you need to create a client in RH-SSO, you can not leave this parameter blank. -
KIE Server Custom https Route Hostname (
KIE_SERVER_HOSTNAME_HTTPS
): The fully qualified host name to use for the HTTPS endpoint for Decision Server. If you need to create a client in RH-SSO, you can not leave this parameter blank. -
RH-SSO Realm Admin Username (
SSO_USERNAME
) and RH-SSO Realm Admin Password (SSO_PASSWORD
): The user name and password for the realm administrator user for the RH-SSO realm for Red Hat Decision Manager. -
RH-SSO Disable SSL Certificate Validation (
SSO_DISABLE_SSL_CERTIFICATE_VALIDATION
): Set totrue
if your RH-SSO installation does not use a valid HTTPS certificate.
-
RH-SSO URL (
To configure LDAP, set the
AUTH_LDAP*
parameters of the template. These parameters correspond to the settings of the LdatExtended Login module of Red Hat JBoss EAP. For instructions about using these settings, see LdapExtended Login Module.Do not configure LDAP authentication and RH-SSO authentication in the same deployment.
Complete the creation of the environment, depending on the method that you are using:
In the OpenShift Web UI, click Create.
-
If the
This will create resources that may have security or project behavior implications
message appears, click Create Anyway.
-
If the
- Complete and run the command line.