Skip to content

Pipelines

The table below describes the list of actions that can be performed on "pipelines" using the RCTL CLI Utility.

Resource Create Get Update Delete
pipeline YES YES YES YES

Create Pipeline

A declarative approach to lifecycle management of pipelines is strongly recommended backed by the pipeline manifests (YAML files) that are version controlled in your Git repository.


Declarative

You can create/update a pipeline in the project in your Organization based on a version controlled pipeline spec that you can store in a Git repository. This enables users to develop automation for reproducible infrastructure.

./rctl create pipeline -f <pipeline-file.yaml> --v3

(or)

./rctl apply -f pipeline-spec.yml

An illustrative example of the pipeline spec YAML file is shown below.

apiVersion: gitops.k8smgmt.io/v3
kind: Pipeline
metadata:
  name: test-pipe
  project: prod-test
spec:
  active: true
  stages:
  - config:
      destinationRepo: {}
      gitToSystemSync: true
      includedResources:
      - name: '*'
      sourceAsDestination: true
      sourceRepo:
        path:
          name: prod-sanity-check-shared-repo
        repository: test-project
        revision: main
      systemToGitSync: true
    name: system-sync-stage
    type: SystemSync
  triggers:
  - config:
      repo:
        paths:
        - name: prod-sanity-check
        provider: Github
        repository: test-repo
        revision: main
    name: prod-sanity
    type: Webhook

List Pipelines

Use this command to retrieve the list of pipelines in the configured Project. An illustrative example is shown below where RCTL retrieves the list of pipelines in the project "qa".

./rctl get pipeline -p qa
+---------------+-----------+-------------------------------------------+--------------------------------+------------------------------+
| PIPELINE NAME | STATUS    | STAGES                                    | EDGES(SOURCE-TARGET)           | CREATE AT                    |
+---------------+-----------+-------------------------------------------+--------------------------------+------------------------------+
| nginx         | Activated | deploy_nginx_workload:DeployWorkloadStage |                                | Sun Dec 20 23:09:00 UTC 2020 |
+---------------+-----------+-------------------------------------------+--------------------------------+------------------------------+
| multitenant   | Activated | approval:ApprovalStage,                   | approval-tenant-a,             | Mon Dec 21 19:43:40 UTC 2020 |
|               |           | tenant-a:DeployWorkloadStage,             | tenant-a-tenant-b,             |                              |
|               |           | tenant-b:DeployWorkloadStage,             | tenant-b-tenant-c              |                              |
|               |           | tenant-c:DeployWorkloadStage              |                                |                              |
+---------------+-----------+-------------------------------------------+--------------------------------+------------------------------+

Get The Specific Pipeline Info

Use this command to retrieve a specific pipeline's details in the configured project.

./rctl get pipeline <pipeline-name> -p <project-name>

Below is the illustrative example for the pipeline called "nginx"

./rctl get pipeline nginx
+---------------+-----------+-------------------------------------------+----------------------+------------------------------+
| PIPELINE NAME | STATUS    | STAGES                                    | EDGES(SOURCE-TARGET) | CREATE AT                    |
+---------------+-----------+-------------------------------------------+----------------------+------------------------------+
| nginx         | Activated | deploy_nginx_workload:DeployWorkloadStage |                      | Sun Dec 20 23:09:00 UTC 2020 |
+---------------+-----------+-------------------------------------------+----------------------+------------------------------+

Or you can use below command to get more information of the addon in json or yaml format

./rctl get pipeline <pipeline-name> -o json
./rctl get pipeline <pipeline-name> -o yaml


Delete Pipeline

You can delete a pipeline in the configured project.

./rctl delete pipeline -f <filename> --v3

Activate/Deactivate Pipeline

To activate/deactivate the pipeline using the config file, update the below parameters with true/false and run the apply command

spec:
  active: true/false

Also, you can use the below command to activate/deactivate the pipeline without updating the spec config

./rctl activate pipeline <name> --v3

and

./rctl deactivate pipeline <name> --v3

Applying these two commands will automatically update the spec file parameter active: true/false


Start Pipeline

To start the pipeline, use the below command

./rctl start pipeline <pipeline_name>

Stop Pipeline

To stop the pipeline, use the below command

./rctl stop pipeline <pipeline_name>

Important

Refer here for the deprecated RCTL Commands