{"id":23755,"library":"flytekitplugins-pod","title":"Flytekit Pod Plugin","description":"Flytekit plugin enabling K8s Pod tasks in Flyte workflows. Allows users to define custom Pod specifications for running tasks on Kubernetes, providing fine-grained control over resources, sidecars, and scheduling. Current version: 1.16.19. Release cadence is tied to Flytekit releases.","status":"active","version":"1.16.19","language":"python","source_language":"en","source_url":"https://github.com/flyteorg/flytekit","tags":["flyte","kubernetes","pod","workflow","mlops"],"install":[{"cmd":"pip install flytekitplugins-pod","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Core Flyte SDK required","package":"flytekit","optional":false},{"reason":"Kubernetes Python client for Pod specs","package":"kubernetes","optional":false}],"imports":[{"note":"PodTemplate is exported directly from the top-level module","wrong":"from flytekitplugins.pod.pod_template import PodTemplate","symbol":"PodTemplate","correct":"from flytekitplugins.pod import PodTemplate"},{"note":"Deprecated import path before flytekit 1.0","wrong":"from flytekit.extras.pod import PodTemplate","symbol":"PodTemplate","correct":"from flytekitplugins.pod import PodTemplate"}],"quickstart":{"code":"from flytekit import task, workflow\nfrom flytekitplugins.pod import PodTemplate\nfrom kubernetes.client.models import V1PodSpec, V1Container, V1ResourceRequirements\n\n@task(\n    pod_template=PodTemplate(\n        primary_container_name=\"my-container\",\n        pod_spec=V1PodSpec(\n            containers=[\n                V1Container(\n                    name=\"my-container\",\n                    resources=V1ResourceRequirements(\n                        requests={\"cpu\": \"1\", \"memory\": \"2Gi\"},\n                        limits={\"cpu\": \"2\", \"memory\": \"4Gi\"}\n                    )\n                )\n            ]\n        )\n    )\n)\ndef my_pod_task() -> str:\n    return \"Hello from Pod task\"\n\n@workflow\ndef wf() -> str:\n    return my_pod_task()\n\nif __name__ == \"__main__\":\n    print(wf())","lang":"python","description":"Define a Flyte task with a custom PodTemplate that sets resource requests/limits."},"warnings":[{"fix":"Use 'from flytekitplugins.pod import PodTemplate'.","message":"The 'PodTemplate' class was moved to 'flytekitplugins.pod' in Flytekit 1.0. Importing from the old path 'flytekit.extras.pod' will raise an ImportError.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Review Kubernetes API deprecations and update PodSpec accordingly.","message":"Using 'V1PodSpec' directly is supported but some fields like 'node_selector' are deprecated in favor of 'affinity' or 'tolerations' in Kubernetes 1.24+. The plugin may still accept them but they no longer take effect.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure 'primary_container_name' matches a 'name' in the 'containers' list.","message":"The 'primary_container_name' field in PodTemplate must match a container name in the PodSpec. If they mismatch, the task execution will fail with a generic error.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install flytekitplugins-pod' and import from 'flytekitplugins.pod'.","cause":"Breaking change in Flytekit 1.0: PodTemplate moved to a separate plugin package.","error":"ImportError: cannot import name 'PodTemplate' from 'flytekit.extras.pod'"},{"fix":"Check that 'primary_container_name' matches a container name in the pod spec.","cause":"The 'primary_container_name' in PodTemplate does not match any container name in the PodSpec's containers list.","error":"FlyteExecutionError: Runtime error: Pod failed with status: Container 'my-container' not found in PodSpec."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}