This message was deleted.
# ask-ai
e
This message was deleted.
a
Yes, starting with Flytekit 1.15, the .with_overrides(pod_template=...) feature is officially supported, allowing you to override the pod_template (including pod volumes) at runtime for a task invocation, similar to how you override resources. This means you can dynamically specify a different pod template—including custom volumes—when calling a task in a workflow, rather than only at task definition time. The pod_template must be a valid PodTemplate object, and the override will apply to the task execution if the backend and FlytePropeller are up to date and properly configured. For example:
Copy code
from kubernetes.client import V1PodSpec, V1Container, V1Volume, V1EmptyDirVolumeSource
from flytekit import task, workflow, PodTemplate

custom_pod_template = PodTemplate(
    primary_container_name="primary",
    pod_spec=V1PodSpec(
        containers=[V1Container(name="primary")],
        volumes=[V1Volume(name="my-volume", empty_dir=V1EmptyDirVolumeSource())]
    )
)

@task
def my_task() -> str:
    return "Hello!"

@workflow
def my_wf():
    return my_task().with_overrides(pod_template=custom_pod_template)
See Flyte 1.15.0 release notes, pod template docs, and example issue for details. Would you like a step-by-step example or troubleshooting tips for your specific use case? Sources: - Flyte 1.15.0 release notes - Flyte issue: .with_overrides(pod_template) support - pod template docs 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.