Rasmus
07/29/2025, 11:39 AMsslmode
parameter must be one of: disable, allow, prefer, require, verify-ca, verify-fullMarvin
07/29/2025, 11:39 AMMarvin
07/29/2025, 11:40 AMsslmode
value. The valid options are:
- `disable`: No SSL
- `allow`: Try non-SSL connection first, then SSL if that fails
- `prefer`: Try SSL connection first, then non-SSL if that fails
- `require`: Always use SSL
- `verify-ca`: Always use SSL and verify the CA certificate
- `verify-full`: Always use SSL and verify both CA and hostname
2. You can set this up in one of two ways:
a. Using environment variables:
bash
export PREFECT_SERVER_DATABASE_CONNECTION_URL="<postgresql+asyncpg://user:password@host:port/dbname?sslmode=prefer>"
b. Or in your Prefect server configuration TOML file:
toml
[server.database]
connection_url = "<postgresql+asyncpg://user:password@host:port/dbname?sslmode=prefer>"
3. Choose the appropriate sslmode
based on your security requirements:
- For local development or testing, you might use disable
- For production environments, require
or verify-ca
is recommended
- Use verify-full
for maximum security
If you're using SSL certificates, you'll also need to configure the TLS settings appropriately:
toml
[server.database.sqlalchemy.connect_args.tls]
enabled = true
ca_file = "/path/to/ca.crt" # Optional: Path to CA certificate
cert_file = "/path/to/client-cert.pem" # Optional: Path to client certificate
key_file = "/path/to/client-key.pem" # Optional: Path to client key
Could you share:
1. Which environment you're running this in (local, production, etc.)?
2. Whether you're using SSL certificates?
3. The current connection string you're using (with sensitive information redacted)?
This would help me provide more specific guidance for your setup.Rasmus
07/29/2025, 12:29 PMMarvin
07/29/2025, 12:30 PMMarvin
07/29/2025, 12:31 PMbash
helm repo add prefect <https://prefecthq.github.io/prefect-helm>
helm repo update
2. Create a values.yaml
file for your Prefect server configuration. Here's a minimal working example:
yaml
# values.yaml
postgresql:
enabled: true # Set to false if using external database
auth:
username: prefect
password: your_secure_password
database: prefect
prefect:
server:
database:
# If using internal PostgreSQL (postgresql.enabled=true)
connectionUrl: "<postgresql+asyncpg://prefect:your_secure_password@${RELEASE_NAME}-postgresql:5432/prefect?sslmode=disable>"
# Configure settings for the server API
config:
settings:
logging:
level: "INFO"
# Ingress configuration for nginx
ingress:
enabled: true
className: "nginx" # Make sure you have nginx-ingress controller installed
annotations:
<http://nginx.ingress.kubernetes.io/ssl-redirect|nginx.ingress.kubernetes.io/ssl-redirect>: "true"
# Add these if you're using cert-manager for SSL
# <http://cert-manager.io/cluster-issuer|cert-manager.io/cluster-issuer>: "your-issuer-name"
hosts:
- host: <http://prefect.your-domain.com|prefect.your-domain.com>
paths:
- path: /
pathType: Prefix
tls:
- secretName: prefect-tls-secret
hosts:
- <http://prefect.your-domain.com|prefect.your-domain.com>
# Resources configuration
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
3. Install the Helm chart:
bash
helm install prefect-server prefect/prefect-server -f values.yaml -n your-namespace
4. If you're using an external database, modify the database connection settings:
yaml
postgresql:
enabled: false # Disable internal PostgreSQL
prefect:
server:
database:
connectionUrl: "<postgresql+asyncpg://your_user:your_password@your_external_db:5432/prefect?sslmode=require>"
5. For SSL configuration, you have two main options:
a. Using cert-manager (recommended):
yaml
ingress:
annotations:
<http://cert-manager.io/cluster-issuer|cert-manager.io/cluster-issuer>: "letsencrypt-prod"
<http://kubernetes.io/tls-acme|kubernetes.io/tls-acme>: "true"
tls:
- secretName: prefect-tls-secret
hosts:
- <http://prefect.your-domain.com|prefect.your-domain.com>
b. Using pre-existing certificates:
bash
# Create TLS secret first
kubectl create secret tls prefect-tls-secret \
--cert=path/to/tls.crt \
--key=path/to/tls.key \
-n your-namespace
Prerequisites:
1. Kubernetes cluster
2. Helm v3+ installed
3. nginx-ingress controller installed in your cluster
4. (Optional) cert-manager for automated SSL certificate management
Important notes:
- Make sure your nginx-ingress controller is properly installed and configured
- Replace <http://prefect.your-domain.com|prefect.your-domain.com>
with your actual domain
- Adjust resource requests/limits based on your needs
- The sslmode
in the database URL should match your PostgreSQL setup:
- Use disable
for local/testing without SSL
- Use require
or verify-ca
for production with SSL
To verify the deployment:
bash
kubectl get pods -n your-namespace
kubectl get ingress -n your-namespace
kubectl get services -n your-namespace
Would you like me to:
1. Provide more details about any specific part of this configuration?
2. Add configuration for specific SSL certificates?
3. Show how to configure external PostgreSQL with specific SSL requirements?
Also, are you using any specific cloud provider (AWS, GCP, Azure) or is this an on-premise deployment? This might affect some of the specific configurations needed.