Dominik
10/10/2024, 8:36 PMMarvin
10/10/2024, 8:36 PMPREFECT_API_DATABASE_CONNECTION_URL
to point to your external database.
Here's a brief guide on how to do this:
1. PostgreSQL Connection URL: First, ensure that your PostgreSQL database is correctly configured and accessible. You need to set the database connection URI, which typically looks like this:
postgresql+asyncpg://<username>:<password>@<host>:<port>/<database>
Replace <username>
, <password>
, <host>
, <port>
, and <database>
with your actual PostgreSQL database credentials and details.
2. Helm Chart Configuration:
- Update the values in your Helm chart's values.yaml
file. You will need to add or modify the setting for the Prefect database connection URL. This is generally done under the server
configuration in the values.yaml
file.
- Here's an example of how your values.yaml
file might look:
server:
extraEnv:
PREFECT_API_DATABASE_CONNECTION_URL: "postgresql+asyncpg://<username>:<password>@<host>:<port>/<database>"
3. Deploy Using Helm:
- If you haven't already added the Helm repository, do so with:
helm repo add prefect <https://prefecthq.github.io/prefect-helm>
helm repo update
- Deploy the Prefect instance with your configured `values.yaml`:
helm install my-prefect-release prefect/prefect-server -f values.yaml
For detailed steps and further guidance, you can refer to the official Prefect documentation on setting up self-hosted configurations for Prefect 2.x here and Prefect 3.x here.
If you encounter any issues, make sure to check that the network settings allow connections from the Kubernetes cluster to your PostgreSQL database, and that PostgreSQL is properly configured to accept connections from external hosts.