Skip to main content
Version: Release 23.1

OpenShift Plugin

The Release OpenShift plugin allows you to work with resources on an OpenShift host from the Release UI.

The following task types are included:

  • OpenShift CLI: Create resource
  • OpenShift CLI: Remove resource
  • OpenShift CLI: Start Build
  • OpenShift API: Start Build
  • OpenShift CLI: Image Tag
  • OpenShift API: Image Tag
  • OpenShift CLI: Start Deployment
  • OpenShift API: Start Deployment
  • OpenShift CLI: Check Service
  • OpenShift API: Service Status

In the release flow editor, the Openshift tasks have a blue border.

Features

  • Create a new OpenShift resource
  • Remove an OpenShift resource
  • Start an OpenShift build
  • Tag an OpenShift image stream
  • Start an OpenShift deployment
  • Check for an OpenShift service accessibility

Requirements

The OpenShift plugin requires the following:

  1. The Release Remoting plugin to be installed.
  2. OpenShift command line client: oc to be installed on a Unix host machine.
  3. A valid OpenShift account and a user with admin rights associated to it.

Set up an OpenShift client

Set up a connection to a Unix server with the installed OpenShift client:

  1. In Release, from the navigation pane, go to Configuration > Connections and click Add Unix Host.

  2. In the Address field, enter the IP address or host name of the remote machine with the installed OpenShift client.

  3. In the Port field, enter the SSH port of the remote machine.

  4. In the Username and Password fields, specify the user name and password of the SSH user that Release uses when connecting to the remote machine.

  5. In the Sudo Username field, enter the user name of the sudo user on the remote machine (for example: root).

    Create Unix host

Set up an OpenShift client (OC):

  1. In Release, from the navigation pane, go to Configuration > Connections and click Add Openshift Client (OC) Configuration.

  2. In the Client Host field, select Unix host you created.

  3. In the OC Path field, enter the path for OC.

  4. In the Openshift Server field, enter URL to connect with the OpenShift Server.

  5. In the Username field, enter username to connect with the OpenShift Server.

  6. In the Password field, enter password to connect with the OpenShift Server.

    Create OC Client

Set up an OpenShift client (API):

  1. In Release, from the navigation pane, go to Configuration > Connections and click Add Openshift Client (API) Configuration.

  2. In the Openshift Server field, enter URL to connect with the OpenShift Server.

  3. Select Skip SSL Verification checkbox.

  4. In the CA Certificate field, enter the certificate located in .minishift directory.

  5. In the TLS certificate field, enter the certificate located in .minishift directory.

  6. In the TLS private key field, enter the private key located in .minishift directory.

  7. In the Token field, enter the OC token located in the OC Admin page under Help -> Command Line Tools.

    Create OC Client

Create resource task type - OpenShift Client

The OpenShift CLI: Create Resource task type creates a resource in the default project in OpenShift. This requires you to specify a configuration in JSON format. You can specify the configuration:

  • By providing a JSON in the task
  • By providing a URL to a JSON file

You can enter the JSON configuration as plain text in the Configuration file field:

OpenShift Create Resource task with configuration file

You can also provide a URL for the configuration file in the Url field. If the URL is secure, you must provide credentials in the Username and Password fields.

OpenShift Create Resource task with URL to configuration file

  • If the output of this command is needed in JSON format, add -o json to the cmdParams.

  • In the Pattern field, you can specify a regular expression to match the output of the specified OC command. When the output matches the regular expression, the task will succeed and the release moves to the next task.

OpenShift Wait for Resource task

Remove resource task type - OpenShift Client

The OpenShift CLI: Remove Resource task type destroys a resource in the default project in OpenShift. This requires you to specify a configuration in JSON format. As in the Create Resource task type, you can enter the JSON in the task or provide a URL to a configuration file.

Start build task type - OpenShift Client

The OpenShift CLI: Start Build task type starts a build in default project in OpenShift. You must specify the build config name that already exists on OpenShift.

OpenShift Start Build

Start build task type - OpenShift API

The OpenShift API: Start Build task type starts a build in specified project in OpenShift. You must specify the project name and build config name that already exists on OpenShift.

OpenShift Start Build

Image tag task type - OpenShift Client

The OpenShift CLI: Image Tag task type tags an image stream in OpenShift. You must specify the source image and target image name that already exists on OpenShift. This also provides an optional source and a target project. If not specified, it uses the default project in OpenShift.

OpenShift Image Tag

Image tag task type - OpenShift API

The OpenShift API: Image Tag task type tags an image stream in OpenShift. The difference from OC - Client is that if the image tag is not specified from Openshift when the project is built, the OC API will show it as an error. To fix this, the first image tag needs to either be specified in the YAML file or use the OC Client to create it first.

OpenShift Image Tag

Start deployment task type - OpenShift Client

The OpenShift CLI: Start Deployment task type starts a deployment in the default project in OpenShift. You must specify the deployment config name that already exists on OpenShift.

OpenShift Start Deployment

Start deployment task type - OpenShift API

The OpenShift API: Start Deployment task type starts a deployment in the specified project in OpenShift. You must specify the project name and deployment config name that already exists on OpenShift.

OpenShift Start Deployment

Check service task type - OpenShift client

The OpenShift CLI: Check Service task type checks accessibility of a service in the default project in OpenShift. You must specify the service name that already exists on OpenShift.

OpenShift Check Service

Check service task type - OpenShift API

The OpenShift API: Service Status task is fairly similar to the OC client version. You must specify the project name and service name that already exists on OpenShift. Keep in mind that a health check port (type: NodePort,LoadBalancer) must be available from Openshift service.

OpenShift Check Service