This message was deleted.
# marvin-in-the-wild
s
This message was deleted.
m
To control the Kubernetes job memory and CPU resources for a flow when running Prefect on a Kubernetes cluster, you can modify the base job template. When configuring your deployment, you would add resource requests and limits for memory and CPU. Here's how you can set a CPU request in the JSON representation of the base job template: Under
variables
, add the CPU request section, like so:
Copy code
json
"cpu_request": {
  "title": "CPU Request",
  "description": "The CPU allocation to request for this pod.",
  "default": "default",
  "type": "string"
}
You would also add a corresponding section for memory requests and any other resource configurations you need. For a more comprehensive guide and steps specifically tailored to running your flows with Kubernetes, please refer to the Prefect documentation on running flows with Kubernetes.
b
@Marvin can I modify it per flow?
m
It appears that modifying the Kubernetes job template settings per individual flow is not directly addressed in the excerpts provided. To get more detailed instructions, I would recommend looking into a few additional resources: 1. KubernetesRun: Inspect if
KubernetesRun
has parameters for setting resources at a per-flow level in the relevant Prefect documentation, as it might provide specific parameters for CPU and memory settings. 2. Deployment Specification: Check the deployment specification for flows, as this could include the capability to specify resources in the flow's deployment script or using the
prefect deploy
command. Without a more distinct excerpt, I suggest visiting the Kubernetes section within the Prefect documentation and searching for terms related to configuring per-flow resource settings or consult the information on
KubernetesRun
. For more precise guidance, it may be necessary to consult the Prefect community or, if provided, the documentation on the specific Prefect version that you are using.
b
@Nate can you please help ? 😞
k
you can set it per deployment, if that's what you mean
b
yeah
@Kevin Grismore can you give me an example of how to do so?
k
how are you creating your deployments?
prefect deploy
with a
prefect.yaml
file? or
flow.deploy()
?
b
prefect.yaml