Labels
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.
Propagation Details
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.
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/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/clusterTaskis added toTaskRuns(and propagated toPods) that reference an existingClusterTaskand contains the name of theClusterTaskthat theTaskRunreferences. For backwards compatibility,TaskRunsthat reference aClusterTaskwill also receivetekton.dev/task.tekton.dev/taskRunis added toPods, and contains the name of theTaskRunthat created thePod.app.kubernetes.io/instanceandapp.kubernetes.io/componentis added to Affinity AssistantStatefulSetsandPods. These are used for Pod Affinity for TaskRuns.
Examples
Finding Pods for a Specific PipelineRun
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-pipelinerun
Finding TaskRuns for a Specific Task
To 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
Finding TaskRuns for a Specific ClusterTask
To find all TaskRuns that reference a ClusterTask named test-clustertask, you could use
the following command:
kubectl get taskruns --all-namespaces -l tekton.dev/clusterTask=test-clustertask
Feedback
Was this page helpful?
Thanks! Tell us how we can further improve.
Sorry about that. Tell us how we can further improve.