flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[BUG] Construct k8s pod in connector/agent plugin

Open madiyar-wayve opened this issue 7 months ago • 3 comments

Flyte & Flytekit version

Flyte v1.16.5 Flytekit v1.16.17

Describe the bug

Flyte connector plugin doesn't build k8s pod spec and doesn't render arguments, when task template passed has k8s pod type instead of container.

For tasks with container type connector plugin renders the arguments properly at the moment: https://github.com/flyteorg/flyte/blob/v1.16.5/flyteplugins/go/tasks/plugins/webapi/connector/plugin.go#L111-L128

Expected behavior

Flyte connector plugin should construct k8s pod spec and render command arguments.

Additional context to reproduce

Can reproduce when creating task with connector task_config and pod_template set:

@task(
   task_config=SomeConnectorConfig(...),
   pod_template=PodTemplate(...),
)

Flyte connector (built on AsyncConnectorBase class) will receive pod_template (unmerged with default-pod-template) with no arguments rendered.

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • [x] Yes

Have you read the Code of Conduct?

  • [x] Yes

madiyar-wayve avatar Apr 16 '26 20:04 madiyar-wayve

It seems likely that the Flyte connector plugin currently does not construct a Kubernetes pod spec or render command arguments when the task template is of type k8s pod, as opposed to container. The code at plugin.go#L111-L128 shows argument rendering for container tasks, but there is no equivalent logic for k8s pod tasks. This gap means that when using a connector with a pod_template, the pod spec may not be built or merged with defaults, and arguments are not rendered as expected.

My understanding is that this is a limitation in the current implementation of the connector plugin, and your expectation for the plugin to construct the pod spec and render arguments for k8s pod tasks is not met. The data sources do not mention a workaround or fix for this issue in the current version. Would you like a step-by-step breakdown of the relevant code paths and possible approaches to address this?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @runllm to ask follow-up questions. See runllm.com for more!

runllm avatar Apr 16 '26 20:04 runllm

Flyte directly supports pods, so why do we need this?

kumare3 avatar Apr 17 '26 14:04 kumare3

Flyte directly supports pods, so why do we need this?

We need to send pod spec to a web API service to run pods outside of our k8s clusters.

madiyar-wayve avatar Apr 17 '26 15:04 madiyar-wayve