Fugo Takefusa
09/19/2025, 1:06 AMMarvin
09/19/2025, 1:06 AMMarvin
09/19/2025, 1:13 AM# prefect.yaml
# Run `prefect deploy` from this directory to create the deployment(s).
deployments:
- name: my-flow
entrypoint: flows/my_flow.py:my_flow
description: Minimal deployment using a process worker
work_pool:
name: process-pool
parameters: {}
tags: ["dev"]
A more complete prefect.yaml
- Example targeting a Kubernetes work pool with a basic cron schedule and parameters.
- job_variables are specific to your worker type (this example assumes a Kubernetes worker pool).
# prefect.yaml
deployments:
- name: my-flow-prod
entrypoint: flows/my_flow.py:my_flow
description: Hourly production run on Kubernetes
tags: ["prod"]
parameters:
run_mode: "prod"
retries: 2
schedule:
cron: "0 * * * *"
timezone: "UTC"
work_pool:
name: kubernetes-pool
job_variables:
image: <http://ghcr.io/your-org/your-image:latest|ghcr.io/your-org/your-image:latest>
namespace: data-platform
serviceAccountName: prefect-worker
# The rest of these keys depend on your worker’s schema (resources, env, etc.)
# env:
# PREFECT_LOGGING_LEVEL: INFO
# resources:
# limits:
# cpu: "1"
# memory: "2Gi"
# requests:
# cpu: "500m"
# memory: "1Gi"
version: "1.0.0"
How to use prefect.yaml
- Initialize a recipe (optional, but handy):
- Run: prefect init
to scaffold a prefect.yaml if you don’t have oneMarvin
09/19/2025, 1:13 AMprefect deploy
from the project root
- Make sure everything that needs to talk to your Server has PREFECT_API_URL set (e.g., https://prefect.yourdomain.com/api)
If you want, share a bit about your environment (VM vs Kubernetes, cloud, managed DB, expected scale), and I can tailor a compose file or Helm values and refine the prefect.yaml to match your worker type precisely.