How does `KubernetesJob` block work? There’s almos...
# prefect-community
t
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
Hi Tony , There are a number of videos and discourse docs tackling this - are there any in particular you find unhelpful ?
t
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
-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
thanks, that’s helpful
c
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