Jenkins X: Beyond the Server - Exploring Prow, Jenkins X Pipeline Operator, and Tekton

Jenkins X: Beyond the Server - Exploring Prow, Jenkins X Pipeline Operator, and Tekton

In the realm of continuous delivery, Jenkins X has emerged as a game-changer, offering a non-server approach that simplifies the complexities associated with traditional server-based systems. By abstracting the intricacies of Jenkins X, users can focus on practicing continuous delivery rather than spending months learning a complex system like Kubernetes and Jenkins X.

The Power of Prow

At the heart of Jenkins X lies Prow, a cluster entrance that receives all Git requests, including push operations and pull requests. Prow’s primary responsibility is to receive the request and decide what to do next. This may involve re-running tests, assigning tasks, or performing other Git-related operations. When Prow receives a notification of a new push, it sends a request to the Jenkins X Pipeline Operator, ensuring that the pipeline operation is executed according to the defined construct.

# Prow Flow
Prow receives a Git request (e.g., push or pull request)
Prow processes the request and decides what to do next (e.g., re-run tests or assign tasks)
Prow sends a request to the Jenkins X Pipeline Operator if a new push is detected

Jenkins X Pipeline Operator

The Jenkins X Pipeline Operator is responsible for retrieving the pipeline definition from the jenkins-x.yml file and converting it to Tekton Tasks and Pipelines. This operator simplifies the definition of the continuous delivery process, making it easier to learn and use. The Pipeline Operator defines a complete pipeline that can be executed upon a Git push, including verification steps, testing, and deployment to temporary or permanent environments.

# Jenkins X Pipeline Operator
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: pipeline-run
spec:
  pipelineRef:
    name: pipeline-name
  taskRunSpecs:
  - taskName: test-task
    runSpec:
      inputs:
        - name: input-name
          value: input-value
  - taskName: deploy-task
    runSpec:
      inputs:
        - name: input-name
          value: input-value

Tekton

Tekton is a low-level solution that defines the pipeline execution flow. However, it can be complex and painful to use directly. The Pipeline Operator simplifies this process by providing a YAML-based definition of the pipeline. Tekton creates a PipelineRun for each push, which can be executed on a relevant branch (e.g., master, PR, etc.). The pipeline execution flow includes testing, verification, and deployment to temporary or permanent environments.

# Tekton Pipeline
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipeline-name
spec:
  tasks:
  - name: test-task
    runSpec:
      inputs:
        - name: input-name
          value: input-value
  - name: deploy-task
    runSpec:
      inputs:
        - name: input-name
          value: input-value

The Beauty of Jenkins X

Jenkins X simplifies the complex process of continuous delivery by abstracting the intricacies of Jenkins X, Kubernetes, and Tekton. This allows users to focus on practicing continuous delivery rather than spending months learning a complex system. The pipeline execution flow is defined in a simple YAML format, making it easy to learn and use.