Tom Han
05/20/2026, 6:03 PMMarvin
05/20/2026, 6:03 PMMarvin
05/20/2026, 6:05 PM<http://prefect-server.prefect.svc.cluster.local:4200/api>
- If server is outside the cluster, expose it via ingress / internal LB / routable hostname
3. Create a Kubernetes work pool
- This tells Prefect that runs from that pool should launch as Kubernetes jobs
4. Run a Kubernetes worker
- The worker polls the work pool and creates K8s Jobs for scheduled flow runs
5. Deploy flows to that work pool
- Either from prefect.yaml with prefect deploy
- Or in Python with flow.from_source(...).deploy(...)
A very typical architecture is:
text
Prefect server API <--- polled by --- Kubernetes worker
|
v
creates K8s Jobs
|
v
flow runs
Main gotcha: the worker needs a cluster-valid PREFECT_API_URL.
If your server is self-hosted on a machine outside k8s, localhost:4200 will not work from the worker pod.
For example:
text
Good inside same cluster:
<http://prefect-server.prefect.svc.cluster.local:4200/api>
Bad from inside worker pod:
<http://localhost:4200/api>
If you want the shortest path, I’d recommend:
- Deploy Prefect server with Helm:
server Helm guide
- Then follow the Kubernetes work pool guide:
run flows on Kubernetes
If helpful, I can also give you a concrete end-to-end example for either of these setups:
1. Prefect server runs inside the same k8s cluster, or
2. Prefect server runs outside k8s and workers run in the cluster
If you tell me which one you’re aiming for, I can sketch the exact YAML / commands.Nate
05/20/2026, 6:25 PMNate
05/20/2026, 6:26 PMNate
05/20/2026, 6:28 PM