3.2.2.4. PipelineRun
PipelineRun 是一个 Pipeline 的运行实例。它使用集群上的特定输入、输出和执行参数来实例化 Pipeline 执行。在 PipelineRun 中为每个任务自动创建一个对应的 TaskRun。
Pipeline 中的所有任务均按定义的顺序执行,直到所有任务成功或任务失败为止。status 字段跟踪并存储 PipelineRun 中的每个 TaskRun 的进度,用于监控和审核目的。
以下示例显示了一个 PipelineRun,用于运行带有相关资源和参数的 build-and-deploy Pipeline:
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: build-deploy-api-pipelinerun
spec:
pipelineRef:
name: build-and-deploy
params:
- name: deployment-name
value: vote-api
- name: git-url
value: https://github.com/openshift-pipelines/vote-api.git
- name: IMAGE
value: image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api
workspaces:
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi