<@ULVA73B9P>, if I'm using flow.deploy to create t...
# marvin-in-the-wild
o
@Marvin, if I'm using flow.deploy to create the deployment for a k8s worker, is there a typed class I can use to populate the
job_variables
parameter on the
deploy
method?
m
When creating a deployment with
flow.deploy
for a Kubernetes worker, you can populate the
job_variables
parameter with a dictionary. Here is an example of how to use the
.deploy()
method to deploy your flow, including the
job_variables
, straight from the Prefect documentation:
Copy code
python
if __name__ == "__main__":
    flow.from_source(
        source="<https://github.com/zzstoatzz/prefect-monorepo.git>",
        entrypoint="src/demo_project/demo_flow.py:some_work"
    ).deploy(
        name="demo-deployment",
        work_pool_name="k8s-worker-pool",
        job_variables={
            "env": {
                "EXECUTION_ENVIRONMENT": "staging",
                "MY_NOT_SO_SECRET_CONFIG": "plumbus"
            }
            # ... other job variables ...
        }
    )
For more details, please see the relevant section in the Prefect documentation about overriding job variables. There isn't a specific typed class provided for populating `job_variables`; you would simply use a Python dictionary to define them.
n
hey @Omar Khudeira - great question!