Cade Summers
10/01/2024, 7:40 PMMarvin
10/01/2024, 7:41 PMKubernetesWorkerJobConfiguration
to set resource limits for the Kubernetes jobs. Specifically, you will need to modify the job manifest to include the resource requests and limits.
Refer to the documentation on Kubernetes workers for more information.
### Prefect 3.x
For Prefect 3.x, similar steps are followed but within the context of configuring work pools. You can modify the job template JSON directly to add resource requests.
Example for setting CPU requests:
1. Go to the advanced settings in your work pool configuration.
2. Edit the JSON representation of the base job template.
3. Add a section for CPU requests:
json
"cpu_request": {
"title": "CPU Request",
"description": "The CPU allocation to request for this pod.",
"default": "default",
"type": "string"
},
...
"containers": [
{
...
"resources": {
"requests": {
"cpu": "{{ cpu_request }}"
}
}
}
]
...
Check the documentation on Kubernetes work pool configuration for more details.
By following these steps, you can customize the resources allocated to your Prefect jobs running on Kubernetes.