Hello! I am attempting to override the default mem...
# ask-community
d
Hello! I am attempting to override the default memory/cpu limit/requests for deployments that are created by a flow. Today we are using the infra_overrides args in order to get our image to populate when the K8s worker spins up pods, and that seems to work just fine. But, it does not appear to be changing the resource allocation out of the default values. The deployment config created through build_from_flow shows up in the as the photo below. Is infra_overrides the correct method of setting these on a per deployment basis or is there another value we need to be setting in order to manage resources more effectively in the pods spun up?
1
a
Hey @Dane Linsky! Have you added variables to the base job template for your Kubernetes work pool that will allow deployments to provide custom resources values? The default base job template for Kubernetes work pools don’t have such variables, but you can refer to this documentation for how to add them: https://prefecthq.github.io/prefect-kubernetes/worker/
🙌 1
d
Ah I tracked it down, thank you @alex!
🙌 1
m
jumping onto this thread with a related question. Is it possible to have variables such as these be provided at flow run time? The use case I have is sometimes a flow may need more or less memory depending on how it is used. Currently we tend to just wrap this in multiple deployments, but it's inconvenient to do this.
a
That isn’t possible today, but it is on our roadmap!
🙌 1
m
thanks for the reply - definitely interested in that