Melek Alan
07/30/2025, 10:11 AMselfHostedServer
All deployments share a common jobTemplate
.
Some deployments are more resource-intensive than others.
Is there a way to define different resources.requests/limits
per deployment, without duplicating the entire job template?
Thanks!alex
07/30/2025, 1:48 PMBrendan Dalpe
07/30/2025, 5:09 PMprefect.yaml
to define your deployments?Brendan Dalpe
07/30/2025, 5:15 PMprefect.yaml
file. https://docs.prefect.io/v3/how-to-guides/deployments/prefect-yaml#reuse-configuration-across-deployments
definitions:
test: &test
foo: bar
bar: baz
deployments:
- name: one
value: *test
- name: two
value:
<<: *test
foo: not_bar
This would output:
deployments:
- name: one
value:
foo: bar
bar: baz
- name: two
value:
foo: not_bar
bar: baz
Note the special <<: *
syntax which allows you to override a specific setting within that block. You could apply something similar to your prefect.yaml
file to override deployment-specifc job resource limits.Melek Alan
08/13/2025, 7:59 AMprefect.yaml
to define deployments. I’ve added the resources
snippet to our base job template, and all Prefect jobs use it without any issues.
The problem is with one specific deployment: it requires higher CPU and memory requests. I’ve added the updated job variables
configuration in the deployment configuration, and I can see it correctly when I edit the deployment in the UI.
However, when the job actually runs, the pod still uses the CPU and memory values from the base job template instead of the deployment configuration.
I tried a few things, including removing the resources
snippet from the base job template, but I still don’t see the deployment-specific configuration applied at runtime.
Example snippet from the base job template:
"
spec": {
"containers": [
{
"env": "{{ env }}",
"args": "{{ command }}",
"name": "prefect-job",
"image": "{{ image }}",
"imagePullPolicy": "{{ image_pull_policy }}",
"resources": {
"requests": {
"cpu": "100m",
"memory": "256Mi"
}
}
}
]
}
Brendan Dalpe
08/13/2025, 5:13 PMBrendan Dalpe
08/13/2025, 5:14 PMBrendan Dalpe
08/13/2025, 5:17 PMMelek Alan
08/14/2025, 9:56 AM