Tomas Moreno
03/22/2024, 6:02 PMMarvin
03/22/2024, 6:02 PMjob_variables
parameter when deploying. This allows you to override default values in a work pool’s base job template, including environment variables like image_pull_policy
and image
. You can also specify environment variables through the work pool settings, particularly for Kubernetes work pools.
Here is an example of how to pass environment variables when deploying:
python
if __name__ == "__main__":
get_repo_info.deploy(
name="my-deployment-never-pull",
work_pool_name="my-docker-pool",
job_variables={"image_pull_policy": "Never"}, # Override environment variables here
image="my-image:my-tag",
push=False
)
And you can also configure environment variables in a Kubernetes work pool through its settings in the Prefect UI or Prefect CLI.
For further details, visit the following links:
- Prefect Deployment Guide
- Kubernetes Deployment GuideTomas Moreno
03/22/2024, 6:04 PM