microscopic-needle-82602
01/06/2025, 11:13 AMjolly-florist-66728
01/06/2025, 11:13 AMPodTemplate
in your task definition. This allows you to specify tolerations directly in the pod specification. Here's an example:
from flytekit import task, PodTemplate
from kubernetes.client import V1Container, V1PodSpec, V1Toleration
@task(
pod_template=PodTemplate(
primary_container_name="primary",
pod_spec=V1PodSpec(
containers=[
V1Container(
name="primary",
image="your-image",
),
],
tolerations=[
V1Toleration(
key="your-key",
operator="Equal",
value="your-value",
effect="NoSchedule",
),
],
),
),
)
def your_task() -> None:
# Task implementation
pass
This example sets a toleration for the pod to be scheduled on nodes with a specific taint. Would you like more details on this configuration?
Sources:
- Implement Spark pod template overrides
- BUG: Spark Task tolerations not applied with PodTemplate 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.