Thang Le
03/31/2026, 6:32 PMMarvin
03/31/2026, 6:32 PMMarvin
03/31/2026, 6:34 PMprefect.yaml with prefect deploy and run your flows on a Kubernetes work pool via the Kubernetes worker. Do not use the PrefectDeployment CRD from prefect-operator for Prefect 3.x.
Why:
- In Prefect 3.x, the supported and recommended model is workers + work pools. A Kubernetes worker running in your cluster pulls work from a Kubernetes work pool and launches each flow run as a Kubernetes Job.
- The prefect-operator/PrefectDeployment CRD is not a first-class, supported path for 3.x and isn’t recommended for production.
- The prefect.yaml + prefect deploy approach is version-controllable, CI/CD friendly, and fully supported.
Minimal setup (Prefect 3.x):
1) Create a Kubernetes work pool
prefect work-pool create --type kubernetes my-k8s-pool
2) Run the Kubernetes worker in your cluster (recommended via Helm)
helm repo add prefect <https://prefecthq.github.io/prefect-helm>
helm install prefect-worker prefect/prefect-worker \
--namespace prefect \
-f values.yaml
3) Define deployments in prefect.yaml and deploy
prefect deploy --help
prefect deploy --all
# or
prefect deploy path/to/flow.py:my_flow -n my-deployment -p my-k8s-pool
Good references:
- Deployments (3.x): Deployments
- Kubernetes worker + work pools: Kubernetes work pool guide
- Workers overview: Workers
- prefect.yaml: prefect.yaml
- Helm chart: Prefect Helm repo
If you’re on a specific K8s distro (EKS/GKE/AKS) or need custom Job templates (node selectors, volumes, SA, etc.), I can share a minimal values.yaml and work pool job template example. Are you using Prefect Cloud or self-hosted, and do you already have a container image for your flows?Thang Le
03/31/2026, 6:35 PMMarvin
03/31/2026, 6:35 PMMarvin
03/31/2026, 6:37 PMprefect deploy) makes docs, support, and features uniform across infrastructures. The operator is a separate repo and is not referenced in the official 3.x docs.
- Maturity and documentation: The 3.x docs focus on workers/work pools; the operator isn’t documented as an official pathway. That’s a signal that it’s not at the same support/maturity level for production guidance.
What’s officially recommended for Kubernetes in 3.x:
- Use a Kubernetes work pool + Kubernetes worker and deploy flows via `prefect.yaml`/`prefect deploy`.
- Kubernetes guide: Kubernetes work pool guide
- Workers concept: Workers
- Deployments: Deployments
- prefect.yaml: prefect.yaml
- Helm chart for the worker: Prefect Helm repo
About the operator:
- Repo: prefect-operator and its PrefectDeployment.md
- It can work for Kubernetes-native, CRD-driven shops, but it’s outside the officially documented 3.x path and not what Prefect Support will point you to for production.
If you’ve already invested in the operator, it may be fine for specific needs—but for a supported, well-documented, cross-infrastructure path, stick with workers/work pools + prefect deploy. If helpful, I can share a minimal values.yaml and a Kubernetes work pool job template that covers image, service account, volumes, and resource requests.Thang Le
03/31/2026, 6:44 PMMarvin
03/31/2026, 6:44 PMMarvin
03/31/2026, 6:47 PMThang Le
03/31/2026, 6:48 PMMarvin
03/31/2026, 6:48 PMMarvin
03/31/2026, 6:49 PMprefect worker start --pool <name> --type <type>)
- PrefectDeployment CRD
- Creates/updates a Prefect Deployment in the Prefect API
- References a work pool (created via PrefectWorkPool CRD or otherwise)
- Does not launch Kubernetes Jobs itself; the worker does that
So:
- You can use the CRDs, but they still rely on the standard 3.x model where workers poll work pools and create flow-run Jobs.
- Without worker pods running for the referenced work pool, flow runs won’t execute.
If you prefer a pure Prefect path without CRDs, you can:
- Create a Kubernetes work pool in Prefect
- Run the Kubernetes worker via the official Helm chart
- Deploy with prefect.yaml + prefect deploy
If you’d like, I can share a minimal pair of CRDs (PrefectWorkPool + PrefectDeployment) that mirror the same outcome as the Helm + prefect deploy path.Thang Le
03/31/2026, 6:50 PMMarvin
03/31/2026, 6:50 PMMarvin
03/31/2026, 6:51 PMprefect deploy, the UI, or Terraform to manage the same deployments/work pools, you can create configuration drift. With CRDs, Kubernetes becomes your desired state; with prefect deploy, Prefect is the source of truth. Pick one for each resource to avoid conflicts.
- Operational complexity
- You’re operating an extra controller (RBAC, upgrades, failure modes, reconciliation loops). Debugging involves operator logs, Prefect API logs, worker logs, and Kubernetes Job logs.
- The official Helm chart for workers is simpler if your only goal is to run flows in K8s: Prefect Worker Helm chart.
- Feature exposure may lag behind `prefect.yaml`/CLI
- The prefect.yaml + prefect deploy path has first-class support for build/push/pull steps, templating, and multi-deployment workflows.
- The CRD must map these capabilities into its schema; new features or parameters may not appear immediately.
- Scope and limitations
- The operator interops with workers/work pools (it does not replace them). It creates/updates work pools via the Prefect API and deploys worker pods; workers still launch Jobs.
- Push/managed work pool types (no worker needed) aren’t the operator’s target; it focuses on hybrid patterns that use workers.
- Community support and docs footprint
- Fewer end-to-end, production-grade examples and troubleshooting docs compared to the worker/work-pool + prefect deploy approach which is the one documented by Prefect.
To your specific question: yes, version mismatch is a real consideration. You should:
- Pin a specific operator release and match it with your Prefect Cloud/Server API version expectations.
- Pin the worker image version (Prefect version) and your flow runtime images; test upgrades in staging.
- Avoid mixing CRD-managed and CLI/UI-managed changes to the same deployment/work pool.
If you value Kubernetes-native GitOps and are comfortable managing the operator lifecycle, the CRD can be useful. If you want the most supported, documented, and straightforward path, use Kubernetes workers + work pools with prefect.yaml and prefect deploy.Thang Le
03/31/2026, 6:53 PMMarvin
03/31/2026, 6:53 PMMarvin
03/31/2026, 6:54 PMprefect deploy if you’re comfortable with a Kubernetes‑native, GitOps flow.
What that looks like:
- Use PrefectWorkPool CRD to:
- Create/update a Prefect work pool (type typically kubernetes)
- Deploy/scale the corresponding Kubernetes worker pods (these still do the execution)
- Use PrefectDeployment CRD to:
- Create/update the Prefect Deployment (entrypoint, parameters, schedules) and point it at your work pool
- Provide Prefect API URL/key via K8s Secrets/CRD fields per the operator docs (works with Prefect Cloud or self-hosted)
Important caveats/tradeoffs:
- Single source of truth: If you go CRD-first, avoid changing the same deployments/work pools via prefect deploy, UI, or Terraform to prevent drift.
- Image/builds are on you: The CRDs won’t build/push images. You’ll handle that in CI and reference the image in your job template or deployment config.
- Feature parity/lag: New Prefect features typically land in the SDK/CLI/docs first; the operator may trail in exposing every knob.
- Version pinning: You’re now managing compatibility between
- Prefect Cloud/Server (API)
- Operator/CRD versions
- Worker and flow runtime images (Prefect Python versions)
Pin and test upgrades.
Authoritative references:
- Prefect Operator repo: prefect-operator
- PrefectDeployment CRD doc: PrefectDeployment.md
- Workers/work pools concepts (still apply): Workers, Work pools
- Official (non-CRD) K8s guide for comparison: Kubernetes work pool guide
If you share whether you’re on Prefect Cloud or self-hosted, I can point you to the specific operator examples for API credentials and a minimal WorkPool + Deployment CRD pair.Thang Le
03/31/2026, 6:54 PMThang Le
03/31/2026, 6:54 PMMarvin
03/31/2026, 6:54 PMMarvin
03/31/2026, 6:56 PMThang Le
03/31/2026, 7:25 PMMarvin
03/31/2026, 7:25 PMMarvin
03/31/2026, 7:26 PMprefect.yaml + prefect deploy with a Kubernetes work pool and worker. If you prefer the CRD for GitOps reasons, it can work—just adopt it with the above cautions and version pinning.
If you’d like, I can help you evaluate risk based on your upgrade cadence and support requirements, or draft a migration plan that keeps you close to workers/work pools so you can pivot if needed.