Kovair DevOps and OpenShift Integration Plugin

OpenShift Plugin Details

Plugin Version: 1.0

Overview

OpenShift is a family of containerization software products developed by Red Hat. Its flagship product is the OpenShift Container Platform — a hybrid cloud platform as a service built around Linux containers orchestrated and managed by Kubernetes on a foundation of Red Hat Enterprise Linux. It is an open source development platform, which enables the developers to develop and deploy their applications on cloud infrastructure. It is very helpful in developing cloud-enabled services.

OpenShift is capable of managing applications written in different languages, such as Node.js, Ruby, Python, Perl, and Java. One of the key features of OpenShift is it is extensible, which helps the users support the application written in other languages. OpenShift comes with various concepts of virtualization as its abstraction layer. The underlying concept behind OpenShift is based on virtualization.

This plug-in has been designed to manage OpenShift cluster from Kovair DevOps platform.

OpenShift Information:

More information can be found at OpenShift . 

Version Supported:

This plugin was developed and tested against OpenShift Container Platform v4.10 and OpenShift CLI client (oc) v4.10.

Plugin Operation:

1. 1. CreateProject
Creates a new project in the OpenShift cluster..

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Project Name

true

Name for the project to be created. The project name must consist of lower case alphanumeric characters or ‘-‘, and must start and end with an alphanumeric character.

Other Options

false

Other optional flag(s) for creating a project.
Ex: –description=’Project description’

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

2. CreateNewApp

Creates a new application by specifying source code, templates and/or images.

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Application Name

false

Set name to use for generated application artifacts. The application name must consist of lower case alphanumeric (a-z, and 0-9) string with a maximum length of 58 characters, where the first character is a letter (a-z), and the ‘-‘ character is allowed anywhere except the first or last character.

Image Name

false

Name of a container image or an image stream to use in the app.

Source Code Path

false

Path to the source code available in the local or remote repository.

File Path

false

Path to a JSON/YAML template file to use for the app. Please ensure necessary privileges of the user account in the provided path through which the agent service is running.

Other Options

false

Other optional flag(s) for creating an application.
Ex: –labels=’app=label’,
–param=MYSQL_USER=admin

Note: The new application in the OpenShift cluster can only be created with any one of the following conditions are met:

  1. Either ‘Application Name’ and ‘Image Name’ together or ‘Image Name’ only. If ‘Other Options’ is provided, then it will be included.
  2. With the ‘Source Code Path’ only. If ‘Other Options’ is provided, then it will be included.
  3. With the template ‘File Path’ only. If ‘Other Options’ is provided, then it will be included.
  4. If valid parameters are provided only in the ‘Other Options’ field. Ex: Create an application based on a stored template: –template=ruby-helloworld-sample

* Any other combinations will be an error. * ‘Application Name’ is optional while creating the application using ‘Image Name’. * The ‘File Path’ value will not be considered if all values are provided. The application will be created based on the values of ‘Application Name’ and ‘Image Name’ including ‘Other Options’ (if present).

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

3. CreateRoute

Expose containers externally via secured routes.

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

TLS Termination

false

Select a TLS termination type. Do not select any termination type if you want to create an unsecured route.

Route Name

false

Name for the route to be created. The route name must consist of lower case alphanumeric characters, ‘-‘ or ‘.’, and must start and end with an alphanumeric character. If the route name is omitted, the service name will be used.

Service Name

true

Name of the service for which route to be created.

Other Options

false

Other optional flag(s) for creating a route.
Ex: –hostname=www.example.com

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

4. CreateDeployment

Creates a deployment with the specified name.

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Deployment Name

false

Name for the deployment to be created. The deployment name must consist of lower case alphanumeric characters, ‘-‘ or ‘.’, and must start and end with an alphanumeric character.

Image Name

false

Name of the container image to be used in the deployment.

Other Options

false

Other optional flag(s) for creating a deployment.
Ex: –replicas=3

File Path

false

Path to a JSON/YAML file based on which new deployment will be created. Please ensure necessary privileges of the user account in the provided path through which the agent service is running.

Note: The new deployment in the OpenShift cluster can only be created with any one of the following conditions are met:

  1. With ‘Deployment Name’ and ‘Image Name’ together only. If ‘Other Options’ is provided, then it will be included.
  2. With the template ‘File Path’ only.

* Any other combinations will be an error. * ‘Deployment Name’ is mandatory while creating the deployment using ‘Image Name’. * The ‘File Path’ value will not be considered if all values are provided. The deployment will be created based on the values of ‘Deployment Name’ and ‘Image Name’ including ‘Other Options’ (if present).

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

5. CreateService

Creates a service using a specified service type. Available service types are: clusterip, externalname, loadbalancer, nodeport.

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Service Type

false

Select a service type.

Service Name

false

Name for the service to be created. The service name must consist of lower case alphanumeric characters or ‘-‘, and must start and end with an alphanumeric character.

Other Options

false

Other optional flag(s) for creating a service.
Ex: –tcp=5678:8080, –clusterip=’None’,
–external-name bar.com

File Path

false

Path to a JSON/YAML file based on which new service will be created. Please ensure necessary privileges of the user account in the provided path through which the agent service is running.

Note: The new service in the OpenShift cluster can only be created with any one of the following conditions are met:

  1. With ‘Service Type’ and ‘Service Name’ including the ‘Other Options’.
  2. With the template ‘File Path’ only.

* Any other combinations will be an error. * ‘Service Name’ and ‘Other Options’ are mandatory while creating the service by selecting ‘Service Type’. * The ‘File Path’ value will not be considered if all values are provided. The service will be created based on the values of ‘Service Type’ and ‘Service Name’ including ‘Other Options’.

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

6. CreateConfigMap

Creates a config map based on a file, directory, or specified literal value.

Input parameter(s):

Parameter Is Mandatory Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

ConfigMap Name

true

Name for the configmap to be created. The configmap name must consist of lower case alphanumeric characters, ‘-‘ or ‘.’, and must start and end with an alphanumeric character.

Source

true

Select a source for creating a configmap.

Value

true

Value of the file path, directory, literal or env file path through which the configmap to be created.

Other Options

false

Other optional flag(s) for creating a configmap.
Ex: –template=’template string or file path’

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

7. CreateJob:

Creates a job with the specified name.

Input parameter(s):

Parameter

Is Mandatory

Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Job Name

false

Name for the job to be created. The job name must consist of lower case alphanumeric characters or ‘-‘, and must start and end with an alphanumeric character.

Image Name

false

Name of the container image to be used in the job.

Other Options

false

Other optional flag(s) for creating a job.
Ex: — date, –from=cronjob/name

File Path

false

Path to a JSON/YAML file based on which new job will be created. Please ensure necessary privileges of the user account in the provided path through which the agent service is running.

Note: The new job in the OpenShift cluster can only be created with any one of the following conditions are met:

  1. With ‘Job Name’ and ‘Image Name’ together only. If ‘Other Options’ is provided, then it will be included.
  2. With the template ‘File Path’ only.

* Any other combinations will be an error.
* ‘Job Name’ is mandatory while creating the job using ‘Image Name’.
* The ‘File Path’ value will not be considered if all values are provided. The job will be created based on the values of ‘Job Name’ and ‘Image Name’ including ‘Other Options’ (if present).

Output parameter(s):

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

8. ExecuteCommand

This operation executes the supplied command in the OpenShift cluster.

Parameter Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the operation.

Input parameter(s):

Parameter

Is Mandatory

Help Text

API Server URL

true

API server url of OpenShift cluster.

Authentication Type

true

Select an authentication type. Provide either API token or username with password based on the selected authentication type.

API Token

false

API token for authentication with API server.

Username

false

Username for authentication with API server.

Password

false

Password for authentication with API server.

Other Auth Options

false

Other optional flag(s) for authentication with API server.

Command

true

Command that will be executed as in the cmd/shell prompt.

Error Text

false

If the given text is found in the console log, the overall task status will be an error. To concatenate multiple error text use ‘||’ operator.

Output parameter(s):

OutputLog Help Text

OutputLog

Output log of the operation.

OpenShiftStatus

Status of the command execution.

Pass/Fail Conditions:

Method Status Condition

CreateProject

Passed

If the Output Log contains ‘Now using project <project-name>’.

CreateProject

Failed

If the Output Log contains the word ‘Error’ or ‘invalid’.

CreateNewApp

Passed

If the Output Log contains the word ‘created’ for all resources.

CreateNewApp

Failed

If the Output Log does not contain the word ‘created’ for all resources.

CreateRoute
CreateDeployment
CreateService
CreateConfigMap
CreateJob

Passed

If the Output Log contains the word ‘created’.

CreateRoute
CreateDeployment
CreateService
CreateConfigMap
CreateJob

Failed

If the Output Log does not contain the word ‘created’.

ExecuteCommand

Passed

If the Output Log contains output of the command.

ExecuteCommand

Failed

If the Output Log is not empty and contains any of the following:

h. ‘Login failed’ or ‘connection refused’

i. ‘error’ or ‘label must consist of lower case alphanumeric characters’

j. ‘Error from server’ or ‘specified subcommand’

k. ‘is not recognized as an internal or external command’

l. ‘ERROR’ or ‘Invalid’ or ‘invalid’

m. ‘FullyQualifiedErrorId’ or ‘Could not find’

n. ‘command not found’ or ‘Incorrect syntax’

o. ‘No such file or directory’ or ‘doesn’t exist’

p. ‘The system cannot find the file specified’ or ‘The system cannot find the path specified’

q. ‘already exists and is not an empty directory’ or ‘Invalid filename’

r. ‘fatal’ or ‘Access denied’

Limitations:

  1. The OpenShift CLI (oc)should be installed in the agent machine.
  2. The functionality solely depends on the OpenShift CLI, if the command behaviour changes the result may vary.

Release Details:

OpenShift: 1.0
Initial version with basic functionalities.

Contact us:

    Yes, I accept the Privacy Statement and want to receive latest information from Kovair.
    [tracking]