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 TaskRundocumentation) to the corresponding TaskRun and then to the Pod.

For Conditions, labels are propagated automatically to the corresponding TaskRunsand then to Pods.

Automatically Added Labels

The following labels are added to resources automatically:

  • tekton.dev/pipeline is added to PipelineRuns (and propagated to TaskRunsand Pods), and contains the name of the Pipeline that the PipelineRunreferences.
  • tekton.dev/pipelineRun is added to TaskRuns (and propagated to TaskRunsand Pods) that are created automatically during the execution of aPipelineRun, and contains the name of the PipelineRun that triggered thecreation of the TaskRun.
  • tekton.dev/task is added to TaskRuns (and propagated to Pods) thatreference an existing Task (see theSpecifying a Task section of the TaskRundocumentation), and contains the name of the Task that the TaskRunreferences.
  • tekton.dev/taskRun is added to Pods, and contains the name of theTaskRun that created the Pod.

Examples

Finding Pods for a Specific PipelineRun

To find all Pods created by a PipelineRun named test-pipelinerun, you coulduse the following command:

  1. 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:

  1. kubectl get taskruns --all-namespaces -l tekton.dev/task=test-task