Create an OpenShift 3 Application in Red Hat JBoss Developer Studio

Updated -

Red Hat JBoss Developer Studio's OpenShift 3 Tooling allows users to create, import, and modify OpenShift 3 applications as follows:

  1. Create a New OpenShift 3 Connection
  2. Create a New OpenShift 3 Project
  3. Create a New OpenShift 3 Application
  4. Import an Existing OpenShift 3 Application into Red Hat JBoss Developer Studio
  5. Deploy an Application Using the Server Adapter
  6. View an Existing Application in a Web Browser
  7. Delete an OpenShift Project

Create a New OpenShift 3 Connection

To be able to use the OpenShift 3 tooling in Red Hat JBoss Developer Studio, you must first create an OpenShift 3 connection.
To create a new OpenShift 3 connection:

  1. In the OpenShift Explorer view, click New Connection Wizard. In case the OpenShift Explorer view is not available, click Window > Show View > Other and then in the Show View window search for OpenShift Explorer and click OK after you find it.

  2. In the New OpenShift Connection wizard:

    a. In the Connection list, click New Connection.

    b. In the Server type list, click OpenShift 3.

    c. In the Server field, type the URL for an OpenShift 3 server.

    d. In the Authentication section, in the Protocol list, click OAuth to authenticate using the token or click Basic to authenticate using login credentials.

  3. Click Finish.

Set up a New OpenShift3 Connection

Result: The connection is listed in the OpenShift Explorer view.

Create a New OpenShift 3 Project

To create a new OpenShift 3 project:

  1. In the OpenShift Explorer view, right-click the connection and click New > Project.

  2. In the Create OpenShift Project window:

    a. In the Project Name field, type a name for the project. Project names must be alphanumeric and can contain the character “-” but must not begin or end with this character.

    b. In the Display Name field, type a display name for the project. This name is used as the display name for your project in the OpenShift Explorer view and on the OpenShift web console after the project is created.

    c. In the Description field, type a description of the project.

  3. Click Finish.

Result: The project is listed in the OpenShift Explorer view, under the relevant connection.

Create a New OpenShift 3 Application

Use the New OpenShift Application wizard to create OpenShift applications from default or custom templates. Using a template to create an application is useful because the same template can be used to create multiple similar applications with different or identical configurations for each of them.

Note: To learn more about using and creating templates with OpenShift 3, see Using Templates with OpenShift 3.

  1. In the OpenShift Explorer view, right-click the connection and click New > Application.

  2. If required, in the New OpenShift Application wizard, sign into your OpenShift server using the Basic protocol (username and password) or the OAuth protocol (token) and click Next.

  3. In the Select Template window, click the Server application source tab.

    Note: To create an application from the a local template, click the Local template tab and then click Browse File System or Browse Workspace to locate the template that you want to base the project on.

  4. From the list, click the template that you want to base your project on. You can also use the type filter text field to search for specific templates.

  5. Click Next.

    Select a Template for Project Creation

  6. In the Template Parameters window, confirm the parameter values and click Next.

  7. In the Resource Labels window, confirm the labels that you want to add to each resource. You can also click Add or Edit to add labels or edit the existing ones.

  8. Click Finish.

  9. In the Results of creating the resources from the [template_name] window, review the details and click OK.

  10. In the Import Application window, click Use default clone destination to clone the application at the default location or in the Git Clone Location field, type or browse for the location where you want to clone the application and click Finish.

Select a Git Clone Location

Note: If the Git location chosen to clone the application already contains a folder with the application name that you are trying to import, you must select a new location for the Git clone. In case you do not select a new location, the existing repository will be reused with the changes you made being retained but not reflected on the OpenShift console.
Git Clone Location Reuse
Result: The application appears in the Project Explorer view.

Import an Existing OpenShift 3 Application into Red Hat JBoss Developer Studio

Note: Only an application that has its source specified in the build config file can be imported in the workspace.

Applications associated with your OpenShift account(s) are listed in the OpenShift Explorer view. The source code for these applications can be individually imported into the IDE using the OpenShift tools Import OpenShift Application wizard. Once imported, the user can easily modify the application source code, as required, build the application and view it in a web browser.

To import an existing OpenShift 3 application as a new project in the existing IDE workspace:

  1. If required, sign into your OpenShift server using the Basic protocol or the OAuth protocol.

  2. In the OpenShift Explorer view, expand the connection to locate the application to import.

  3. Right-click {project name} and click Import Application.

    Note: To import a particular application from a service, right-click the service and then click Import Application. If you right-click a project and click Import Application, and if there are more than one build configs with source code under a project, you will be prompted to select the desired application for import because of existence of several applications under one project.

  4. In the Import OpenShift Application wizard, Existing Build Configs list, click the application that you want to import and click Next.

  5. Ensure the location in the Git Clone Destination field corresponds to where you want to make a local copy of the OpenShift application Git repository and click Finish.

Result: The application is listed in the Project Explorer view.

Deploy an Application Using the Server Adapter

The server adapter allows incremental deployment of applications directly into the deployed pods on OpenShift.

To deploy an application:

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

  2. Right-click the {application_name} and click Server Adapter.
    In the Server Settings window, Services section, select the service.

    Note: A workspace project will be selected automatically, if the OpenShift service has a Build Config with a git URL matching the git remote URL of one of the workspace projects.

  3. Click Finish.

Result: The Servers view is the view in focus with the server showing [Started, Publishing…] followed by the Console view showing the progress of application publishing.

Console View Showing Application Publication Progress

View an Existing Application in a Web Browser

To view an application in the internal web browser, after it has been successfully deployed, in the OpenShift Explorer view, right-click the application, and click Show In > Web browser.

Result: The application displays in the built-in web browser.

Delete an OpenShift Project

You may choose to delete a project from the workspace to make a fresh start in project development or after you have concluded development in a project. All resources associated with a project get deleted when the project is deleted.

To delete an OpenShift 3 project:

  1. In the OpenShift Explorer view, expand the connection and then the project to locate the application you want to delete.

  2. Right-click {project name} and click Delete Project.

  3. In the OpenShift resource deletion window, click OK.

    Note: To delete more than one project (and the containing applications), in the OpenShift Explorer view, click the project to select it and while holding the Control key select another project that you want to delete and then press Delete.

Did You Know

  • Scale the project deployment, using the context menu for the service (the first node below the project). You can also scale the deployment from the Properties tabs of a deployment (replication controller) and deploymentconfig.

  • View the rsync output in the Console view. You can also see the progress of the file transfer after you publish local changes to OpenShift.

Comments