How to use external Postgres when deploy by Helm Chart?

Thanks @George_Coyne and @jwlarocque !

The helm values are quite confused, it turns out I actually only need set two values:

Here is my final solution to use external Postgres host.

Assuming my Postgres host is postgres-service.hm-postgres.svc, port is 5432, username is admin, password is passw0rd.

First, I need create a secret, and this secret has to be in same namespace with Prefect Server.

kubectl create secret generic hm-prefect-postgres-secret \
  --namespace=hm-prefect \
  --from-literal="connection-string=postgresql+asyncpg://admin:passw0rd@postgres-service.hm-postgres.svc:5432/hm_prefect_db"

Then, I can deploy Prefect Server by:

helm install \
  prefect-server \
  prefect/prefect-server \
  --namespace=hm-prefect \
  --create-namespace \
  --values=my-values.yaml

my-values.yaml

server:
  publicApiUrl: https://prefect.example.com/api
postgresql:
  useSubChart: false
  auth:
    existingSecret: hm-prefect-postgres-secret

Hopefully it helps save people some time in future! :smiley: