Skip to content

Commit aa24a9a

Browse files
authored
Fix external registry config and other helm tweaks (#2212)
* fix both internal and external registry host * add next steps to self-hosting overview * separate into webapp and registry ingress * fix external registry config check * fix localhost registry warning * bump chart version
1 parent dc568e7 commit aa24a9a

File tree

11 files changed

+265
-121
lines changed

11 files changed

+265
-121
lines changed

docs/self-hosting/overview.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,14 @@ All fields are optional. Partial overrides are supported:
9494
## Community support
9595

9696
It's dangerous to go alone! Join the self-hosting channel on our [Discord server](https://discord.gg/NQTxt5NA7s).
97+
98+
## Next steps
99+
100+
<CardGroup>
101+
<Card title="Docker compose" color="#2496ED" icon="docker" href="/self-hosting/docker">
102+
Learn how to self-host Trigger.dev with Docker compose.
103+
</Card>
104+
<Card title="Kubernetes" color="#326CE5" icon="dharmachakra" href="/self-hosting/kubernetes">
105+
Learn how to self-host Trigger.dev with Kubernetes.
106+
</Card>
107+
</CardGroup>

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.10
5+
version: 4.0.0-beta.11
66
appVersion: trigger-helm-rc.1
77
home: https://trigger.dev
88
sources:

hosting/k8s/helm/README.md

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,13 @@ This chart deploys the following components:
113113
### Basic Configuration
114114
115115
```yaml
116-
# Application URLs
117-
config:
116+
webapp:
117+
# Application URLs
118118
appOrigin: "https://trigger.example.com"
119119
loginOrigin: "https://trigger.example.com"
120120
apiOrigin: "https://trigger.example.com"
121121

122-
# Bootstrap mode (auto-creates worker group)
123-
config:
122+
# Bootstrap mode (auto-creates worker group)
124123
bootstrap:
125124
enabled: true # Enable for combined setups
126125
workerGroupName: "bootstrap"
@@ -133,8 +132,7 @@ Use external managed services instead of bundled components:
133132
```yaml
134133
# External PostgreSQL
135134
postgres:
136-
enabled: false
137-
external: true
135+
deploy: false
138136
external:
139137
host: "your-postgres.rds.amazonaws.com"
140138
port: 5432
@@ -144,17 +142,15 @@ postgres:
144142

145143
# External Redis
146144
redis:
147-
enabled: false
148-
external: true
145+
deploy: false
149146
external:
150147
host: "your-redis.cache.amazonaws.com"
151148
port: 6379
152149
password: "your-password"
153150

154151
# External Docker Registry (e.g., Kind local registry)
155152
registry:
156-
enabled: true
157-
external: true
153+
deploy: true
158154
external:
159155
host: "localhost"
160156
port: 5001
@@ -165,20 +161,39 @@ registry:
165161
### Ingress Configuration
166162
167163
```yaml
168-
ingress:
169-
enabled: true
170-
className: "nginx"
171-
annotations:
172-
cert-manager.io/cluster-issuer: "letsencrypt-prod"
173-
hosts:
174-
- host: trigger.example.com
175-
paths:
176-
- path: /
177-
pathType: Prefix
178-
tls:
179-
- secretName: trigger-tls
180-
hosts:
181-
- trigger.example.com
164+
# Webapp ingress
165+
webapp:
166+
ingress:
167+
enabled: true
168+
className: "nginx"
169+
annotations:
170+
cert-manager.io/cluster-issuer: "letsencrypt-prod"
171+
hosts:
172+
- host: trigger.example.com
173+
paths:
174+
- path: /
175+
pathType: Prefix
176+
tls:
177+
- secretName: trigger-tls
178+
hosts:
179+
- trigger.example.com
180+
181+
# Registry ingress
182+
registry:
183+
ingress:
184+
enabled: true
185+
className: "nginx"
186+
annotations:
187+
cert-manager.io/cluster-issuer: "letsencrypt-prod"
188+
hosts:
189+
- host: registry.example.com
190+
paths:
191+
- path: /
192+
pathType: Prefix
193+
tls:
194+
- secretName: registry-tls
195+
hosts:
196+
- registry.example.com
182197
```
183198
184199
### Resource Configuration

hosting/k8s/helm/templates/NOTES.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ To get started:
2424
kubectl get pods --namespace {{ .Release.Namespace }} -w
2525

2626
2. Access the webapp:
27-
{{- if .Values.ingress.enabled }}
28-
{{- range $host := .Values.ingress.hosts }}
27+
{{- if .Values.webapp.ingress.enabled }}
28+
{{- range $host := .Values.webapp.ingress.hosts }}
2929
{{- range .paths }}
30-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
30+
http{{ if $.Values.webapp.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
3131
{{- end }}
3232
{{- end }}
3333
{{- else if contains "NodePort" .Values.webapp.service.type }}
@@ -86,8 +86,8 @@ Configuration:
8686
{{- if .Values.registry.deploy }}
8787
- Using internal Docker registry
8888
{{- else }}
89-
- Using external Docker registry at {{ .Values.registry.external.host }}:{{ .Values.registry.external.port }}
90-
{{- if eq .Values.registry.external.host "localhost" }}
89+
- Using external Docker registry at {{ .Values.registry.external.host }}
90+
{{- if hasPrefix "localhost" .Values.registry.external.host }}
9191

9292
⚠️ Registry Warning:
9393
Using localhost for registry. Deployments will only work when testing locally in kind or minikube.

hosting/k8s/helm/templates/_helpers.tpl

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ Registry connection details
238238
*/}}
239239
{{- define "trigger-v4.registry.host" -}}
240240
{{- if .Values.registry.deploy -}}
241-
{{ include "trigger-v4.fullname" . }}-registry:{{ .Values.registry.service.port }}
241+
{{ .Values.registry.host }}
242242
{{- else -}}
243-
{{ .Values.registry.external.host }}:{{ .Values.registry.external.port }}
243+
{{ .Values.registry.external.host }}
244244
{{- end -}}
245245
{{- end }}
246246

@@ -306,20 +306,37 @@ Generate docker config for image pull secret
306306
{{- end }}
307307

308308
{{/*
309-
Merge ingress annotations to avoid duplicates
309+
Merge webapp ingress annotations to avoid duplicates
310310
*/}}
311-
{{- define "trigger-v4.ingress.annotations" -}}
311+
{{- define "trigger-v4.webapp.ingress.annotations" -}}
312312
{{- $annotations := dict -}}
313-
{{- if .Values.ingress.annotations -}}
314-
{{- $annotations = .Values.ingress.annotations -}}
313+
{{- if .Values.webapp.ingress.annotations -}}
314+
{{- $annotations = .Values.webapp.ingress.annotations -}}
315315
{{- end -}}
316-
{{- if .Values.ingress.certManager.enabled -}}
317-
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.ingress.certManager.clusterIssuer -}}
316+
{{- if .Values.webapp.ingress.certManager.enabled -}}
317+
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.webapp.ingress.certManager.clusterIssuer -}}
318318
{{- end -}}
319-
{{- if .Values.ingress.externalDns.enabled -}}
320-
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.ingress.externalDns.hostname -}}
321-
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.ingress.externalDns.ttl | toString) -}}
319+
{{- if .Values.webapp.ingress.externalDns.enabled -}}
320+
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.webapp.ingress.externalDns.hostname -}}
321+
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.webapp.ingress.externalDns.ttl | toString) -}}
322322
{{- end -}}
323323
{{- toYaml $annotations -}}
324324
{{- end }}
325325

326+
{{/*
327+
Merge registry ingress annotations to avoid duplicates
328+
*/}}
329+
{{- define "trigger-v4.registry.ingress.annotations" -}}
330+
{{- $annotations := dict -}}
331+
{{- if .Values.registry.ingress.annotations -}}
332+
{{- $annotations = .Values.registry.ingress.annotations -}}
333+
{{- end -}}
334+
{{- if .Values.registry.ingress.certManager.enabled -}}
335+
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.registry.ingress.certManager.clusterIssuer -}}
336+
{{- end -}}
337+
{{- if .Values.registry.ingress.externalDns.enabled -}}
338+
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.registry.ingress.externalDns.hostname -}}
339+
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.registry.ingress.externalDns.ttl | toString) -}}
340+
{{- end -}}
341+
{{- toYaml $annotations -}}
342+
{{- end }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{- if and .Values.registry.deploy .Values.registry.ingress.enabled -}}
2+
{{- $fullName := include "trigger-v4.fullname" . -}}
3+
{{- $svcPort := .Values.registry.service.port -}}
4+
apiVersion: networking.k8s.io/v1
5+
kind: Ingress
6+
metadata:
7+
name: {{ $fullName }}-registry
8+
labels:
9+
{{- $component := "registry" }}
10+
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
11+
annotations:
12+
{{- include "trigger-v4.registry.ingress.annotations" . | nindent 4 }}
13+
spec:
14+
{{- if .Values.registry.ingress.className }}
15+
ingressClassName: {{ .Values.registry.ingress.className }}
16+
{{- end }}
17+
{{- if .Values.registry.ingress.tls }}
18+
tls:
19+
{{- range .Values.registry.ingress.tls }}
20+
- hosts:
21+
{{- range .hosts }}
22+
- {{ . | quote }}
23+
{{- end }}
24+
secretName: {{ .secretName }}
25+
{{- end }}
26+
{{- end }}
27+
rules:
28+
{{- range .Values.registry.ingress.hosts }}
29+
- host: {{ .host | quote }}
30+
http:
31+
paths:
32+
{{- if .paths }}
33+
{{- range .paths }}
34+
- path: {{ .path }}
35+
pathType: {{ .pathType | default "Prefix" }}
36+
backend:
37+
service:
38+
name: {{ $fullName }}-registry
39+
port:
40+
number: {{ $svcPort }}
41+
{{- end }}
42+
{{- else }}
43+
- path: /
44+
pathType: Prefix
45+
backend:
46+
service:
47+
name: {{ $fullName }}-registry
48+
port:
49+
number: {{ $svcPort }}
50+
{{- end }}
51+
{{- end }}
52+
{{- end }}

hosting/k8s/helm/templates/validate-external-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ This template will fail the Helm deployment if external config is missing for re
3333
{{- end }}
3434

3535
{{- if not .Values.registry.deploy }}
36-
{{- if or (not .Values.registry.external.host) (not .Values.registry.external.port) }}
37-
{{- fail "Registry external configuration is required when registry.deploy=false. Please provide registry.external.host and registry.external.port" }}
36+
{{- if or (not .Values.registry.external.host) }}
37+
{{- fail "Registry external configuration is required when registry.deploy=false. Please provide registry.external.host" }}
3838
{{- end }}
3939
{{- end }}
4040

hosting/k8s/helm/templates/ingress.yaml renamed to hosting/k8s/helm/templates/webapp-ingress.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
{{- if .Values.ingress.enabled -}}
1+
{{- if .Values.webapp.ingress.enabled -}}
22
{{- $fullName := include "trigger-v4.fullname" . -}}
33
{{- $svcPort := .Values.webapp.service.port -}}
44
apiVersion: networking.k8s.io/v1
55
kind: Ingress
66
metadata:
7-
name: {{ $fullName }}
7+
name: {{ $fullName }}-webapp
88
labels:
9-
{{- include "trigger-v4.labels" . | nindent 4 }}
9+
{{- $component := "webapp" }}
10+
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
1011
annotations:
11-
{{- include "trigger-v4.ingress.annotations" . | nindent 4 }}
12+
{{- include "trigger-v4.webapp.ingress.annotations" . | nindent 4 }}
1213
spec:
13-
{{- if .Values.ingress.className }}
14-
ingressClassName: {{ .Values.ingress.className }}
14+
{{- if .Values.webapp.ingress.className }}
15+
ingressClassName: {{ .Values.webapp.ingress.className }}
1516
{{- end }}
16-
{{- if .Values.ingress.tls }}
17+
{{- if .Values.webapp.ingress.tls }}
1718
tls:
18-
{{- range .Values.ingress.tls }}
19+
{{- range .Values.webapp.ingress.tls }}
1920
- hosts:
2021
{{- range .hosts }}
2122
- {{ . | quote }}
@@ -24,7 +25,7 @@ spec:
2425
{{- end }}
2526
{{- end }}
2627
rules:
27-
{{- range .Values.ingress.hosts }}
28+
{{- range .Values.webapp.ingress.hosts }}
2829
- host: {{ .host | quote }}
2930
http:
3031
paths:

hosting/k8s/helm/templates/webapp.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ spec:
172172
{{- toYaml .Values.webapp.resources | nindent 12 }}
173173
env:
174174
- name: APP_ORIGIN
175-
value: {{ .Values.config.appOrigin | quote }}
175+
value: {{ .Values.webapp.appOrigin | quote }}
176176
- name: LOGIN_ORIGIN
177-
value: {{ .Values.config.loginOrigin | quote }}
177+
value: {{ .Values.webapp.loginOrigin | quote }}
178178
- name: API_ORIGIN
179-
value: {{ .Values.config.apiOrigin | quote }}
179+
value: {{ .Values.webapp.apiOrigin | quote }}
180180
- name: ELECTRIC_ORIGIN
181181
value: {{ include "trigger-v4.electric.url" . | quote }}
182182
- name: DATABASE_URL
@@ -194,7 +194,7 @@ spec:
194194
- name: APP_LOG_LEVEL
195195
value: {{ .Values.webapp.logLevel | quote }}
196196
- name: DEV_OTEL_EXPORTER_OTLP_ENDPOINT
197-
value: "{{ .Values.config.appOrigin }}/otel"
197+
value: "{{ .Values.webapp.appOrigin }}/otel"
198198
- name: DEPLOY_REGISTRY_HOST
199199
value: {{ include "trigger-v4.registry.host" . | quote }}
200200
- name: DEPLOY_REGISTRY_NAMESPACE

0 commit comments

Comments
 (0)