Skip to main content

Pipelines Management

This page contains a list of frequently asked questions related to the CI/CD Pipelines management in the KubeRocketCI.

What Is a Pipeline in KubeRocketCI?​

A pipeline in KubeRocketCI is a sequence of tasks that define the steps required to build, test, and deploy an application. Pipelines are defined using the Tekton Pipelines framework, which allows users to create custom pipelines using reusable tasks.

Within the KubeRocketCI platform, there are three primary types of pipelines, each serving distinct purposes within the Continuous Integration/Continuous Deployment lifecycle:

  1. Review Pipeline:

    • The Review Pipeline is designed to automate the integration of code changes from multiple contributors into a single software project (codebase). It typically includes steps for compiling the code, running tests (unit tests, integration tests, etc.).
    • The primary goal is to detect integration errors as quickly as possible, which is achieved by triggering the pipeline on each code commit to a repository.
  2. Build Pipeline:

    • The Build Pipeline takes center stage following the completion of the code review process. Its primary function is to automate the compilation, testing, and packaging of the code into a build artifact. This artifact can then be deployed to various environments for further testing and promotion to production.
  3. Deploy Pipeline:

    • Focused on the deployment aspect, the Deploy Pipeline automates the process of deploying software to environments. This type of pipeline can be triggered manually or automatically, based on the project's deployment strategy.
    • It often includes steps for provisioning infrastructure, deploying the application, and post-deployment tests to ensure the application runs correctly in the production environment.

Does KubeRocketCI Integrate with GitHub Actions, GitLab CI, or Azure Pipelines for CI/CD?​

KubeRocketCI is built upon Tekton and Argo CD for its CI/CD processes, emphasizing a Kubernetes-native strategy.

It does not integrate with GitHub Actions, GitLab CI, Azure Pipelines, or similar CI/CD tools.

This design choice ensures that KubeRocketCI remains vendor-neutral and cloud-agnostic, allowing it to operate effectively across any Kubernetes environment without reliance on specific CI services or cloud platforms.


How to Re-trigger a Pipeline in KubeRocketCI?​

If you need to re-trigger a pipeline due to a failed run or to incorporate new changes, you have several options available:

  • KubeRocketCI Portal: Navigate to CI/CD Pipelines -> PipelineRuns, or open a project from Projects and go to its Branches tab. Identify the failed run, open its Actions menu, and select Run again. The portal creates a new PipelineRun with the parameters of the selected one, and the original run stays unchanged. To change the parameters before the start, select Run with params: the portal opens the new PipelineRun in the YAML editor, and the run starts after you save it.

  • Tekton Dashboard: If Tekton Dashboard is integrated. In the KubeRocketCI Portal navigate Configuration -> Quick Access -> Links and click on Tekton. In the Tekton Dashboard navigate to the PipelineRuns section, identify the failed pipeline, and select the action Rerun.

  • Through VCS (GitHub/GitLab): Add a comment that begins with /recheck or /ok-to-test to your Pull Request (PR) or Merge Request (MR), and the pipeline will be triggered automatically.

tip

Use comment approach with /recheck or /ok-to-test if the Pipeline is not available either on KubeRocketCI or Tekton Dashboard. The command must be at the beginning of your comment to be recognized.


What Are the Available Options for Triggering Pipelines in KubeRocketCI?​

Different pipelines within the KubeRocketCI platform are triggered by specific events, ensuring that the appropriate actions are taken in response to changes in the codebase or the project environment.

The three primary types of pipelines in KubeRocketCI are triggered by the following events:

  • Review Pipeline:

    • Triggered by events related to pull requests and issue comments.

    • Configuration example from TektonTriggers:

      GitHub Trigger Configuration
      apiVersion: triggers.tekton.dev/v1beta1
      kind: Trigger
      metadata:
      name: github-review
      spec:
      interceptors:
      - ref:
      name: "github"
      params:
      - name: "eventTypes"
      value: ["pull_request", "issue_comment"]
      - ref:
      name: "cel"
      params:
      - name: "filter"
      value: "body.action in ['opened', 'synchronize', 'created']"
      bindings:
      - ref: github-binding-review
      template:
      ref: github-review-template
  • Build Pipeline:

    • Triggered when a pull request is closed and merged.

    • Configuration example from TektonTriggers:

      GitHub Trigger Configuration
      apiVersion: triggers.tekton.dev/v1beta1
      kind: Trigger
      metadata:
      name: github-build
      spec:
      interceptors:
      - ref:
      name: "github"
      params:
      - name: "eventTypes"
      value: ["pull_request"]
      - ref:
      name: "cel"
      params:
      - name: "filter"
      value: "body.action in ['closed'] && body.pull_request.merged == true"
      bindings:
      - ref: github-binding-build
      template:
      ref: github-build-template
  • Deploy Pipeline (in case of auto deploy):

    • Triggered when a new tag is added to a codebaseimagestream, upon successful completion of the build pipeline.
    • This pipeline is designed to automatically deploy the newly built images to the appropriate environments.

For further details on configuring these triggers review the TektonTriggers configuration available in the Tekton repository.


How to Manage Trigger Owner Verification in Tekton?​

Tekton provides a feature to control which commits can trigger Tekton pipelines, enhancing security by preventing the execution of potentially harmful scripts from unauthorized contributors. This is achieved through the use of Tekton Interceptors, which verify whether the individual initiating a pull request is an owner of the repository (i.e., has write access) before permitting pipeline execution. For more details consult official GitHub documentation.

This functionality is enabled by default. To disable it, you need to update the relevant flag in the values.yaml file during the installation of Tekton.

values.yaml
githubOwners:
enabled: false

Why Does My Pipeline Fail with "cannot use result expressions ... as PipelineRun parameter values"?​

The EventListener could not create the PipelineRun at all, and the pull/merge request shows no pipeline. The EventListener log contains:

admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed:
invalid value: cannot use result expressions in [tasks.<task>.results.<result>] as PipelineRun
parameter values: spec.params[COMMIT_MESSAGE].value

The review and build trigger templates inject the commit message into the PipelineRun as the COMMIT_MESSAGE parameter, and Tekton's admission webhook rejects any PipelineRun parameter whose value contains a result-expression string. So a commit message (or merge request title) that quotes Tekton syntax literally — for example $(tasks.fetch-repository.results.commit) — blocks pipeline creation for that change. This most often happens when committing changes to Tekton pipelines themselves.

To resolve it, amend the commit message to avoid the literal $( ) wrapper (for example, write tasks.fetch-repository.results.commit instead) and re-push. The pipeline definitions themselves are unaffected.


What Does the Stop Run Action Do?​

The Stop run action is in the Actions menu of a running PipelineRun, on the PipelineRuns page and on the page of the run. It asks Tekton to cancel the run: the running tasks are stopped, and the finally tasks still run, so the commit status in the Git provider is reported as usual. The portal shows the run as Cancelling and then as Cancelled when Tekton finishes.

The action is not available for a run that is already finished or already stopping, and for a run that is archived in Tekton Results. If you have no permission to patch PipelineRuns in the namespace, the action is disabled, and its tooltip shows the reason.


Why Does the Pull Requests Tab Say That Pull Requests Are Not Supported for Gerrit?​

The Pull Requests tab of a project reads the open pull requests through the Git provider API of GitHub, GitLab, or Bitbucket. Gerrit has no pull requests: it uses changes for code review. For a project hosted in Gerrit, the tab shows Pull Requests are not supported for Gerrit projects. Open the changes in the Gerrit web interface. The review pipelines still start for each change, and you find them on the PipelineRuns page.