According to the Prefect documentation on
composing flows, a subflow run is created when a flow function is called inside the execution of another flow, which is considered the parent flow. The child flow, or subflow, runs like a normal flow with a full representation of the flow run in the backend as if it had been called separately.
The documentation does not explicitly state that a subflow can be executed on a different pod in Kubernetes. However, since subflow runs behave like normal flow runs and there's no specific constraint mentioned, it seems technically feasible for a subflow to run in its own pod, given the right configuration in the deployment. This would likely involve setting up the subflow as an independent deployment that can be triggered by the parent flow.
To ensure that subflows can run separately, you might need to explicitly configure the infrastructure for your Prefect deployment to handle subflows in distinct pods, respecting any Kubernetes configurations you have, such as resource limitations, node selectors, or affinity rules.
For specific Kubernetes execution environment configurations, you can refer to the Prefect
Docker guide for deploying flows in a Kubernetes cluster, but keep in mind that this guide does not directly address your question about subflows.
For a precise answer and instructions on how to configure subflow execution in separate pods, further research or inquiring on Prefect community channels might be necessary.