Hi, what is the general workflow when using kubern...
# ask-community
r
Hi, what is the general workflow when using kubernetes worker? How it works, please? I would like to execute python code that is located in gitlab. The worker would clone the project everytime it is scheduled and run the app? Or it is better to already have all the codes/apps present on the disk in the kubernetes pod? Or the pod start a container in itself and executes the app there? Or what is the process, please?
g
You can do all of those things, just depends on how you want to deploy it
r
Is there any best practice or recommendations on how to do this?
g
What I am doing is building a container, that is very light weight with my code baked in,
But if you don't want that overhead, you can use the prefect default container and just clone the repo
r
I like your approach
How that could be done, please?
I thought that you have to have a kubernetes worker that would listen to jobs. But how do you create a container with your job?
g
that is correct
You use the prefect container for the worker
the in you deployment or work pool set the image of for the job to use
🤔 1
r
So everytime your app is scheduled to run prefect spawns a new pod or container in your cluster?
g
correct, it is an k8s job, pod technically
r
nice, I like that
would you have some example somewhere by any chance?
btw. do you specify storage, path or entrypoint in your deployment yaml? I suppose not since there is already pod specification? I.e. you already specified image and entrypoint and therefore there is no need for these variables?