Skip to content

Commit 3aa9aa6

Browse files
carderneTrigger.dev RepoOps
authored andcommitted
chore(helm): replace Electric with native realtime
Use native realtime for Helm installations and stop deploying the unavailable Electric image. Remove Electric configuration and health checks, and enable the native backend through webapp environment variables. No webapp code changes. Existing realtimeBackend feature-flag overrides must be unset or set to native before upgrading. Mono-RevId: 6a97739883323107714d76d02bffafac5c658b77
1 parent 9499bd2 commit 3aa9aa6

10 files changed

Lines changed: 23 additions & 250 deletions

File tree

‎docs/self-hosting/env/webapp.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ mode: "wide"
156156
| `EVENT_REPOSITORY_DEFAULT_STORE` | No | postgres | Where to store task events. Set to `clickhouse_v2` to store in ClickHouse (recommended for production). |
157157
| `EVENT_REPOSITORY_POSTGRES_WRITES_DISABLED` | No | 0 | Skip all PostgreSQL task-event writes (set to `1`). Only enable when `EVENT_REPOSITORY_DEFAULT_STORE` is `clickhouse_v2`, otherwise task events are lost. |
158158
| **Realtime** | | | |
159+
| `REALTIME_BACKEND_NATIVE_ENABLED` | No | 0 | Set to `1` to enable native realtime run subscriptions and change notifications. When `0`, subscriptions use Electric. The Helm chart sets this to `1`. |
160+
| `REALTIME_BACKEND_DEFAULT` | No | electric | Backend for run subscriptions when native realtime is enabled and no `realtimeBackend` feature-flag override is set. One of `electric`, `native`, `shadow`. The Helm chart sets this to `native`. Separate from realtime stream version settings. |
159161
| `REALTIME_STREAM_VERSION` | No | v1 | Stream version exposed to tasks via the `TRIGGER_REALTIME_STREAM_VERSION` variable. Distinct from `REALTIME_STREAMS_DEFAULT_VERSION`. One of `v1`, `v2`. |
160162
| `REALTIME_STREAM_MAX_LENGTH` | No | 1000 | Realtime stream max length. |
161163
| `REALTIME_STREAM_TTL` | No | 86400 (1d) | Realtime stream TTL (s). |

‎docs/self-hosting/kubernetes.mdx‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ flowchart TD
3535
workers --> reg
3636
```
3737

38-
Each component maps to a top-level key in `values.yaml`: `webapp`, `supervisor`, `postgres`, `redis`, `electric`, `clickhouse`, `s3` (object storage), `s2`, and `registry`. The datastores default to `deploy: true` and run in-cluster; set `deploy: false` with an `external` block to bring your own. The registry is the exception - it defaults to `deploy: false`, so you point it at an external one. Webapp settings live under `webapp`, supervisor settings under `supervisor.config`, and each service takes `extraEnvVars` for anything else.
38+
Each component maps to a top-level key in `values.yaml`: `webapp`, `supervisor`, `postgres`, `redis`, `clickhouse`, `s3` (object storage), `s2`, and `registry`. The datastores default to `deploy: true` and run in-cluster; set `deploy: false` with an `external` block to bring your own. The registry is the exception - it defaults to `deploy: false`, so you point it at an external one. Webapp settings live under `webapp`, supervisor settings under `supervisor.config`, and each service takes `extraEnvVars` for anything else.
39+
40+
Realtime run subscriptions use the native backend with the configured PostgreSQL, Redis, and ClickHouse services. The chart sets `REALTIME_BACKEND_NATIVE_ENABLED=1` and `REALTIME_BACKEND_DEFAULT=native`; no Electric service is required. These settings are separate from the S2-backed realtime streams configuration.
41+
42+
<Warning>
43+
Before upgrading from a chart that deploys Electric, unset the global `realtimeBackend` feature flag and any organization overrides, or set them to `native`. Both take precedence over the environment default. Values of `electric` or `shadow` still select the Electric backend, which this chart no longer deploys.
44+
</Warning>
3945

4046
## Requirements
4147

@@ -91,7 +97,7 @@ Bundled datastores let you run the whole stack with a single command and no exte
9197
--create-namespace
9298
```
9399

94-
The chart deploys the webapp, supervisor, and bundled Postgres, Redis, Electric, ClickHouse, MinIO, and s2-lite. The registry is not deployed by default - configure an external one before deploying tasks.
100+
The chart deploys the webapp, supervisor, and bundled Postgres, Redis, ClickHouse, MinIO, and s2-lite. The registry is not deployed by default - configure an external one before deploying tasks.
95101
</Step>
96102

97103
<Step title="Port-forward the webapp">
@@ -533,9 +539,14 @@ With external datastores, secrets, registry, and authentication in place, you ha
533539

534540
### Upgrading
535541

536-
`helm upgrade` is safe to run as-is. Your generated secrets, data volumes, and the bundled ClickHouse are preserved and migrated automatically, so a normal upgrade needs no preparation. A few situations need one manual step first — expand any that apply to you.
542+
Your generated secrets, data volumes, and the bundled ClickHouse are preserved and migrated automatically. Before running `helm upgrade`, complete any prerequisites below that apply to your installation.
537543

538544
<AccordionGroup>
545+
<Accordion title="You upgrade from a chart that deploys Electric">
546+
Unset the global `realtimeBackend` feature flag and any organization overrides, or set them to `native`, before upgrading. Organization overrides take precedence over the global flag, and the global flag takes precedence over `REALTIME_BACKEND_DEFAULT`.
547+
548+
The chart enables native realtime and removes the Electric service. A remaining `electric` or `shadow` flag value directs run subscriptions to that removed service and breaks realtime updates.
549+
</Accordion>
539550
<Accordion title="You supply your own secret (secrets.existingSecret)">
540551
With `secrets.existingSecret` set, the chart reads every key from your Secret and generates none, so any key the app needs must already be present there.
541552

‎hosting/k8s/helm/README.md‎

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ This chart deploys the following components:
107107
- **Webapp** - Main Trigger.dev application (port 3030)
108108
- **PostgreSQL** - Primary database with logical replication
109109
- **Redis** - Cache and job queue
110-
- **Electric** - Real-time sync service (ElectricSQL)
111110
112111
### Worker Services
113112
- **Supervisor** - Kubernetes worker orchestrator for executing runs
@@ -119,6 +118,8 @@ This chart deploys the following components:
119118
120119
## Configuration
121120
121+
Realtime run subscriptions use the native backend with the configured Redis, PostgreSQL, and ClickHouse services. Before upgrading, unset the global `realtimeBackend` feature flag and any organization overrides, or set them to `native`. Organization overrides take precedence over the global flag, which takes precedence over the environment default. Values of `electric` or `shadow` select the removed Electric service and break run subscriptions.
122+
122123
### Basic Configuration
123124

124125
```yaml
@@ -400,30 +401,6 @@ supervisor:
400401
failureThreshold: 60
401402
successThreshold: 1
402403
403-
# Electric health probes
404-
electric:
405-
livenessProbe:
406-
enabled: true
407-
initialDelaySeconds: 5
408-
periodSeconds: 5
409-
timeoutSeconds: 5
410-
failureThreshold: 5
411-
successThreshold: 1
412-
readinessProbe:
413-
enabled: true
414-
initialDelaySeconds: 5
415-
periodSeconds: 5
416-
timeoutSeconds: 1
417-
failureThreshold: 5
418-
successThreshold: 1
419-
startupProbe:
420-
enabled: false
421-
initialDelaySeconds: 0
422-
periodSeconds: 10
423-
timeoutSeconds: 5
424-
failureThreshold: 60
425-
successThreshold: 1
426-
427404
# Registry health probes
428405
registry:
429406
livenessProbe:
@@ -560,7 +537,7 @@ The Helm chart uses three types of versions:
560537

561538
1. **Chart Version** (`Chart.yaml:version`) - Helm chart packaging version
562539
2. **App Version** (`Chart.yaml:appVersion`) - Trigger.dev application version
563-
3. **Component Versions** (`values.yaml`) - Individual service versions (Electric, ClickHouse, etc.)
540+
3. **Component Versions** (`values.yaml`) - Individual service versions (ClickHouse, etc.)
564541

565542
### Release Process
566543

‎hosting/k8s/helm/templates/NOTES.txt‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ Configuration:
5858
{{- else }}
5959
- Using external Redis at {{ .Values.redis.external.host }}:{{ .Values.redis.external.port | default 6379 }}
6060
{{- end }}
61-
{{- if .Values.electric.deploy }}
62-
- Using internal Electric sync service
63-
{{- else }}
64-
- Using external Electric sync service at {{ .Values.electric.external.url }}
65-
{{- end }}
6661
{{- if .Values.clickhouse.deploy }}
6762
- Using internal ClickHouse
6863
{{- else }}

‎hosting/k8s/helm/templates/_helpers.tpl‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -376,17 +376,6 @@ S3 auth effective secret access key (with fallback to rootPassword)
376376
{{- end -}}
377377
{{- end }}
378378

379-
{{/*
380-
Electric service URL
381-
*/}}
382-
{{- define "trigger-v4.electric.url" -}}
383-
{{- if .Values.electric.deploy -}}
384-
http://{{ include "trigger-v4.fullname" . }}-electric:{{ .Values.electric.service.port }}
385-
{{- else -}}
386-
{{ .Values.electric.external.url }}
387-
{{- end -}}
388-
{{- end }}
389-
390379
{{/*
391380
Whether realtime streams v2 (S2) is wired up: either the bundled s2-lite is
392381
deployed, or an external S2 endpoint has been configured.

‎hosting/k8s/helm/templates/electric.yaml‎

Lines changed: 0 additions & 116 deletions
This file was deleted.

‎hosting/k8s/helm/templates/tests/test-electric.yaml‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ This template will fail the Helm deployment if external config is missing for re
3232
{{- end }}
3333
{{/* When s3.deploy=true the MinIO root password is auto-generated into the datastore Secret and consumed via auth.existingSecret; set s3.auth.rootPassword to pin it. */}}
3434

35-
{{- if not .Values.electric.deploy }}
36-
{{- if not .Values.electric.external.url }}
37-
{{- fail "Electric external configuration is required when electric.deploy=false. Please provide electric.external.url" }}
38-
{{- end }}
39-
{{- end }}
40-
4135
{{- if and .Values.s2.deploy .Values.s2.external.endpoint }}
4236
{{- fail "S2 configuration conflict: s2.external.endpoint is set but s2.deploy=true, so the external endpoint would be ignored. Set s2.deploy=false to use an external S2 endpoint, or clear s2.external.endpoint to use the bundled s2-lite." }}
4337
{{- end }}

‎hosting/k8s/helm/templates/webapp.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ spec:
186186
value: {{ .Values.webapp.loginOrigin | quote }}
187187
- name: API_ORIGIN
188188
value: {{ .Values.webapp.apiOrigin | quote }}
189-
- name: ELECTRIC_ORIGIN
190-
value: {{ include "trigger-v4.electric.url" . | quote }}
189+
- name: REALTIME_BACKEND_NATIVE_ENABLED
190+
value: "1"
191+
- name: REALTIME_BACKEND_DEFAULT
192+
value: "native"
191193
{{- if include "trigger-v4.s2.enabled" . }}
192194
# Realtime streams v2, backed by S2 (bundled s2-lite or an external endpoint)
193195
- name: REALTIME_STREAMS_DEFAULT_VERSION

‎hosting/k8s/helm/values.yaml‎

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -507,66 +507,6 @@ redis:
507507
existingSecret: "" # Name of existing secret containing password
508508
existingSecretPasswordKey: "redis-password" # Key in existing secret containing password
509509

510-
# Electric configuration
511-
electric:
512-
deploy: true
513-
image:
514-
registry: docker.io
515-
repository: electricsql/electric
516-
tag: "1.2.4"
517-
pullPolicy: IfNotPresent
518-
config:
519-
insecure: true
520-
usageReporting: false
521-
522-
podAnnotations: {}
523-
524-
# podSecurityContext:
525-
# fsGroup: 1000
526-
527-
# securityContext:
528-
# runAsNonRoot: true
529-
# runAsUser: 1000
530-
531-
service:
532-
type: ClusterIP
533-
port: 3000
534-
targetPort: 3000
535-
resources: {}
536-
537-
# Health probe configuration
538-
livenessProbe:
539-
enabled: true
540-
initialDelaySeconds: 10
541-
periodSeconds: 10
542-
timeoutSeconds: 5
543-
failureThreshold: 5
544-
successThreshold: 1
545-
readinessProbe:
546-
enabled: true
547-
initialDelaySeconds: 10
548-
periodSeconds: 10
549-
timeoutSeconds: 5
550-
failureThreshold: 5
551-
successThreshold: 1
552-
startupProbe:
553-
enabled: false
554-
initialDelaySeconds: 0
555-
periodSeconds: 10
556-
timeoutSeconds: 5
557-
failureThreshold: 60
558-
successThreshold: 1
559-
560-
# External Electric connection (when deploy: false)
561-
external:
562-
url: "" # For example: "http://electric:3000"
563-
564-
# Extra environment variables for Electric
565-
extraEnvVars:
566-
[]
567-
# - name: CUSTOM_VAR
568-
# value: "custom-value"
569-
570510
# S2 (realtime streams v2)
571511
# s2-lite is the open-source, self-hostable S2 server (https://s2.dev). It backs
572512
# realtime streams v2, which power AI-agent token streaming and run streams. When

0 commit comments

Comments
 (0)