I currently have a selection of jobs that run on k...
# ask-community
t
I currently have a selection of jobs that run on kubernetes that I would like to migraate to prefect. I am trying to understand how I would make the decision of which approach to take. Is a flow on prefect deployed to a kubernetes pod and all the tasks deployed on that pod? If so and the current tasks have different configurations to run on kubernetes, would it be best to split the existing jobs into different flows?
a
Great question. It’s ultimately up to you how you choose to design your flows and tasks: the more you separate your logic into separate tasks, the more orchestration benefits you’ll get. There are also several Kubernetes Tasks that you could use, as well. Whether a flow will get deployed to a single or multiple Kubernetes pods, I think it depends to some extent on the executor you choose. With LocalExecutor yes, it should be one pod per flow, but if you’ll spin up a temporary Dask cluster on Kubernetes for your flow, then Dask will parallelize work across multiple pods.
upvote 1
t
OK, interesting.
And to use dask in my flow I would use a DaskExecutor?
a
Correct. There is e a documentation page that goes more into details: https://docs.prefect.io/core/advanced_tutorials/dask-cluster.html
t
I don't suppose the is example code of this last option? Would be great to have a look.
I think you beat me to it. 😄
a
haha 😄
t
Let me look at that then.
thanks a lot for the help
👍 1
k
I think you’re good, but just to be exact, Prefect Flows are submitted as Kubernetes Jobs, which does create a Pod.
👍 1
upvote 1