Labels
In order to make it easier to identify objects that are all part of the sameconceptual pipeline, customlabelsset on resources used by Tekton Pipelines are propagated from more general tomore specific resources, and a few labels are automatically added to make iteasier to identify relationships between those resources.
Propagation Details
For Pipelines
executed using a PipelineRun
, labels are propagatedautomatically from Pipelines
to PipelineRuns
to TaskRuns
and then toPods
. Additionally, labels from the Tasks
referenced by TaskRuns
arepropagated to the corresponding TaskRuns
and then to Pods
.
For TaskRuns
executed directly, not as part of a Pipeline
, labels arepropagated from the referenced Task
(if one exists, see theSpecifying a Task
section of the TaskRun
documentation) to the corresponding TaskRun
and then to the Pod
.
For Conditions
, labels are propagated automatically to the corresponding TaskRuns
and then to Pods
.
Automatically Added Labels
The following labels are added to resources automatically:
tekton.dev/pipeline
is added toPipelineRuns
(and propagated toTaskRuns
andPods
), and contains the name of thePipeline
that thePipelineRun
references.tekton.dev/pipelineRun
is added toTaskRuns
(and propagated toTaskRuns
andPods
) that are created automatically during the execution of aPipelineRun
, and contains the name of thePipelineRun
that triggered thecreation of theTaskRun
.tekton.dev/task
is added toTaskRuns
(and propagated toPods
) thatreference an existingTask
(see theSpecifying aTask
section of theTaskRun
documentation), and contains the name of theTask
that theTaskRun
references.tekton.dev/taskRun
is added toPods
, and contains the name of theTaskRun
that created thePod
.
Examples
Finding Pods for a Specific PipelineRun
To find all Pods
created by a PipelineRun
named test-pipelinerun, you coulduse the following command:
kubectl get pods --all-namespaces -l tekton.dev/pipelineRun=test-pipelinerun
Finding TaskRuns for a Specific Task
To find all TaskRuns
that reference a Task
named test-task, you could usethe following command:
kubectl get taskruns --all-namespaces -l tekton.dev/task=test-task