Introducing OpenShift Pipelines
On May 3, 2021, Red Hat released the first public version of OpenShift Pipelines, a cloud-based continuous integration system based on an open source project. Tekton… The solution implements the Kubernetes CI / CD framework for developing and executing pipelines, in which each step runs in its own container, allowing steps to scale independently of each other. Today we will take a quick look at the key features and benefits of this solution, as well as provide a list of additional resources for further acquaintance with it and mastering it.
But before moving on to OpenShift Pipelines, let’s brush up on the core Tekton concepts.
Basic concepts of Kubernetes-native CI / CD
OpenShift Pipelines augments Kubernetes / OpenShift with appropriate CRDs (User Defined Resources) for CI / CD concepts such as pipeline, task, step. As a result, these concepts become “native” instantiable – they can be created as separate instances and, as a result, fully scaled and deployed, as well as ensure their security using Kubernetes tools.
Therefore, to begin with, let’s remember what Tekton concepts are:
Basically, Tekton’s core concepts come in two flavors: those that define the pipeline and those that start the pipeline.
Concepts that define a pipeline
-
Task – reusable and loosely coupled series of steps that perform a specific task, such as building a container image.
-
Pipeline – description of the conveyor and tasks (Task)that he must perform.
Run pipelines
-
TaskRun – launch and results of execution of an instance Task.
-
Pipelinerun – launch and results of execution of an instance of the pipeline, which includes a number of concepts TaskRun…
You can read more about these concepts in official documentation…
Now let’s figure out what OpenShift Pipelines is and what it is for
What’s so special about OpenShift Pipelines?
The OpenShift Container Platform is the industry-leading enterprise-class Kubernetes platform that provides developers with many features, including CI / CD.
OpenShift Pipelines is based on the Tekton open source project and extends the functionality of the OpenShift platform using standard methods, which greatly simplifies the life of developers.
Installing OpenShift Pipelines through the Operator mechanism
OpenShift Pipelines is supported at the operator engine level, so it easy to install and update, and, accordingly, is easy to administer.
OpenShift Pipelines is available on the OperatorHub site, which has over 450 different operators for the OpenShift Container Platform:
Installing OpenShift Pipelines is extremely simple, and it is immediately installed as a cluster-level operator, automatically becoming available to all projects:
OpenShift Pipelines also complements OpenShift with corresponding CRs, which will allow for even more versatility in terms of configuration and integration with the OpenShift console, etc.
When a new version of OpenShift Pipelines appears in OperatorHub, you, as an administrator, can choose to update to the next version by specifying the desired update channel.
Developed UI within the OpenShift console
Tekton also supplements the standard OpenShift delivery with CI / CD concepts, but in it, when creating and running pipelines, it is difficult to do without creating YAML code, and this code requires writing a lot, thousands of lines. Therefore, Red Hat has implemented a full-fledged UI in the OpenShift console for launching and rendering pipelines (both those that are working now and those that have already worked), as well as for graphically creating pipelines. At the same time, all the necessary YAML files are created automatically, without writing any code.
Below is a graphical representation of the pipeline, which has already been executed on the OpenShift platform, and directly from it you can access the logs and events of all tasks of this pipeline:
If desired, you can easily view the complete log of the selected task:
To make life even easier for developers, OpenShift Pipelines lets you draw pipelines right in the OpenShift console, so you no longer need a YAML black belt to create your first Tekton pipeline:
But if you, as a YAML black belt holder, want to tweak something, you can always do it directly from the OpenShift console:
Moreover, OpenShift Pipelines will come in handy even if you decide to go down the pure YAML path, and will provide you with ready-made examples and code snippets for faster development of YAML pipelines. In addition, you can integrate your corporate snippets into the system, making them available to all developers. That’s why we added a special CRD called ConsoleYAMLSamples.
Events as Triggers for Running Pipelines
Do you want to associate the launch of pipelines with some external events (in Tekton terms, this is called Trigger), such as push or pull requests from Github or Gitlab? Not a problem at all, OpenShift Pipelines has it out of the box and supports various vendors including Github, Gitlab, BitBucket, etc.
You just create the desired trigger in the UI, and OpenShift itself generates all the necessary concepts, such as EventListeners, TriggerTemplates (you can read more about them in official documentation).
Ready-to-use reusable tasks and customization
OpenShift Pipelines out of the box contains dozens of ready-made tasks that can be used as part of pipelines, including tasks for cloning code from a repository, building applications in various programming languages such as java, dotnet core, python go, nodejs, or using build tools like maven, deployment applications, etc. The list of available tasks can be seen in the OpenShift console, ClusterTasks section, Pipelines -> Tasks menu:
In addition, this list can be easily expanded. To do this, just add “ClusterTasks” to the cluster, after which hundreds of additional tasks on the site will become available to you TektonHubwhich is a public repository for sharing Tekton tasks:
Integration with IDE
Developers using the command line and IDE can take advantage of the Tekton CLI, the Tekton extension for Visual Studio Code, and the Tekton plugin for IntelliJ to interact with pipelines right from their normal development environment and create, run, view and perform actions on the cluster directly from the command strings.
Useful Resources
In conclusion, we advise you to watch the video version of this article in English:
We also recommend the following resources (EN):
-
Red Hat blog post for the first public release of OpenShift Pipelines and OpenShift GitOps
-
Demo video from Siamak Sadeghianfar, Product Manager for OpenShift Pipelines
-
Series of articles Guide to OpenShift Pipelines in the Red Hat OpenShift blog
Videos in Russian:
Webinars:
-
June 1st. Red Hat Advanced Cluster Security – Robust Cloud Application Protection
At the webinar, we will consider the tools Red Hat Advanced Cluster Securityrequired to secure cloud applications. Experts from Red Hat and BCC will discuss how Advanced Cluster Security protects critical applications throughout the build, deployment, and runtime process. Eliminates security blind spots and reduces the time and effort required to maximize security, and simplifies security analysis, investigation, and remediation -
June 17. Installation and operations of the second day
We will tell you about how to install OpenShift using Helper Node and a little more about Day-2, as well as hold a master class in which we will explain what is worth doing after OpenShift has entered your life.