Este contenido no está disponible en el idioma seleccionado.
Chapter 2. Preparing to deploy Red Hat Decision Manager in your OpenShift environment
Before deploying Red Hat Decision Manager in your OpenShift environment, you must complete several tasks. You do not need to repeat these tasks if you want to deploy additional images, for example, for new versions of decision services or for other decision services
2.1. Ensuring the availability of image streams and the image registry Copiar enlaceEnlace copiado en el portapapeles!
To deploy Red Hat Decision Manager components on Red Hat OpenShift Container Platform, you must ensure that OpenShift can download the correct images from the Red Hat registry. To download the images, OpenShift requires image streams, which contain the information about the location of images. OpenShift also must be configured to authenticate with the Red Hat registry using your service account user name and password.
Some versions of the OpenShift environment include the required image streams. You must check if they are available. If image streams are available in OpenShift by default, you can use them if the OpenShift infrastructure is configured for registry authentication server. The administrator must complete the registry authentication configuration when installing the OpenShift environment.
Otherwise, you can configure registry authentication in your own project and install the image streams in that project.
Procedure
- Determine whether Red Hat OpenShift Container Platform is configured with the user name and password for Red Hat registry access. For details about the required configuration, see Configuring a Registry Location. If you are using an OpenShift Online subscription, it is configured for Red Hat registry access.
 If Red Hat OpenShift Container Platform is configured with the user name and password for Red Hat registry access, enter the following commands:
oc get imagestreamtag -n openshift | grep -F rhdm75-decisioncentral-openshift oc get imagestreamtag -n openshift | grep -F rhdm75-kieserver-openshift
$ oc get imagestreamtag -n openshift | grep -F rhdm75-decisioncentral-openshift $ oc get imagestreamtag -n openshift | grep -F rhdm75-kieserver-openshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the outputs of both commands are not empty, the required image streams are available in the
openshiftnamespace and no further action is required.If the output of one or both of the commands is empty or if OpenShift is not configured with the user name and password for Red Hat registry access, complete the following steps:
- 
								Ensure you are logged in to OpenShift with the 
occommand and that your project is active. - Complete the steps documented in Registry Service Accounts for Shared Environments. You must log in to the Red Hat Customer Portal to access the document and to complete the steps to create a registry service account.
 - Select the OpenShift Secret tab and click the link under Download secret to download the YAML secret file.
 - 
								View the downloaded file and note the name that is listed in the 
name:entry. Enter the following commands:
oc create -f <file_name>.yaml oc secrets link default <secret_name> --for=pull oc secrets link builder <secret_name> --for=pull
oc create -f <file_name>.yaml oc secrets link default <secret_name> --for=pull oc secrets link builder <secret_name> --for=pullCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<file_name>with the name of the downloaded file and<secret_name>with the name that is listed in thename:entry of the file.- 
								Download the 
rhdm-7.5.1-openshift-templates.zipproduct deliverable file from the Software Downloads page and extract therhdm75-image-streams.yamlfile. Enter the following command:
oc apply -f rhdm75-image-streams.yaml
$ oc apply -f rhdm75-image-streams.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you complete these steps, you install the image streams into the namespace of your project. In this case, when you deploy the templates, you must set the
IMAGE_STREAM_NAMESPACEparameter to the name of this project.
- 
								Ensure you are logged in to OpenShift with the 
 
2.2. Creating the secrets for Decision Server Copiar enlaceEnlace copiado en el portapapeles!
OpenShift uses objects called secrets to hold sensitive information such as passwords or keystores. For more information about OpenShift secrets, see the Secrets chapter in the OpenShift documentation.
You must create an SSL certificate for HTTP access to Decision Server and provide it to your OpenShift environment as a secret.
Procedure
Generate an SSL keystore with a private and public key for SSL encryption for Decision Server. For more information on how to create a keystore with self-signed or purchased SSL certificates, see Generate a SSL Encryption Key and Certificate.
NoteIn a production environment, generate a valid signed certificate that matches the expected URL for Decision Server.
- 
						Save the keystore in a file named 
keystore.jks. - 
						Record the name of the certificate. The default value for this name in Red Hat Decision Manager configuration is 
jboss. - 
						Record the password of the keystore file. The default value for this name in Red Hat Decision Manager configuration is 
mykeystorepass. Use the
occommand to generate a secret namedkieserver-app-secretfrom the new keystore file:oc create secret generic kieserver-app-secret --from-file=keystore.jks
$ oc create secret generic kieserver-app-secret --from-file=keystore.jksCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
2.3. Extracting the source code from Business Central for use in an S2I build Copiar enlaceEnlace copiado en el portapapeles!
If you are using Business 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 https://<decision-central-host>:443/git/<MySpace>/<MyProject>
git clone https://<decision-central-host>:443/git/<MySpace>/<MyProject>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command, replace the following variables:
- 
								
<decision-central-host>with the host on which Business Central is running - 
								
<MySpace>with the name of the Business Central space in which the project is located - 
								
<MyProject>with the name of the project 
NoteTo view the full Git URL for a project in Business Central, click Menu
Design <MyProject> Settings. NoteIf you are using self-signed certificates for HTTPS communication, the command might fail with an
SSL certificate problemerror message. In this case, disable SSL certificate verification ingit, for example, using theGIT_SSL_NO_VERIFYenvironment variable:env GIT_SSL_NO_VERIFY=true git clone https://<decision-central-host>:443/git/<MySpace>/<MyProject>
env GIT_SSL_NO_VERIFY=true git clone https://<decision-central-host>:443/git/<MySpace>/<MyProject>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 
								
 - Upload the source code to another Git repository, such as GitHub or GitLab, for the S2I build.
 
2.4. Preparing a Maven mirror repository for offline use Copiar enlaceEnlace copiado en el portapapeles!
If your Red Hat OpenShift Container Platform environment does not have outgoing access to the public Internet, you must prepare a Maven repository with a mirror of all the necessary artifacts and make this repository available to your environment.
You do not need to complete this procedure if your Red Hat OpenShift Container Platform environment is connected to the Internet.
Prerequisites
- A computer that has outgoing access to the public Internet is available.
 
Procedure
- Prepare a Maven release repository to which you can write. The repository must allow read access without authentication. Your OpenShift environment must have access to this repository. You can deploy a Nexus repository manager in the OpenShift environment. For instructions about setting up Nexus on OpenShift, see Setting up Nexus. Use this repository as a mirror repository. If you are planning to create immutable servers from KJAR services, place your services in this repository as well. You must configure this repository as the external Maven repository. You cannot configure a separate mirror repository in an immutable environment.
 On the computer that has an outgoing connection to the public Internet, complete the following steps:
- Download the latest version of the Offliner tool.
 - 
								Download the 
rhdm-7.5.1-offliner.txtproduct deliverable file from the Software Downloads page of the Red Hat Customer Portal. Enter the following command to use the Offliner tool to download the required artifacts:
java -jar offliner-<version>.jar -r https://maven.repository.redhat.com/ga/ -r https://repo1.maven.org/maven2/ -d /home/user/temp rhdm-7.5.1-offliner.txt
java -jar offliner-<version>.jar -r https://maven.repository.redhat.com/ga/ -r https://repo1.maven.org/maven2/ -d /home/user/temp rhdm-7.5.1-offliner.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
/home/user/tempwith an empty temporary directory and<version>with the version of the Offliner tool that you downloaded. The download can take a significant amount of time.- Upload all artifacts from the temporary directory to the Maven mirror repository that you prepared. You can use the Maven Repository Provisioner utility to upload the artifacts.
 
If you developed services outside Business Central and they have additional dependencies, add the dependencies to the mirror repository. If you developed the services as Maven projects, you can use the following steps to prepare these dependencies automatically. Complete the steps on the computer that has an outgoing connection to the public Internet.
- 
								Create a backup of the local Maven cache directory (
~/.m2/repository) and then clear the directory. - 
								Build the source of your projects using the 
mvn clean installcommand. For every project, enter the following command to ensure that Maven downloads all runtime dependencies for all the artifacts generated by the project:
mvn -e -DskipTests dependency:go-offline -f /path/to/project/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true
mvn -e -DskipTests dependency:go-offline -f /path/to/project/pom.xml --batch-mode -Djava.net.preferIPv4Stack=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
/path/to/project/pom.xmlwith the correct path to thepom.xmlfile of the project.- 
								Upload all artifacts from the local Maven cache directory (
~/.m2/repository) to the Maven mirror repository that you prepared. You can use the Maven Repository Provisioner utility to upload the artifacts. 
- 
								Create a backup of the local Maven cache directory (