Red Hat OpenShift Pipelines and Red Hat OpenShift GitOps provide key components of a combined DevOps solution in the Red Hat OpenShift platform. OpenShift Pipelines is responsible for providing the continuous integration (CI) portion of the DevOps methodology, while OpenShift GitOps covers the continuous delivery (CD) aspect. Each component can be used independently or can work together as a unit to provide a complete DevOps solution, as you'll see in this article.
Continuous integration with OpenShift Pipelines
OpenShift Pipelines is based on Tekton, a popular upstream solution that enables DevOps practitioners to construct complex workflows to build applications and images.
These pipelines are assembled using a discrete set of tasks that are combined in a directed graph as a pipeline representing the end-to-end flow for the workstream (see Figure 1). Each task represents a unit of work (clone repo, build image, etc) and can be composed of one or more steps.
Unlike some other CI solutions, such as legacy tool Jenkins, Pipelines is built on native Kubernetes technologies and thus is resource efficient since pipelines and tasks are only actively running when needed. Once the pipeline has completed no resources are consumed by the pipeline itself.
Pipelines and tasks are constructed using a declarative approach following standard Kubernetes practices. However, OpenShift Pipelines includes a user-friendly interface built into the OpenShift console that enables users to easily monitor the execution of the pipelines and view task logs as needed. The user interface also shows metrics for individual task execution, enabling users to better optimize pipeline performance.
In addition, the user interface enables users to quickly create and modify pipelines visually. While users are encouraged to store tasks and Pipeline resources in Git, the ability to visually create and modify pipelines greatly reduces the learning curve and makes the technology approachable for new users.
You can leverage pipelines-as-code to provide an experience that is tightly integrated with your backend Git provider, such as GitHub or GitLab. This enables users to see the execution results of the pipeline directly integrated with the specific git commit that triggered it.
Continuous delivery with OpenShift GitOps
Red Hat OpenShift GitOps is based on the popular GitOps project Argo CD in the CNCF portfolio. GitOps has quickly become the preferred way for DevOps practitioners to deploy and manage Kubernetes resources.
As the name suggests, it enables the synchronization of Kubernetes resources with back-end repositories, typically Git-based repositories. This provides a number of benefits such as increased consistency of deployments, improved change control, and audit trails as Git becomes the source of truth.
OpenShift GitOps provides an operator-driven experience that facilitates the full lifecycle of Argo CD, including provisioning, updating, and management. This experience is integrated into the overall OpenShift experience with additional monitoring and dashboards provided by the operator.
With OpenShift GitOps, Argo CD acts as a two-way reconciliation engine ensuring that the state of the resources on the cluster is aligned with the desired state stored in Git, the source of truth. Should a change in Git occur, Argo CD can automatically synchronize the change with the state of the resource on the cluster. Similarly, should the state of a resource change on the cluster, Argo CD can automatically revert the resource back to the source of truth expressed in Git.
This two-way reconciliation is a powerful capability and a significant advantage of a GitOps engine over traditional one-way automation tools that typically only execute when a change occurs in the source system but is not aware of changes at the destination. This capability provides increased consistency of resources and deployments across multiple clusters.
Video demo: CI/CD with OpenShift GitOps and OpenShift Pipelines
The following video provides a demonstration of both of these tools with additional examples and details.
Conclusion
OpenShift Pipelines and OpenShift GitOps are powerful tools included in Red Hat OpenShift that can be used by DevOps practitioners to provide continuous integration (CI) and continuous delivery/deployment (CD) capabilities.