https://prefect.io logo
Title
t

Tony Popov

09/22/2022, 9:26 PM
How does
KubernetesJob
block work? There’s almost no info in the docs and github examples are quite confusing. Context is setting up the CI deployment of Prefect flows
1
c

Christopher Boyd

09/22/2022, 9:28 PM
Hi Tony , There are a number of videos and discourse docs tackling this - are there any in particular you find unhelpful ?
t

Tony Popov

09/22/2022, 9:32 PM
You’ve created a deployment using
-i kubernetes-job
but now you want to create a custom, re-usable infrastructure block.
Is it possible to create
kubernetes-job
deployment without custom job configuration?
The general process of how jobs are created(and how the whole Prefect k8s on-prem deployment should work) is quite confusing and not explained anywhere including these links
c

Christopher Boyd

09/22/2022, 9:38 PM
-I creates a regular KubernetesJob with a default template
-ib creates a block with a customized KubernetesJob - maybe you want different images, or resource limits between dev and prod
1
The KubernetesJob template contains a job spec which is what kubernetes uses to spawn a job
t

Tony Popov

09/22/2022, 9:39 PM
thanks, that’s helpful
c

Christopher Boyd

09/22/2022, 9:40 PM
When you create a flow run from a deployment , it sees that it's a KubernetesJob (either from -i or -ib) and gets all of its job config from that