Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/self-hosting/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,14 @@ All fields are optional. Partial overrides are supported:
## Community support

It's dangerous to go alone! Join the self-hosting channel on our [Discord server](https://discord.gg/NQTxt5NA7s).

## Next steps

<CardGroup>
<Card title="Docker compose" color="#2496ED" icon="docker" href="/self-hosting/docker">
Learn how to self-host Trigger.dev with Docker compose.
</Card>
<Card title="Kubernetes" color="#326CE5" icon="dharmachakra" href="/self-hosting/kubernetes">
Learn how to self-host Trigger.dev with Kubernetes.
</Card>
</CardGroup>
2 changes: 1 addition & 1 deletion hosting/k8s/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: trigger
description: The official Trigger.dev Helm chart
type: application
version: 4.0.0-beta.10
version: 4.0.0-beta.11
appVersion: trigger-helm-rc.1
home: https://trigger.dev
sources:
Expand Down
63 changes: 39 additions & 24 deletions hosting/k8s/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,13 @@ This chart deploys the following components:
### Basic Configuration

```yaml
# Application URLs
config:
webapp:
# Application URLs
appOrigin: "https://trigger.example.com"
loginOrigin: "https://trigger.example.com"
apiOrigin: "https://trigger.example.com"

# Bootstrap mode (auto-creates worker group)
config:
# Bootstrap mode (auto-creates worker group)
bootstrap:
enabled: true # Enable for combined setups
workerGroupName: "bootstrap"
Expand All @@ -133,8 +132,7 @@ Use external managed services instead of bundled components:
```yaml
# External PostgreSQL
postgres:
enabled: false
external: true
deploy: false
external:
host: "your-postgres.rds.amazonaws.com"
port: 5432
Expand All @@ -144,17 +142,15 @@ postgres:

# External Redis
redis:
enabled: false
external: true
deploy: false
external:
host: "your-redis.cache.amazonaws.com"
port: 6379
password: "your-password"

# External Docker Registry (e.g., Kind local registry)
registry:
enabled: true
external: true
deploy: true
external:
host: "localhost"
port: 5001
Expand All @@ -165,20 +161,39 @@ registry:
### Ingress Configuration

```yaml
ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- host: trigger.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: trigger-tls
hosts:
- trigger.example.com
# Webapp ingress
webapp:
ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- host: trigger.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: trigger-tls
hosts:
- trigger.example.com

# Registry ingress
registry:
ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- host: registry.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: registry-tls
hosts:
- registry.example.com
```

### Resource Configuration
Expand Down
10 changes: 5 additions & 5 deletions hosting/k8s/helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ To get started:
kubectl get pods --namespace {{ .Release.Namespace }} -w

2. Access the webapp:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- if .Values.webapp.ingress.enabled }}
{{- range $host := .Values.webapp.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
http{{ if $.Values.webapp.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.webapp.service.type }}
Expand Down Expand Up @@ -86,8 +86,8 @@ Configuration:
{{- if .Values.registry.deploy }}
- Using internal Docker registry
{{- else }}
- Using external Docker registry at {{ .Values.registry.external.host }}:{{ .Values.registry.external.port }}
{{- if eq .Values.registry.external.host "localhost" }}
- Using external Docker registry at {{ .Values.registry.external.host }}
{{- if hasPrefix "localhost" .Values.registry.external.host }}

⚠️ Registry Warning:
Using localhost for registry. Deployments will only work when testing locally in kind or minikube.
Expand Down
39 changes: 28 additions & 11 deletions hosting/k8s/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ Registry connection details
*/}}
{{- define "trigger-v4.registry.host" -}}
{{- if .Values.registry.deploy -}}
{{ include "trigger-v4.fullname" . }}-registry:{{ .Values.registry.service.port }}
{{ .Values.registry.host }}
{{- else -}}
{{ .Values.registry.external.host }}:{{ .Values.registry.external.port }}
{{ .Values.registry.external.host }}
{{- end -}}
{{- end }}

Expand Down Expand Up @@ -306,20 +306,37 @@ Generate docker config for image pull secret
{{- end }}

{{/*
Merge ingress annotations to avoid duplicates
Merge webapp ingress annotations to avoid duplicates
*/}}
{{- define "trigger-v4.ingress.annotations" -}}
{{- define "trigger-v4.webapp.ingress.annotations" -}}
{{- $annotations := dict -}}
{{- if .Values.ingress.annotations -}}
{{- $annotations = .Values.ingress.annotations -}}
{{- if .Values.webapp.ingress.annotations -}}
{{- $annotations = .Values.webapp.ingress.annotations -}}
{{- end -}}
{{- if .Values.ingress.certManager.enabled -}}
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.ingress.certManager.clusterIssuer -}}
{{- if .Values.webapp.ingress.certManager.enabled -}}
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.webapp.ingress.certManager.clusterIssuer -}}
{{- end -}}
{{- if .Values.ingress.externalDns.enabled -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.ingress.externalDns.hostname -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.ingress.externalDns.ttl | toString) -}}
{{- if .Values.webapp.ingress.externalDns.enabled -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.webapp.ingress.externalDns.hostname -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.webapp.ingress.externalDns.ttl | toString) -}}
{{- end -}}
{{- toYaml $annotations -}}
{{- end }}

{{/*
Merge registry ingress annotations to avoid duplicates
*/}}
{{- define "trigger-v4.registry.ingress.annotations" -}}
{{- $annotations := dict -}}
{{- if .Values.registry.ingress.annotations -}}
{{- $annotations = .Values.registry.ingress.annotations -}}
{{- end -}}
{{- if .Values.registry.ingress.certManager.enabled -}}
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.registry.ingress.certManager.clusterIssuer -}}
{{- end -}}
{{- if .Values.registry.ingress.externalDns.enabled -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/hostname" .Values.registry.ingress.externalDns.hostname -}}
{{- $_ := set $annotations "external-dns.alpha.kubernetes.io/ttl" (.Values.registry.ingress.externalDns.ttl | toString) -}}
{{- end -}}
{{- toYaml $annotations -}}
{{- end }}
52 changes: 52 additions & 0 deletions hosting/k8s/helm/templates/registry-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{- if and .Values.registry.deploy .Values.registry.ingress.enabled -}}
{{- $fullName := include "trigger-v4.fullname" . -}}
{{- $svcPort := .Values.registry.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-registry
labels:
{{- $component := "registry" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
annotations:
{{- include "trigger-v4.registry.ingress.annotations" . | nindent 4 }}
spec:
{{- if .Values.registry.ingress.className }}
ingressClassName: {{ .Values.registry.ingress.className }}
{{- end }}
{{- if .Values.registry.ingress.tls }}
tls:
{{- range .Values.registry.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.registry.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- if .paths }}
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType | default "Prefix" }}
backend:
service:
name: {{ $fullName }}-registry
port:
number: {{ $svcPort }}
{{- end }}
{{- else }}
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-registry
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions hosting/k8s/helm/templates/validate-external-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ This template will fail the Helm deployment if external config is missing for re
{{- end }}

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{{- if .Values.ingress.enabled -}}
{{- if .Values.webapp.ingress.enabled -}}
{{- $fullName := include "trigger-v4.fullname" . -}}
{{- $svcPort := .Values.webapp.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
name: {{ $fullName }}-webapp
labels:
{{- include "trigger-v4.labels" . | nindent 4 }}
{{- $component := "webapp" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
annotations:
{{- include "trigger-v4.ingress.annotations" . | nindent 4 }}
{{- include "trigger-v4.webapp.ingress.annotations" . | nindent 4 }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- if .Values.webapp.ingress.className }}
ingressClassName: {{ .Values.webapp.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
{{- if .Values.webapp.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
{{- range .Values.webapp.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
Expand All @@ -24,7 +25,7 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- range .Values.webapp.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
Expand Down
8 changes: 4 additions & 4 deletions hosting/k8s/helm/templates/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ spec:
{{- toYaml .Values.webapp.resources | nindent 12 }}
env:
- name: APP_ORIGIN
value: {{ .Values.config.appOrigin | quote }}
value: {{ .Values.webapp.appOrigin | quote }}
- name: LOGIN_ORIGIN
value: {{ .Values.config.loginOrigin | quote }}
value: {{ .Values.webapp.loginOrigin | quote }}
- name: API_ORIGIN
value: {{ .Values.config.apiOrigin | quote }}
value: {{ .Values.webapp.apiOrigin | quote }}
- name: ELECTRIC_ORIGIN
value: {{ include "trigger-v4.electric.url" . | quote }}
- name: DATABASE_URL
Expand All @@ -194,7 +194,7 @@ spec:
- name: APP_LOG_LEVEL
value: {{ .Values.webapp.logLevel | quote }}
- name: DEV_OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ .Values.config.appOrigin }}/otel"
value: "{{ .Values.webapp.appOrigin }}/otel"
- name: DEPLOY_REGISTRY_HOST
value: {{ include "trigger-v4.registry.host" . | quote }}
- name: DEPLOY_REGISTRY_NAMESPACE
Expand Down
Loading