In order to make it easier to identify objects that are all part of the same conceptual pipeline, custom labels set on resources used by Tekton Pipelines are propagated from more general to more specific resources, and a few labels are automatically added to make it easier to identify relationships between those resources.
For Pipelines executed using a PipelineRun, labels are propagated
automatically from Pipelines to PipelineRuns to TaskRuns and then to
Pods. Additionally, labels from the Tasks referenced by TaskRuns are
propagated to the corresponding TaskRuns and then to Pods.
For TaskRuns executed directly, not as part of a Pipeline, labels are
propagated from the referenced Task (if one exists, see the
Specifying a Task section of the TaskRun
documentation) to the corresponding TaskRun and then to the Pod.
The following labels are added to resources automatically:
tekton.dev/pipelineis added toPipelineRuns(and propagated toTaskRunsandPods), and contains the name of thePipelinethat thePipelineRunreferences.tekton.dev/pipelineRunis added toTaskRuns(and propagated toTaskRunsandPods) that are created automatically during the execution of aPipelineRun, and contains the name of thePipelineRunthat triggered the creation of theTaskRun.tekton.dev/taskis added toTaskRuns(and propagated toPods) that reference an existingTask(see the Specifying aTasksection of theTaskRundocumentation), and contains the name of theTaskthat theTaskRunreferences.tekton.dev/taskRunis added toPods, and contains the name of theTaskRunthat created thePod.
To find all Pods created by a PipelineRun named test-pipelinerun, you could
use the following command:
kubectl get pods --all-namespaces -l tekton.dev/pipelineRun=test-pipelinerunTo find all TaskRuns that reference a Task named test-task, you could use
the following command:
kubectl get taskruns --all-namespaces -l tekton.dev/task=test-task