Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Installing and starting the employee rostering starter application on OpenShift


You can deploy the Red Hat Business Optimizer Employee Rostering starter application to Red Hat OpenShift Container Platform using an OpenShift template or using the provision.sh shell script that is provided in the add-ons distribution.

If you use an OpenShift template, Red Hat OpenShift Container Platform loads an image with the application from the Red Hat repository and deploys it. This method of deployment is a technological preview.

If you use the script, it builds and packages the application source code locally and uploads it to the OpenShift environment for deployment. You can use this method when Java developer tools (Java Development Kit and Maven) and a bash shell command line are available.

Important

In the deployed application, the data is held in memory and lost when the pod is restarted.

2.1. Deploying the application using the template

To deploy the application using the template, you must first ensure that the image streams for Red Hat Process Automation Manager are available and configure OpenShift registry authentication. Then you can deploy the template.

The template deploys a pod with the Employee Rostering starter application and a separate pod with a PostgreSQL database server. The application uses the database server for persistent storage of all the information that it uses.

Prerequisites

  • You must be logged in to the target OpenShift environment using the Web UI or using the oc command line tool. For more information about this tool, see CLI Reference.

To deploy the Employee Rostering starter application 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 the information about their location (known as image streams). 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.

Procedure

  1. 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.
  2. If Red Hat OpenShift Container Platform is configured with the user name and password for Red Hat registry access, run the following command:

    $ oc get imagestreamtag -n openshift | grep rhdm73-optaweb-employee-rostering
    Copy to Clipboard Toggle word wrap

    If the output of the command is not empty, the required image streams are available in the openshift namespace and no further action is required.

  3. If the output of the command is empty or if OpenShift is not configured with the user name and password for Red Hat registry access, complete the following steps:

    1. Ensure you are logged in to OpenShift with the oc command and that your project is active.
    2. Complete the steps documented in Registry Service Accounts for Shared Environments. You must log on to Red Hat Customer Portal to access the document and to complete the steps to create a registry service account.
    3. Select the OpenShift Secret tab and click the link under Download secret to download the YAML secret file.
    4. View the downloaded file and note the name that is listed in the name: entry.
    5. Run 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
      Copy to Clipboard Toggle word wrap

      Where <file_name> is the name of the downloaded file and <secret_name> is the name that is listed in the name: entry of the file.

    6. Download the rhdm-7.3.0-openshift-templates.zip file from the Software Downloads page for Red Hat Decision Manager 7.3.
    7. Extract the rhdm73-image-streams.yaml file.
    8. Complete one of the following actions:

      • Run the following command:

        $ oc create -f rhdm73-image-streams.yaml
        Copy to Clipboard Toggle word wrap
      • Using the OpenShift Web UI, select Add to Project Import YAML / JSON and then choose the file or paste its contents.

If you complete these steps, you install the image streams into the namespace of your project. If you install the image streams using these steps, you must set the IMAGE_STREAM_NAMESPACE parameter to the name of this project when deploying templates.

2.1.2. Creating the secrets for Employee Rostering

You must create an SSL certificate for HTTPS access to the Employee Rostering application and provide it to your OpenShift environment as a secret.

Procedure

  1. Generate an SSL keystore with a private and public key for SSL encryption for the Employee Rostering application. In a production environment, generate a valid signed certificate that matches the expected URL of the application. Save the keystore in a file named keystore.jks. Record the name of the certificate and the password of the keystore file.

    See Generate a SSL Encryption Key and Certificate for more information on how to create a keystore with self-signed or purchased SSL certificates.

  2. Use the oc command to generate a secret named optaweb-employee-rostering-app-secret from the new keystore file:

    $ oc create secret generic optaweb-employee-rostering-app-secret --from-file=keystore.jks
    Copy to Clipboard Toggle word wrap

2.1.3. Deploying the OpenShift template

You can deploy an OpenShift template to create an environment running the Employee Rostering starting application.

Procedure

  1. Download the rhdm-7.3.0-openshift-templates.zip file from the Software Downloads page for Red Hat Decision Manager 7.3.
  2. Unzip the downloaded archive and locate the rhdm73-optaweb-employee-rostering.yaml file.
  3. 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 rhdm73-optaweb-employee-rostering.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>/rhdm73-optaweb-employee-rostering.yaml -p OPTAWEB_HTTPS_SECRET=optaweb-employee-rostering-app-secret
      Copy to Clipboard Toggle word wrap

      In this command line:

      • Replace <template-path> with the path to the downloaded template file.
      • Add 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.
  4. Set the following parameters as necessary:

    • Optaweb Employee Rostering Keystore Secret Name (OPTAWEB_HTTPS_SECRET): The name of the secret for HTTPS connections, as created in Section 2.1.2, “Creating the secrets for Employee Rostering”.
    • Application Name (APPLICATION_NAME): The name of the OpenShift application. It is used in the default URL for the application.
    • OptaWeb Admin User (OPTAWEB_ADMIN_USER): The user name for the administrative user in the application. The default user name is adminUser.
    • OptaWeb Admin Password (OPTAWEB_ADMIN_PWD): The password for the administrative user in the application. The default password is RedHat.
    • 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.1, “Ensuring the availability of image streams and the image registry”), the namespace is openshift. If you installed the image streams file, the namespace is the name of the OpenShift project.
    • Optaweb Employee Rostering Container Memory Limit (OPTAWEB_MEMORY_LIMIT): The memory limit for the application container. The higher the limit, the more employees and shifts are supported. The default is 1 Gi.
    • Optaweb Employee Rostering Generator Zone ID (OPTAWEB_GENERATOR_ZONE_ID): The time zone that is set in the generated example data sets in the application. The default is the local time zone of the OpenShift server.
  5. 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 pop-up message is displayed, click Create Anyway.
    • Complete and run the command line.

2.2. Deploying the application using the provided script

You can deploy the Red Hat Business Optimizer Employee Rostering starter application to Red Hat OpenShift Container Platform using the provided script. The script builds and packages the application source code locally and uploads it to the OpenShift environment for deployment.

Prerequisites

  • You must be logged in to the target OpenShift environment using the oc command line tool. For more information about this tool, see CLI Reference.

    1. Java Development Kit and Maven must be installed on your local machine.
    2. A bash shell environment must be available on your local machine.

Procedure

  1. Download the rhdm-7.3.0-add-ons.zip file from the Software Downloads page for Red Hat Decision Manager 7.3.
  2. Unzip the downloaded archive.
  3. Unzip the rhdm-7.3.0-employee-rostering.zip file that is extracted from the add-ons archive.
  4. Using the command line, change to the optashift-employee-rostering-7.18.0.Final-redhat-00002/sources folder.
  5. Run the provision script to build and deploy the application:

    ./provision.sh setup employee-rostering --binary
    Copy to Clipboard Toggle word wrap
    Note

    If the current OpenShift user name contains characters that are not letters or numbers, the deployment might fail. You can resolve this issue by providing an additional parameter: ./provision.sh setup employee-rostering --binary --project-suffix optaweb. This example uses "optaweb", but you can use any value for the suffix.

    Compilation and packaging might take up to 10 minutes to complete. These processes continually show progress on the command line output.

    When the operation is completed, the following message is displayed: Uploading file "target/ROOT.war" as binary input for the build …​.

  6. Use the OpenShift web UI to view the details for the deployed application. Click the link in the Routes section to open the starter application. The first startup can take up to a minute as additional building is completed on the OpenShift platform.

    Note

    If the application does not open for more than a minute after clicking the link, perform a hard refresh of your browser page.

  7. Optionally, you can use other actions provided by the provision script:

    1. Deploy updates to the code to an existing deployment:
./provision.sh deploy employee-rostering --binary
Copy to Clipboard Toggle word wrap

+ .. Remove the application:

./provision.sh delete employee-rostering
Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat