Skip to content

Commit 1a64013

Browse files
authored
fix(helm): external config and secret support (#2245)
* fix postgres and redis external config, incl redis tls * external secret support for postgres, redis, clickhouse, plus fixes * s3: full existing secret support, external fixes * bump chart version * add subchart links * update external config docs * tidy up validation and helper
1 parent f456f68 commit 1a64013

File tree

7 files changed

+559
-46
lines changed

7 files changed

+559
-46
lines changed

docs/self-hosting/kubernetes.mdx

Lines changed: 137 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,152 @@ webapp:
198198
199199
### External services
200200
201-
You can disable the built-in services and use external services instead. For example:
201+
You can disable the built-in services and use external services instead. The chart supports both direct configuration and existing Kubernetes secrets for secure credential management.
202202
203+
#### PostgreSQL
204+
205+
**Direct configuration:**
206+
```yaml
207+
postgres:
208+
deploy: false
209+
external:
210+
databaseUrl: "postgresql://user:password@host:5432/database?schema=public"
211+
directUrl: "" # Optional, defaults to databaseUrl
212+
```
213+
214+
**Using existing secrets (recommended):**
203215
```yaml
204216
postgres:
205217
deploy: false
206218
external:
207-
host: "my-postgres.example.com"
208-
port: 5432
209-
database: "my-database"
219+
existingSecret: "postgres-credentials"
220+
# Optional: Use secretKeys to specify the key names in the secret
221+
# secretKeys:
222+
# databaseUrlKey: "postgres-database-url" # default
223+
# directUrlKey: "postgres-direct-url" # default
224+
```
225+
226+
#### Redis
227+
228+
**Direct configuration:**
229+
```yaml
230+
redis:
231+
deploy: false
232+
external:
233+
host: "my-redis.example.com"
234+
port: 6379
235+
password: "my-password"
236+
tls:
237+
enabled: true
238+
```
239+
240+
**Using existing secrets (recommended):**
241+
```yaml
242+
redis:
243+
deploy: false
244+
external:
245+
host: "my-redis.example.com"
246+
port: 6379
247+
existingSecret: "redis-credentials"
248+
# existingSecretPasswordKey: "redis-password" # default (optional)
249+
tls:
250+
enabled: true
251+
```
252+
253+
#### ClickHouse
254+
255+
**Direct configuration:**
256+
```yaml
257+
clickhouse:
258+
deploy: false
259+
external:
260+
host: "my-clickhouse.example.com"
261+
port: 8123
210262
username: "my-username"
211263
password: "my-password"
212264
```
213265
266+
**Using existing secrets (recommended):**
267+
```yaml
268+
clickhouse:
269+
deploy: false
270+
external:
271+
host: "my-clickhouse.example.com"
272+
port: 8123
273+
username: "my-username"
274+
existingSecret: "clickhouse-credentials"
275+
# existingSecretKey: "clickhouse-password" # default (optional)
276+
```
277+
278+
#### S3 Object Storage
279+
280+
**Direct configuration:**
281+
```yaml
282+
minio:
283+
deploy: false
284+
s3:
285+
external:
286+
endpoint: "https://s3.amazonaws.com"
287+
accessKeyId: "my-access-key"
288+
secretAccessKey: "my-secret-key"
289+
```
290+
291+
**Using existing secrets (recommended):**
292+
```yaml
293+
minio:
294+
deploy: false
295+
s3:
296+
external:
297+
endpoint: "https://s3.amazonaws.com"
298+
existingSecret: "s3-credentials"
299+
# Optional: Use secretKeys to specify the key names in the secret
300+
# secretKeys:
301+
# accessKeyIdKey: "access-key-id" # default
302+
# secretAccessKeyKey: "secret-access-key" # default
303+
```
304+
305+
### PostgreSQL SSL with custom CA certificates
306+
307+
When connecting to PostgreSQL instances that require custom CA certificates (such as AWS RDS with SSL verification), you can mount the CA certificate as a volume and configure the webapp to use it:
308+
309+
```yaml
310+
postgres:
311+
deploy: false
312+
external:
313+
databaseUrl: "postgresql://user:[email protected]:5432/triggerdb?schema=public&sslmode=require"
314+
# Alternatively, use an existing secret
315+
existingSecret: "postgres-credentials"
316+
# secretKeys:
317+
# databaseUrlKey: "postgres-database-url" # default
318+
connection:
319+
sslMode: "require"
320+
321+
# Webapp configuration with SSL CA certificate
322+
webapp:
323+
extraEnvVars:
324+
- name: NODE_EXTRA_CA_CERTS
325+
value: "/etc/ssl/certs/postgres-ca.crt"
326+
327+
extraVolumes:
328+
- name: postgres-ca-cert
329+
secret:
330+
secretName: postgres-ca-secret
331+
items:
332+
- key: ca.crt
333+
path: postgres-ca.crt
334+
335+
extraVolumeMounts:
336+
- name: postgres-ca-cert
337+
mountPath: /etc/ssl/certs
338+
readOnly: true
339+
```
340+
341+
**Benefits:**
342+
- No plaintext credentials in `values.yaml` or Helm releases
343+
- Complete `DATABASE_URL` stored securely in Kubernetes secrets
344+
- Compatible with secret management tools (External Secrets Operator, etc.)
345+
- Follows Kubernetes security best practices
346+
214347
## Worker token
215348

216349
When using the default bootstrap configuration, worker creation and authentication is handled automatically. The webapp generates a worker token and makes it available to the supervisor via a shared volume.

hosting/k8s/helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: trigger
33
description: The official Trigger.dev Helm chart
44
type: application
5-
version: 4.0.0-beta.16
5+
version: 4.0.0-beta.17
66
appVersion: v4.0.0-v4-beta.22
77
home: https://trigger.dev
88
sources:

0 commit comments

Comments
 (0)