Tahir Uddin Khan
02/26/2026, 7:19 PMMarvin
02/26/2026, 7:19 PMMarvin
02/26/2026, 7:22 PM# 1) Point your CLI to your self-hosted server
export PREFECT_API_URL="http://<your-server>:4200/api"
# 2) Create a Kubernetes work pool
prefect work-pool create --type kubernetes gke-pool
# 3) Run a worker in your GKE cluster (Helm example)
helm repo add prefect <https://prefecthq.github.io/prefect-helm>
helm repo update
helm install prefect-worker prefect/prefect-worker \
--namespace prefect --create-namespace \
--set worker.config.workPool="gke-pool" \
--set worker.cloudApiConfig.apiUrl="http://<your-server>:4200/api"
# 4) Deploy a flow to that pool (Python)
from prefect import flow
@flow(log_prints=True)
def hello(name="GKE"): print(f"Hello, {name}!")
hello.deploy(name="hello-deployment", work_pool_name="gke-pool", image="prefecthq/prefect:3-latest")
Key docs:
- Self-hosted server: Prefect Server (self-hosted)
- Kubernetes workers/pools: Run on Kubernetes (GKE compatible)
- Deploy via Python (flow.deploy) and from source:
- Deploy via Python
- Store flow code / from_source
- Helm chart: Prefect Helm repo
Notes:
- In self-hosted, you usually only need PREFECT_API_URL for the worker.
- In Prefect 3.x, use work pools/workers and flow.deploy() or prefect deploy (not the old 2.x commands).
Want a step-by-step with Helm values or raw Kubernetes manifests for GKE?