이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 8. Running a SpringBoot business application on Red Hat OpenShift Container Platform


To run your Red Hat Process Automation Manager SpringBoot business application on Red Hat OpenShift Container Platform, create an immutable image and push this image to your Red Hat OpenShift Container Platform environment.

Optionally, you can also use Business Central Monitoring to monitor the execution of business processes in your application.

Prerequisites

Procedure

  1. Outside the business application project directories, create an ocp-image directory with the following subdirectories:

    ocp-image
    |--/root
      |--/opt
        |-- /spring-service
    Copy to Clipboard Toggle word wrap
  2. Copy the single JAR file for your business application into the root/opt/spring-service subdirectory. For example:

    cd ../business-application-service
    cp target/business-application-service-1.0-SNAPSHOT.jar ../ocp-image/root/opt/spring-service/
    Copy to Clipboard Toggle word wrap
  3. In the ocp-image directory, create a Dockerfile file with the following content:

    FROM registry.access.redhat.com/ubi8/openjdk-11:latest
    COPY root /
    EXPOSE 8090
    WORKDIR /opt/spring-service/
    CMD ["sh","-c", "java ${JAVA_OPTIONS} -Dorg.kie.server.mode=PRODUCTION -jar /opt/spring-service/<FILENAME>.jar"]
    Copy to Clipboard Toggle word wrap

    Replace <FILENAME>.jar with the name of the single JAR file for your business application.

    Alternatively, if you want to configure communication with Business Central Monitoring, use the following content for Dockerfile:

    FROM registry.access.redhat.com/ubi8/openjdk-11:latest
    COPY root /
    EXPOSE 8090
    WORKDIR /opt/spring-service/
    CMD ["sh","-c", "java ${JAVA_OPTIONS} -Dorg.kie.server.location=${KIESERVER_LOCATION} -Dorg.kie.server.controller=${KIESERVER_CONTROLLERS} -Dorg.kie.server.controller.user=${KIE_SERVER_CONTROLLER_USER} -Dorg.kie.server.controller.pwd=${KIE_SERVER_CONTROLLER_PWD} -Dorg.kie.server.mode=PRODUCTION -jar /opt/spring-service/<FILENAME>.jar"]
    Copy to Clipboard Toggle word wrap

    Replace <FILENAME>.jar with the name of the single JAR file for your business application.

  4. To build the initial image and deploy it in your Red Hat OpenShift Container Platform environment, complete the following steps:

    1. To build the image, run the following commands in the ocp-image directory:

      oc new-build --binary --strategy=docker --name openshift-kie-springboot
      oc start-build openshift-kie-springboot --from-dir=. --follow
      Copy to Clipboard Toggle word wrap

      Optional: replace openshift-kie-springboot with a custom application name in these commands and all subsequent commands.

    2. To deploy the image in the Red Hat OpenShift Container Platform environment, run the following command:

      oc new-app openshift-kie-springboot
      Copy to Clipboard Toggle word wrap

      Alternatively, to deploy the image and configure it to communicate with Business Central Monitoring, run the following command:

      oc new-app openshift-kie-springboot -e KIESERVER_LOCATION=http://<LOCATION>:<PORT>/rest/server -e KIESERVER_CONTROLLERS=ws://<BC-HOSTNAME>:<BC-PORT>/websocket/controller -e KIE_SERVER_CONTROLLER_USER=USER -e KIE_SERVER_CONTROLLER_PWD=PASSWORD
      Copy to Clipboard Toggle word wrap

      In this command, replace the following values:

      • <LOCATION> with the fully qualified host name for accessing your service. Business Central Monitoring accesses the service to retrieve process information and displays a URL for the service with this host name
      • <PORT> with the port for accessing your service, for example, 8090
      • <BC-HOSTNAME> with the host name for accessing the Business Central Monitoring instance. If your application is deployed in the same project/namespace as the Business Central Monitoring instance, use the service name for Business Central Monitoring, for example, myapp-rhpamcentrmon. Otherwise, you can use use the fully qualified host name of a route for the Business Central Monitoring instance.
      • <BC-PORT> with the port of the Business Central Monitoring instance, for example, 8080
      • <USER> with the username of a user configured on the Business Central Monitoring instance
      • <PASSWORD> with the password of the user configured on the Business Central Monitoring instance

        Note

        This configuration uses unsecured HTTP communication for your service. If you configure your Spring Boot business application with a valid SSL certificate, you can replace http: with https: to use secure HTTPS communication. For more information about configuring SSL on Spring Boot, see Spring Boot documentation.

        Note

        If you want to view process information from Business Central Monitoring, you must ensure that the user that is logged into Business Central Monitoring can also be authenticated with your service using the same password.

    3. Optional: To expose the route for the image, run the following command:

      oc expose service/openshift-kie-springboot --port=8090
      Copy to Clipboard Toggle word wrap
  5. If you already built and deployed the image and need to update it, for example if you built the JAR file for a new version of Red Hat Process Automation Manager or of Spring Boot, run the following command in the ocp-image directory:

    oc start-build openshift-kie-springboot --from-dir=. --follow
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동