<@ULVA73B9P> I have prefect jobs running on on kub...
# ask-marvin
c
@Marvin I have prefect jobs running on on kubernetes. The pods that get created have limited cpu and memory, and I need to increase the amounts available to them. How can I set jobs created in work pools or by workers to have more memory and cpu available to them?
m
To increase the memory and CPU available to your Prefect jobs running on Kubernetes, you need to configure the Kubernetes job manifest. This process differs slightly depending on the version of Prefect you are using. ### Prefect 2.x For Prefect 2.x, you can configure the
KubernetesWorkerJobConfiguration
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:
Copy code
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.