A JBoss Project
Red Hat

How To:

Set up and Remotely Monitor an OpenShift Application

In some scenarios, the user may already have a remote instance of OpenShift 3 running with various applications on it and wants to monitor it. The IDE allows users to set up a connection to a remote instance of OpenShift 3 and then use logs (such as the application and build logs) to troubleshoot and monitor running applications. Use the following tasks to connect to and work with a remote OpenShift instance:

Set up OpenShift Client Binaries

Before setting up port forwarding or streaming application and build logs, it is mandatory to set up OpenShift Client Binaries as follows:

  1. In the IDE, click Windows ▸ Preferences ▸ JBoss Tools ▸ OpenShift v3.

  2. Click the here link.

  3. In the Download from GitHub section, click the Release page link.

  4. Scroll to the Downloads section and click the appropriate link to begin the client tools download for the binary for your operating system.

  5. After the download is complete, extract the contents of the file.

  6. Click Windows ▸ Preferences ▸ JBoss Tools ▸ OpenShift v3.

  7. Click Browse and select the location of the OpenShift Client executable file.

  8. Click Apply and then click OK.

Result: OpenShift Client Binaries are now set up for your IDE.

Set up Port Forwarding

Using the Application Port Forwarding window, you can connect the local ports to their remote counterparts to access data or debug the application. Port forwarding automatically stops when the OpenShift connection terminates, or when the IDE is shut down or when the workspace is changed. Port forwarding must be enabled each time to connect to OpenShift from the IDE.

Prerequisite: Ensure that the OpenShift Client Binaries are set up (see Set up OpenShift Client Binaries for instructions).

Set up port forwarding as follows:

  1. In the OpenShift Explorer view, expand the connection and then expand the project, the services, and then the Pods.

  2. Right-click the relevant pod and then click Port Forwarding.

    Set up Port Forwarding
    Figure 1. Set up Port Forwarding
  3. In the Application Port Forwarding window, click the Find free local ports for remote ports check box.

  4. Click Start All.

Result: The Status column now shows Started, indicating that port forwarding is now active. Additionally, the Console view shows the status of port forwarding for the particular service.

Start Port Forwarding
Figure 2. Start Port Forwarding

Stream Pod Logs

Pod logs are general logs for an application running on a remote OpenShift 3 instance. The streaming application logs feature in the IDE is used to monitor applications and use the previous pod log to troubleshoot if the application fails or returns errors.

Prerequisite: Ensure that the OpenShift Client Binaries are set up (see Set up OpenShift Client Binaries for instructions).

To stream the application logs:

  1. In the OpenShift Explorer view, expand the project, the services, and then the Pods.

  2. Right-click the relevant Pod and then click Pod Log.

Stream Pod Log
Figure 3. Stream Pod Log

Result: The Console view displays the Pod log.

Stream Build Logs

Build logs are logs documenting changes to applications running on a remote OpenShift 3 instance. The streaming build logs feature in the IDE is used to view the progress of the application build process and to debug the application.

Prerequisite: Ensure that the OpenShift Client Binaries are set up (see Set up OpenShift Client Binaries for instructions).

To stream build logs:

  1. In the OpenShift Explorer view, expand the project, the services, and then the build.

  2. Right-click the relevant build instance and click Build Log.

Stream Build Log
Figure 4. Stream Build Log

Result: The Console view is now the view in focus showing the build log.

back to top