<@ULVA73B9P> can i use GKE with self hosted
# ask-marvin
t
@Marvin can i use GKE with self hosted
m
thought for 226.2 seconds
Yes—Prefect 3.x works great with a self-hosted server and GKE. The typical setup is: - Run a self-hosted Prefect Server (anywhere: VM, Docker, or even inside GKE) - Create a Kubernetes work pool - Run a Kubernetes worker in your GKE cluster that polls your self-hosted server - Deploy flows to that work pool Quick start (high level):
Copy code
# 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?