PodTemplates

A pod template specifies a subset ofPodSpecconfiguration that will be used as the basis for the Task pod.

This allows to customize some Pod specific field per Task execution, aka TaskRun.

Alternatively, you can also define a default pod template in tekton config, see hereWhen a pod template is specified for a PipelineRun or TaskRun, the default pod template is ignored, i.e.both templates are NOT merged, it’s always one or the other.


The current fields supported are:

  • nodeSelector: a selector which must be true for the pod to fit ona node, see here.
  • tolerations: allow (but do not require) the pods to schedule ontonodes with matching taints.
  • affinity: allow to constrain which nodes your pod is eligible tobe scheduled on, based on labels on the node.
  • securityContext: pod-level security attributes and commoncontainer settings, like runAsUser or selinux.
  • volumes: list of volumes that can be mounted by containersbelonging to the pod. This lets the user of a Task define which typeof volume to use for a Task volumeMount
  • runtimeClassName: the name of aruntime classto use to run the pod.
  • automountServiceAccountToken: whether the token for the service accountbeing used by the pod should be automatically provided inside containers at apredefined path. Defaults to true.
  • dnsPolicy: theDNS policyfor the pod, one of ClusterFirst, Default, or None. Defaults toClusterFirst. Note that ClusterFirstWithHostNet is not supported by Tektonas Tekton pods cannot run with host networking.
  • dnsConfig:additional DNS configurationfor the pod, such as nameservers and search domains.
  • enableServiceLinks: whether services in the same namespace as the pod willbe exposed as environment variables to the pod, similar to Docker servicelinks. Defaults to true.
  • priorityClassName: the name of thepriority classto use when running the pod. Use this, for example, to selectively enablepreemption on lower priority workloads.
  • schedulerName the name of theschedulerto use when dispatching the Pod. This can be used when workloads of specific types need specific schedulers,e.g.: If you are using volcano.sh for Machine Learning Workloads, you can pass the schedulerName and have Tasks bedispatched by the volcano.sh scheduler.

A pod template can be specified for TaskRun or PipelineRun resources.See here or here for examples using pod templates.