Skip to main content
You can use Helm to manage a self-hosted Prefect server and a worker.

Prerequisites

  • A Kubernetes cluster
  • Install the Helm CLI

Deploy a server with Helm

Configuring ingress or publicly exposing Prefect from the cluster is business dependent and not covered in this tutorial. For details on Ingress configuration, consult the Kubernetes documentation.

Add the Prefect Helm repository:

Create a namespace

Create a new namespace for this tutorial (all commands will use this namespace):

Deploy the server

Expected output:

Access the Prefect UI:

Open localhost:4200 in your browser. If using basic authentication, sign in with admin:password123.

Deploy a worker with Helm

To connect a worker to your self-hosted Prefect server in the same cluster: Expected output:

Cleanup

To uninstall the self-hosted Prefect server and Prefect worker:

Kubernetes health and readiness probes

The Prefect server exposes two HTTP endpoints for monitoring: The prefect-server Helm chart supports optional liveness and readiness probes, but both are disabled by default. Enable them in your server values:
When enabled, the liveness probe uses /api/health and the readiness probe uses /api/ready. Kubernetes then stops routing traffic when the database is down, but it does not restart the pod. If the server does not recover after Postgres becomes available, restart it manually. If you need the pod to restart after sustained database failure, point the liveness probe at /api/ready instead. Be aware that transient database blips can trigger restarts, so tune periodSeconds and failureThreshold accordingly.
The current chart exposes probe timing settings (for example periodSeconds) but not probe paths. Follow prefect-helm#635 for configurable probe paths. Until that change is available in a released chart, patch the generated Deployment manifest to customize the paths.
For load balancer and reverse-proxy health checks, see Load balancer configuration in the self-hosted guide.

Troubleshooting