enabled -> deploy

This commit is contained in:
nicktrn
2025-06-27 17:38:15 +01:00
parent 728c7ab3de
commit 89f3956cca
25 changed files with 271 additions and 801 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
values-*.yaml
!values-production-example.yaml
*.tgz
*.tgz
/charts
+2 -2
View File
@@ -11,5 +11,5 @@ dependencies:
- name: minio
repository: oci://registry-1.docker.io/bitnamicharts
version: 17.0.9
digest: sha256:5b89e6afafb1387f83282c3469e3b6403b4eb1118246e08799839c529e4ae8c7
generated: "2025-06-27T11:25:34.615756375+01:00"
digest: sha256:681c9b5ed742a35fac108d40c32dab069320b1c22f0681c6ce354c0898274e22
generated: "2025-06-27T14:01:55.514480271+01:00"
+4 -4
View File
@@ -20,17 +20,17 @@ dependencies:
- name: postgresql
version: "16.7.14"
repository: "oci://registry-1.docker.io/bitnamicharts"
condition: postgres.enabled
condition: postgres.deploy
alias: postgres
- name: redis
version: "21.2.6"
repository: "oci://registry-1.docker.io/bitnamicharts"
condition: redis.enabled
condition: redis.deploy
- name: clickhouse
version: "9.3.7"
repository: "oci://registry-1.docker.io/bitnamicharts"
condition: clickhouse.enabled
condition: clickhouse.deploy
- name: minio
version: "17.0.9"
repository: "oci://registry-1.docker.io/bitnamicharts"
condition: minio.enabled
condition: minio.deploy
+16 -3
View File
@@ -4,6 +4,19 @@ This Helm chart deploys Trigger.dev v4 self-hosting stack to Kubernetes.
## Quick Start
### Prerequisites
```bash
# Build Helm dependencies (required for Bitnami charts)
helm dependency build
# Extract dependency charts for local template testing
for file in ./charts/*.tgz; do echo "Extracting $file"; tar -xzf "$file" -C ./charts; done
# Alternative: Use --dependency-update flag for template testing
helm template trigger . --dependency-update
```
### Installation
```bash
@@ -122,7 +135,7 @@ Use external managed services instead of bundled components:
postgres:
enabled: false
external: true
externalConnection:
external:
host: "your-postgres.rds.amazonaws.com"
port: 5432
database: "trigger"
@@ -133,7 +146,7 @@ postgres:
redis:
enabled: false
external: true
externalConnection:
external:
host: "your-redis.cache.amazonaws.com"
port: 6379
password: "your-password"
@@ -142,7 +155,7 @@ redis:
registry:
enabled: true
external: true
externalConnection:
external:
host: "localhost"
port: 5001
username: ""
+28 -14
View File
@@ -58,25 +58,39 @@ Bootstrap Mode is enabled:
{{- end }}
Configuration:
{{- if .Values.postgres.external }}
- Using external PostgreSQL at {{ .Values.postgres.externalConnection.host }}:{{ .Values.postgres.externalConnection.port }}
{{- else }}
{{- if .Values.postgres.deploy }}
- Using internal PostgreSQL
{{- end }}
{{- if .Values.redis.external }}
- Using external Redis at {{ .Values.redis.externalConnection.host }}:{{ .Values.redis.externalConnection.port }}
{{- else }}
- Using external PostgreSQL at {{ .Values.postgres.external.host }}:{{ .Values.postgres.external.port | default 5432 }}
{{- end }}
{{- if .Values.redis.deploy }}
- Using internal Redis
{{- else }}
- Using external Redis at {{ .Values.redis.external.host }}:{{ .Values.redis.external.port | default 6379 }}
{{- end }}
{{- if .Values.electric.enabled }}
- Electric sync service enabled
{{- if .Values.electric.deploy }}
- Using internal Electric sync service
{{- else }}
- Using external Electric sync service at {{ .Values.electric.external.url }}
{{- end }}
{{- if .Values.clickhouse.enabled }}
- ClickHouse analytics database enabled
{{- if .Values.clickhouse.deploy }}
- Using internal ClickHouse
{{- else }}
- Using external ClickHouse at {{ .Values.clickhouse.external.host }}:{{ .Values.clickhouse.external.httpPort | default 8123 }}
{{- end }}
{{- if .Values.minio.enabled }}
- MinIO object storage enabled
{{- if .Values.minio.deploy }}
- Using internal MinIO object storage
{{- else }}
- Using external MinIO object storage at {{ .Values.minio.external.endpoint }}
{{- end }}
{{- 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" }}
⚠️ Registry Warning:
Using localhost for registry. Deployments will only work when testing locally in kind or minikube.
Please ensure registry.external is properly configured to point at an external registry.
{{- end }}
{{- if .Values.registry.enabled }}
- Docker registry enabled
{{- end }}
+78 -35
View File
@@ -95,33 +95,51 @@ Get the full image name for supervisor
{{- end }}
{{- end }}
{{/*
PostgreSQL hostname
*/}}
{{- define "trigger-v4.postgres.hostname" -}}
{{- if .Values.postgres.host }}
{{- .Values.postgres.host }}
{{- else if .Values.postgres.deploy }}
{{- printf "%s-postgres" .Release.Name }}
{{- end }}
{{- end }}
{{/*
PostgreSQL connection string
*/}}
{{- define "trigger-v4.postgres.connectionString" -}}
{{- if .Values.postgres.external -}}
postgresql://{{ .Values.postgres.externalConnection.username }}:{{ .Values.postgres.externalConnection.password }}@{{ .Values.postgres.externalConnection.host }}:{{ .Values.postgres.externalConnection.port }}/{{ .Values.postgres.externalConnection.database }}?schema={{ .Values.postgres.externalConnection.schema | default "public" }}&sslmode={{ .Values.postgres.externalConnection.sslMode | default "prefer" }}
{{- else -}}
postgresql://{{ .Values.postgres.auth.username }}:{{ .Values.postgres.auth.password }}@{{ include "trigger-v4.fullname" . }}-postgres:{{ .Values.postgres.primary.service.ports.postgres }}/{{ .Values.postgres.auth.database }}?schema={{ .Values.postgres.connection.schema | default "public" }}&sslmode={{ .Values.postgres.connection.sslMode | default "prefer" }}
{{- if .Values.postgres.host -}}
postgresql://{{ .Values.postgres.username }}:{{ .Values.postgres.password }}@{{ .Values.postgres.host }}:{{ .Values.postgres.port | default 5432 }}/{{ .Values.postgres.database }}?schema={{ .Values.postgres.schema | default "public" }}&sslmode={{ .Values.postgres.sslMode | default "prefer" }}
{{- else if .Values.postgres.deploy -}}
postgresql://{{ .Values.postgres.auth.username }}:{{ .Values.postgres.auth.password }}@{{ include "trigger-v4.postgres.hostname" . }}:5432/{{ .Values.postgres.auth.database }}?schema={{ .Values.postgres.connection.schema | default "public" }}&sslmode={{ .Values.postgres.connection.sslMode | default "prefer" }}
{{- end -}}
{{- end }}
{{/*
Redis hostname
*/}}
{{- define "trigger-v4.redis.hostname" -}}
{{- if .Values.redis.host }}
{{- .Values.redis.host }}
{{- else if .Values.redis.deploy }}
{{- printf "%s-redis-master" .Release.Name }}
{{- end }}
{{- end }}
{{/*
Redis connection details
*/}}
{{- define "trigger-v4.redis.host" -}}
{{- if .Values.redis.external -}}
{{ .Values.redis.externalConnection.host }}
{{- else -}}
{{ include "trigger-v4.fullname" . }}-redis-master
{{- end -}}
{{- include "trigger-v4.redis.hostname" . }}
{{- end }}
{{- define "trigger-v4.redis.port" -}}
{{- if .Values.redis.external -}}
{{ .Values.redis.externalConnection.port }}
{{- else -}}
{{ .Values.redis.master.service.ports.redis }}
{{- if .Values.redis.host -}}
{{ .Values.redis.port | default 6379 }}
{{- else if .Values.redis.deploy -}}
6379
{{- end -}}
{{- end }}
@@ -129,24 +147,51 @@ Redis connection details
Electric service URL
*/}}
{{- define "trigger-v4.electric.url" -}}
{{- if .Values.electric.enabled -}}
{{- if .Values.electric.deploy -}}
http://{{ include "trigger-v4.fullname" . }}-electric:{{ .Values.electric.service.port }}
{{- else -}}
{{ .Values.config.electricOrigin }}
{{ .Values.electric.external.url }}
{{- end -}}
{{- end }}
{{/*
ClickHouse hostname
*/}}
{{- define "trigger-v4.clickhouse.hostname" -}}
{{- if .Values.clickhouse.host }}
{{- .Values.clickhouse.host }}
{{- else if .Values.clickhouse.deploy }}
{{- printf "%s-clickhouse" .Release.Name }}
{{- end }}
{{- end }}
{{/*
ClickHouse URL
*/}}
{{- define "trigger-v4.clickhouse.url" -}}
{{- if .Values.clickhouse.host -}}
http://{{ .Values.clickhouse.username }}:{{ .Values.clickhouse.password }}@{{ .Values.clickhouse.host }}:{{ .Values.clickhouse.httpPort | default 8123 }}
{{- else if .Values.clickhouse.deploy -}}
http://{{ .Values.clickhouse.auth.username }}:{{ .Values.clickhouse.auth.password }}@{{ include "trigger-v4.clickhouse.hostname" . }}:8123
{{- end -}}
{{- end }}
{{/*
MinIO hostname
*/}}
{{- define "trigger-v4.minio.hostname" -}}
{{- if .Values.minio.endpoint }}
{{- .Values.minio.endpoint }}
{{- else if .Values.minio.deploy }}
{{- printf "http://%s-minio:9000" .Release.Name }}
{{- end }}
{{- end }}
{{/*
MinIO connection details
*/}}
{{- define "trigger-v4.minio.url" -}}
{{- if .Values.minio.enabled -}}
http://{{ include "trigger-v4.fullname" . }}-minio:{{ .Values.minio.service.ports.api }}
{{- else if .Values.minio.external -}}
{{ .Values.minio.externalConnection.url }}
{{- else -}}
""
{{- end -}}
{{- include "trigger-v4.minio.hostname" . }}
{{- end }}
{{/*
@@ -164,12 +209,10 @@ Get the secrets name - either existing secret or generated name
Registry connection details
*/}}
{{- define "trigger-v4.registry.host" -}}
{{- if .Values.registry.external -}}
{{ .Values.registry.externalConnection.host }}:{{ .Values.registry.externalConnection.port }}
{{- else if .Values.registry.enabled -}}
{{- if .Values.registry.deploy -}}
{{ include "trigger-v4.fullname" . }}-registry:{{ .Values.registry.service.port }}
{{- else -}}
localhost:5000
{{ .Values.registry.external.host }}:{{ .Values.registry.external.port }}
{{- end -}}
{{- end }}
@@ -177,10 +220,10 @@ localhost:5000
PostgreSQL host (for wait-for-it script)
*/}}
{{- define "trigger-v4.postgres.host" -}}
{{- if .Values.postgres.external -}}
{{ .Values.postgres.externalConnection.host }}:{{ .Values.postgres.externalConnection.port }}
{{- else -}}
{{ include "trigger-v4.fullname" . }}-postgres:{{ .Values.postgres.primary.service.ports.postgres }}
{{- if .Values.postgres.host -}}
{{ .Values.postgres.host }}:{{ .Values.postgres.port | default 5432 }}
{{- else if .Values.postgres.deploy -}}
{{ include "trigger-v4.postgres.hostname" . }}:5432
{{- end -}}
{{- end }}
@@ -217,17 +260,17 @@ Create the name of the supervisor cluster role to use
Generate docker config for image pull secret
*/}}
{{- define "trigger-v4.imagePullSecret" }}
{{- if and .Values.registry.enabled .Values.registry.auth.enabled }}
{{- if and .Values.registry.deploy .Values.registry.auth.enabled }}
{{- $registryHost := include "trigger-v4.registry.host" . }}
{{- $username := .Values.registry.auth.username }}
{{- $password := .Values.registry.auth.password }}
{{- $auth := printf "%s:%s" $username $password | b64enc }}
{{- $config := dict "auths" (dict $registryHost (dict "username" $username "password" $password "auth" $auth)) }}
{{- $config | toJson }}
{{- else if and .Values.registry.external .Values.registry.externalConnection.auth.enabled }}
{{- $registryHost := .Values.registry.externalConnection.host }}
{{- $username := .Values.registry.externalConnection.auth.username }}
{{- $password := .Values.registry.externalConnection.auth.password }}
{{- else if and (not .Values.registry.deploy) .Values.registry.external.auth.enabled }}
{{- $registryHost := .Values.registry.external.host }}
{{- $username := .Values.registry.external.auth.username }}
{{- $password := .Values.registry.external.auth.password }}
{{- $auth := printf "%s:%s" $username $password | b64enc }}
{{- $config := dict "auths" (dict $registryHost (dict "username" $username "password" $password "auth" $auth)) }}
{{- $config | toJson }}
-165
View File
@@ -1,165 +0,0 @@
{{- if and .Values.clickhouse.enabled (not .Values.clickhouse.external) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "trigger-v4.fullname" . }}-clickhouse
labels:
{{- $component := "clickhouse" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
replicas: 1
serviceName: {{ include "trigger-v4.fullname" . }}-clickhouse-headless
selector:
matchLabels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
template:
metadata:
{{- with .Values.clickhouse.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
spec:
{{- with .Values.clickhouse.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: clickhouse
{{- with .Values.clickhouse.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.clickhouse.image.registry }}/{{ .Values.clickhouse.image.repository }}:{{ .Values.clickhouse.image.tag }}"
imagePullPolicy: {{ .Values.clickhouse.image.pullPolicy }}
ports:
- name: native
containerPort: {{ .Values.clickhouse.service.ports.native }}
protocol: TCP
- name: http
containerPort: {{ .Values.clickhouse.service.ports.http }}
protocol: TCP
env:
- name: CLICKHOUSE_ADMIN_USER
value: {{ .Values.clickhouse.auth.adminUser | quote }}
- name: CLICKHOUSE_ADMIN_PASSWORD
value: {{ .Values.clickhouse.auth.adminPassword | quote }}
{{- with .Values.clickhouse.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
exec:
command:
- clickhouse-client
- --host
- localhost
- --port
- {{ .Values.clickhouse.service.ports.native | quote }}
- --user
- {{ .Values.clickhouse.auth.adminUser }}
- --password
- {{ .Values.clickhouse.auth.adminPassword }}
- --query
- "SELECT 1"
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 15
failureThreshold: 5
readinessProbe:
exec:
command:
- clickhouse-client
- --host
- localhost
- --port
- {{ .Values.clickhouse.service.ports.native | quote }}
- --user
- {{ .Values.clickhouse.auth.adminUser }}
- --password
- {{ .Values.clickhouse.auth.adminPassword }}
- --query
- "SELECT 1"
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 15
failureThreshold: 5
resources:
{{- toYaml .Values.clickhouse.resources | nindent 12 }}
volumeMounts:
- name: clickhouse-data
mountPath: /bitnami/clickhouse
- name: clickhouse-config
mountPath: /bitnami/clickhouse/etc/config.d/override.xml
subPath: override.xml
readOnly: true
volumes:
- name: clickhouse-config
configMap:
name: {{ include "trigger-v4.fullname" . }}-clickhouse-config
{{- if not .Values.clickhouse.persistence.enabled }}
- name: clickhouse-data
emptyDir: {}
{{- end }}
{{- if .Values.clickhouse.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: clickhouse-data
labels:
{{- $component := "clickhouse" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.clickhouse.persistence.size }}
{{- $storageClass := .Values.clickhouse.persistence.storageClass | default .Values.global.storageClass }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-clickhouse-headless
labels:
{{- $component := "clickhouse" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: native
port: {{ .Values.clickhouse.service.ports.native }}
targetPort: native
protocol: TCP
- name: http
port: {{ .Values.clickhouse.service.ports.http }}
targetPort: http
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-clickhouse
labels:
{{- $component := "clickhouse" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: {{ .Values.clickhouse.service.type }}
ports:
- name: native
port: {{ .Values.clickhouse.service.ports.native }}
targetPort: native
protocol: TCP
- name: http
port: {{ .Values.clickhouse.service.ports.http }}
targetPort: http
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
{{- end }}
-11
View File
@@ -1,11 +0,0 @@
{{- if and .Values.clickhouse.enabled (not .Values.clickhouse.external) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "trigger-v4.fullname" . }}-clickhouse-config
labels:
{{- include "trigger-v4.labels" . | nindent 4 }}
data:
override.xml: |
{{ .Values.clickhouse.config.override | indent 4 }}
{{- end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if .Values.electric.enabled }}
{{- if .Values.electric.deploy }}
apiVersion: apps/v1
kind: Deployment
metadata:
-143
View File
@@ -1,143 +0,0 @@
{{- if .Values.minio.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "trigger-v4.fullname" . }}-minio
labels:
{{- $component := "minio" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
replicas: 1
serviceName: {{ include "trigger-v4.fullname" . }}-minio-headless
selector:
matchLabels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
template:
metadata:
{{- with .Values.minio.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
spec:
{{- with .Values.minio.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: minio
{{- with .Values.minio.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.minio.image.registry }}/{{ .Values.minio.image.repository }}:{{ .Values.minio.image.tag }}"
imagePullPolicy: {{ .Values.minio.image.pullPolicy }}
args:
- server
- --console-address
- ":9001"
- /data
ports:
- name: api
containerPort: {{ .Values.minio.service.ports.api }}
protocol: TCP
- name: console
containerPort: {{ .Values.minio.service.ports.console }}
protocol: TCP
env:
- name: MINIO_ROOT_USER
value: {{ .Values.minio.auth.rootUser | quote }}
- name: MINIO_ROOT_PASSWORD
value: {{ .Values.minio.auth.rootPassword | quote }}
{{- with .Values.minio.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
httpGet:
path: /minio/health/live
port: api
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
failureThreshold: 5
readinessProbe:
httpGet:
path: /minio/health/live
port: api
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
failureThreshold: 5
resources:
{{- toYaml .Values.minio.resources | nindent 12 }}
volumeMounts:
- name: minio-data
mountPath: /data
{{- if not .Values.minio.persistence.enabled }}
volumes:
- name: minio-data
emptyDir: {}
{{- end }}
{{- if .Values.minio.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: minio-data
labels:
{{- $component := "minio" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.minio.persistence.size }}
{{- $storageClass := .Values.minio.persistence.storageClass | default .Values.global.storageClass }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-minio-headless
labels:
{{- $component := "minio" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: api
port: {{ .Values.minio.service.ports.api }}
targetPort: api
protocol: TCP
- name: console
port: {{ .Values.minio.service.ports.console }}
targetPort: console
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-minio
labels:
{{- $component := "minio" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: {{ .Values.minio.service.type }}
ports:
- name: api
port: {{ .Values.minio.service.ports.api }}
targetPort: api
protocol: TCP
- name: console
port: {{ .Values.minio.service.ports.console }}
targetPort: console
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
{{- end }}
-138
View File
@@ -1,138 +0,0 @@
{{- if and .Values.postgres.enabled (not .Values.postgres.external) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "trigger-v4.fullname" . }}-postgres
labels:
{{- $component := "postgres" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
replicas: 1
serviceName: {{ include "trigger-v4.fullname" . }}-postgres-headless
selector:
matchLabels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
template:
metadata:
{{- with .Values.postgres.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
spec:
{{- with .Values.postgres.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: postgres
{{- with .Values.postgres.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.postgres.image.registry }}/{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
ports:
- name: postgres
containerPort: {{ .Values.postgres.primary.service.ports.postgres }}
protocol: TCP
env:
- name: POSTGRES_USER
value: {{ .Values.postgres.auth.username | quote }}
- name: POSTGRES_PASSWORD
value: {{ .Values.postgres.auth.password | quote }}
- name: POSTGRES_DB
value: {{ .Values.postgres.auth.database | quote }}
{{- with .Values.postgres.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
args:
- "-c"
- "wal_level=logical"
{{- with .Values.postgres.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgres.auth.username }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readinessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgres.auth.username }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
resources:
{{- toYaml .Values.postgres.primary.resources | nindent 12 }}
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
{{- if .Values.postgres.primary.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: postgres-data
labels:
{{- $component := "postgres" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.postgres.primary.persistence.size }}
{{- $storageClass := .Values.postgres.primary.persistence.storageClass | default .Values.global.storageClass }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
{{- else }}
volumes:
- name: postgres-data
emptyDir: {}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-postgres-headless
labels:
{{- $component := "postgres" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: postgres
port: {{ .Values.postgres.primary.service.ports.postgres }}
targetPort: postgres
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-postgres
labels:
{{- $component := "postgres" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: postgres
port: {{ .Values.postgres.primary.service.ports.postgres }}
targetPort: postgres
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
{{- end }}
-125
View File
@@ -1,125 +0,0 @@
{{- if and .Values.redis.enabled (not .Values.redis.external) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "trigger-v4.fullname" . }}-redis-master
labels:
{{- $component := "redis" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
replicas: 1
serviceName: {{ include "trigger-v4.fullname" . }}-redis-headless
selector:
matchLabels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
template:
metadata:
{{- with .Values.redis.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
spec:
{{- with .Values.redis.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: redis
{{- with .Values.redis.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.redis.image.registry }}/{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
ports:
- name: redis
containerPort: {{ .Values.redis.master.service.ports.redis }}
protocol: TCP
{{- with .Values.redis.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
resources:
{{- toYaml .Values.redis.master.resources | nindent 12 }}
volumeMounts:
- name: redis-data
mountPath: /data
{{- if not .Values.redis.master.persistence.enabled }}
volumes:
- name: redis-data
emptyDir: {}
{{- end }}
{{- if .Values.redis.master.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: redis-data
labels:
{{- $component := "redis" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.redis.master.persistence.size }}
{{- $storageClass := .Values.redis.master.persistence.storageClass | default .Values.global.storageClass }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-redis-headless
labels:
{{- $component := "redis" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: redis
port: {{ .Values.redis.master.service.ports.redis }}
targetPort: redis
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "trigger-v4.fullname" . }}-redis-master
labels:
{{- $component := "redis" }}
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: redis
port: {{ .Values.redis.master.service.ports.redis }}
targetPort: redis
protocol: TCP
selector:
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
{{- end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if and .Values.registry.enabled (not .Values.registry.external) }}
{{- if .Values.registry.deploy }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
+2 -2
View File
@@ -15,7 +15,7 @@ data:
OBJECT_STORE_SECRET_ACCESS_KEY: {{ .Values.secrets.objectStore.secretAccessKey | b64enc | quote }}
{{- end }}
---
{{- if and .Values.registry.enabled .Values.registry.auth.enabled }}
{{- if and .Values.registry.deploy .Values.registry.auth.enabled }}
apiVersion: v1
kind: Secret
metadata:
@@ -35,7 +35,7 @@ metadata:
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ include "trigger-v4.imagePullSecret" . | b64enc }}
{{- else if and .Values.registry.external .Values.registry.externalConnection.auth.enabled }}
{{- else if and (not .Values.registry.deploy) .Values.registry.external.auth.enabled }}
apiVersion: v1
kind: Secret
metadata:
+8 -2
View File
@@ -1,4 +1,4 @@
{{- if .Values.supervisor.enabled }}
{{- if .Values.supervisor.deploy }}
{{- if .Values.supervisor.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@@ -147,7 +147,13 @@ spec:
value: {{ .Values.supervisor.config.kubernetes.forceEnabled | quote }}
- name: KUBERNETES_WORKER_NODETYPE_LABEL
value: {{ .Values.supervisor.config.kubernetes.workerNodetypeLabel | quote }}
{{- if or (and .Values.registry.enabled .Values.registry.auth.enabled) (and .Values.registry.external .Values.registry.externalConnection.auth.enabled) }}
{{- $registryAuthEnabled := false }}
{{- if .Values.registry.deploy }}
{{- $registryAuthEnabled = .Values.registry.auth.enabled }}
{{- else }}
{{- $registryAuthEnabled = .Values.registry.external.auth.enabled }}
{{- end }}
{{- if $registryAuthEnabled }}
- name: KUBERNETES_IMAGE_PULL_SECRETS
value: "{{ include "trigger-v4.fullname" . }}-registry-secret"
{{- end }}
@@ -1,4 +1,4 @@
{{- if and .Values.clickhouse.enabled (not .Values.clickhouse.external) }}
{{- if .Values.clickhouse.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -1,4 +1,4 @@
{{- if .Values.electric.enabled }}
{{- if .Values.electric.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -1,4 +1,4 @@
{{- if .Values.minio.enabled }}
{{- if .Values.minio.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -1,4 +1,4 @@
{{- if and .Values.postgres.enabled (not .Values.postgres.external) }}
{{- if .Values.postgres.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -1,4 +1,4 @@
{{- if and .Values.redis.enabled (not .Values.redis.external) }}
{{- if .Values.redis.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -1,4 +1,4 @@
{{- if .Values.supervisor.enabled }}
{{- if .Values.supervisor.deploy }}
apiVersion: v1
kind: Pod
metadata:
@@ -0,0 +1,56 @@
{{/*
Validation template to ensure external service configurations are provided when deploy: false
This template will fail the Helm deployment if external config is missing for required services
*/}}
{{- if not .Values.postgres.deploy }}
{{- if or (not .Values.postgres.external.host) (not .Values.postgres.external.database) (not .Values.postgres.external.username) }}
{{- fail "PostgreSQL external configuration is required when postgres.deploy=false. Please provide postgres.external.host, postgres.external.database, and postgres.external.username" }}
{{- end }}
{{- end }}
{{- if not .Values.redis.deploy }}
{{- if not .Values.redis.external.host }}
{{- fail "Redis external configuration is required when redis.deploy=false. Please provide redis.external.host" }}
{{- end }}
{{- end }}
{{- if not .Values.clickhouse.deploy }}
{{- if or (not .Values.clickhouse.external.host) (not .Values.clickhouse.external.username) }}
{{- fail "ClickHouse external configuration is required when clickhouse.deploy=false. Please provide clickhouse.external.host and clickhouse.external.username" }}
{{- end }}
{{- end }}
{{- if not .Values.minio.deploy }}
{{- if or (not .Values.minio.external.endpoint) (not .Values.minio.external.accessKeyId) }}
{{- fail "MinIO external configuration is required when minio.deploy=false. Please provide minio.external.endpoint and minio.external.accessKeyId" }}
{{- end }}
{{- end }}
{{- if not .Values.electric.deploy }}
{{- if not .Values.electric.external.url }}
{{- fail "Electric external configuration is required when electric.deploy=false. Please provide electric.external.url" }}
{{- end }}
{{- 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" }}
{{- end }}
{{- end }}
{{/*
This template produces no output but will fail the deployment if validation fails
*/}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "trigger-v4.fullname" . }}-external-config-validation
labels:
{{- include "trigger-v4.labels" . | nindent 4 }}
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-weight: "-10"
helm.sh/hook-delete-policy: before-hook-creation
data:
validation: "completed"
+2 -6
View File
@@ -198,20 +198,16 @@ spec:
- name: INTERNAL_OTEL_METRIC_EXPORTER_INTERVAL_MS
value: {{ .Values.webapp.observability.metrics.exporterIntervalMs | quote }}
{{- end }}
{{- if .Values.webapp.clickhouse.enabled }}
- name: CLICKHOUSE_URL
value: {{ if .Values.clickhouse.external }}{{ .Values.clickhouse.externalConnection.httpUrl | quote }}{{ else }}"http://{{ .Values.clickhouse.auth.adminUser }}:{{ .Values.clickhouse.auth.adminPassword }}@{{ include "trigger-v4.fullname" . }}-clickhouse:{{ .Values.clickhouse.service.ports.http }}"{{ end }}
value: {{ include "trigger-v4.clickhouse.url" . | quote }}
- name: CLICKHOUSE_LOG_LEVEL
value: {{ .Values.webapp.clickhouse.logLevel | quote }}
{{- end }}
{{- if .Values.webapp.runReplication.enabled }}
- name: RUN_REPLICATION_ENABLED
value: "1"
- name: RUN_REPLICATION_CLICKHOUSE_URL
value: {{ if .Values.clickhouse.external }}{{ .Values.clickhouse.externalConnection.httpUrl | quote }}{{ else }}"http://{{ .Values.clickhouse.auth.adminUser }}:{{ .Values.clickhouse.auth.adminPassword }}@{{ include "trigger-v4.fullname" . }}-clickhouse:{{ .Values.clickhouse.service.ports.http }}"{{ end }}
value: {{ include "trigger-v4.clickhouse.url" . | quote }}
- name: RUN_REPLICATION_LOG_LEVEL
value: {{ .Values.webapp.runReplication.logLevel | quote }}
{{- end }}
{{- if not .Values.telemetry.enabled }}
- name: TRIGGER_TELEMETRY_DISABLED
value: "1"
@@ -125,7 +125,7 @@ supervisor:
# postgres:
# enabled: false
# external: true
# externalConnection:
# external:
# host: "your-postgres-host.rds.amazonaws.com"
# port: 5432
# database: "trigger"
@@ -138,7 +138,7 @@ supervisor:
# redis:
# enabled: false
# external: true
# externalConnection:
# external:
# host: "your-redis-cluster.cache.amazonaws.com"
# port: 6379
# password: "your-redis-password"
+63 -140
View File
@@ -11,7 +11,6 @@ config:
appOrigin: "http://localhost:3040"
loginOrigin: "http://localhost:3040"
apiOrigin: "http://localhost:3040"
electricOrigin: "http://electric:3000"
# Secrets configuration
# IMPORTANT: The default values below are for TESTING ONLY and should NOT be used in production
@@ -125,16 +124,9 @@ webapp:
labels: {}
basicAuth: {}
# ClickHouse integration (experimental)
# Usage patterns:
# 1. Internal ClickHouse: Set clickhouse.enabled=true, clickhouse.external=false, webapp.clickhouse.enabled=true
# 2. External ClickHouse: Set clickhouse.enabled=true, clickhouse.external=true, configure externalConnection URLs, webapp.clickhouse.enabled=true
# 3. No ClickHouse: Leave webapp.clickhouse.enabled=false (default)
clickhouse:
enabled: true
logLevel: "info" # one of: log, error, warn, info, debug
runReplication:
enabled: true
logLevel: "info" # one of: log, error, warn, info, debug
# Observability configuration (OTel)
@@ -157,7 +149,6 @@ webapp:
# Supervisor configuration
supervisor:
enabled: true
image:
registry: ghcr.io
repository: triggerdotdev/supervisor
@@ -257,107 +248,64 @@ supervisor:
# PostgreSQL configuration
postgres:
enabled: true
external: false
image:
registry: docker.io
repository: postgres
tag: "14"
pullPolicy: IfNotPresent
deploy: true
# Bitnami PostgreSQL chart configuration (when deploy: true)
auth:
enablePostgresUser: true
postgresPassword: "postgres"
username: "postgres"
password: "postgres"
database: "main"
connection:
schema: "public"
sslMode: "disable" # Use "require" or "verify-full" for production
podAnnotations: {}
# podSecurityContext:
# fsGroup: 1000
# securityContext:
# runAsNonRoot: true
# runAsUser: 1000
primary:
persistence:
enabled: true
size: 10Gi
service:
ports:
postgres: 5432
resources: {}
configuration: |
listen_addresses = '*'
wal_level = logical
# External PostgreSQL connection (when external: true)
externalConnection:
# Custom connection settings
connection:
schema: "public"
sslMode: "disable" # Use "require" or "verify-full" for production
# External PostgreSQL connection (when deploy: false)
external:
host: ""
port: 5432
database: ""
username: ""
password: ""
# Connection options
schema: "public"
sslMode: "require" # Options: disable, allow, prefer, require, verify-ca, verify-full
# Extra environment variables for PostgreSQL
extraEnv:
[]
# - name: CUSTOM_VAR
# value: "custom-value"
# Extra command line arguments for PostgreSQL
extraArgs:
[]
# - "-c"
# - "log_statement=all"
# - "-c"
# - "max_slot_wal_keep_size=1000000000"
# Redis configuration
redis:
enabled: true
external: false
image:
registry: docker.io
repository: redis
tag: "7"
pullPolicy: IfNotPresent
deploy: true
# Bitnami Redis chart configuration (when deploy: true)
auth:
enabled: false
podAnnotations: {}
# podSecurityContext:
# fsGroup: 1000
# securityContext:
# runAsNonRoot: true
# runAsUser: 1000
# Single-node configuration (disable replica)
architecture: standalone
master:
persistence:
enabled: true
size: 5Gi
service:
ports:
redis: 6379
resources: {}
# External Redis connection (when external: true)
externalConnection:
# External Redis connection (when deploy: false)
external:
host: ""
port: 6379
password: ""
# Extra environment variables for Redis
extraEnv:
[]
# - name: CUSTOM_VAR
# value: "custom-value"
# Electric configuration
electric:
enabled: true
deploy: true
image:
registry: docker.io
repository: electricsql/electric
@@ -381,6 +329,11 @@ electric:
port: 3000
targetPort: 3000
resources: {}
# External Electric connection (when deploy: false)
external:
url: "" # For example: "http://electric:3000"
# Extra environment variables for Electric
extraEnv:
[]
@@ -389,51 +342,38 @@ electric:
# ClickHouse configuration
clickhouse:
enabled: true
external: false
image:
registry: docker.io
repository: bitnami/clickhouse
tag: "latest"
pullPolicy: IfNotPresent
deploy: true
# Bitnami ClickHouse chart configuration (when deploy: true)
auth:
adminUser: "default"
adminPassword: "password"
username: "default"
password: "password"
podAnnotations: {}
# Single-node configuration (disable clustering for dev/test)
keeper:
enabled: false
# podSecurityContext:
# fsGroup: 1000
# securityContext:
# runAsNonRoot: true
# runAsUser: 1000
shards: 1
replicaCount: 1
persistence:
enabled: true
size: 10Gi
service:
type: ClusterIP
ports:
native: 9000
http: 8123
resources: {}
# External ClickHouse connection (when external: true)
externalConnection:
# HTTP interface URL (port 8123) - used by webapp for replication
httpUrl: ""
# Extra environment variables for ClickHouse
extraEnv:
[]
# - name: CUSTOM_VAR
# value: "custom-value"
# External ClickHouse connection (when deploy: false)
external:
host: ""
httpPort: 8123
nativePort: 9000
username: ""
password: ""
# ClickHouse configuration override
# You can provide your own override.xml content here
# These defaults are based on official recommendations for systems with <16GB RAM:
# https://clickhouse.com/docs/operations/tips
config:
override: |
configdFiles:
override.xml: |
<clickhouse>
<logger>
<level>warning</level>
@@ -453,13 +393,9 @@ clickhouse:
# MinIO configuration
minio:
enabled: true
external: false # Set to true to use external S3-compatible storage
image:
registry: docker.io
repository: minio/minio
tag: "latest"
pullPolicy: IfNotPresent
deploy: true # Set to false to use external S3-compatible storage
# Bitnami MinIO chart configuration (when deploy: true)
# WARNING: This sets the root user and password on first startup and MUST be changed via the dashboard.
# - Don't forget to update secrets.objectStore if you intend to use the root credentials.
# - You should instead create a new non-root user and update the secrets.objectStore with the new credentials.
@@ -467,37 +403,22 @@ minio:
rootUser: "admin"
rootPassword: "very-safe-password"
podAnnotations: {}
# podSecurityContext:
# fsGroup: 1000
# securityContext:
# runAsNonRoot: true
# runAsUser: 1000
persistence:
enabled: true
size: 10Gi
service:
type: ClusterIP
ports:
api: 9000
console: 9001
resources: {}
# External MinIO/S3 connection (when external: true)
externalConnection:
url: "" # e.g., "https://s3.amazonaws.com" or "https://your-minio.com:9000"
# Extra environment variables for MinIO
extraEnv:
[]
# - name: CUSTOM_VAR
# value: "custom-value"
# External MinIO/S3 connection (when deploy: false)
external:
endpoint: "" # e.g., "https://s3.amazonaws.com" or "https://your-minio.com:9000"
accessKeyId: ""
secretAccessKey: ""
# Docker Registry configuration
registry:
enabled: false # EXPERIMENTAL - requires proper TLS setup. Use external: true instead.
external: true
# EXPERIMENTAL - requires TLS setup or additional cluster configuration. Configure `external` details instead.
deploy: false
repositoryNamespace: "trigger" # Docker repository namespace for deployed images, will be part of the image ref
image:
registry: docker.io
@@ -526,14 +447,16 @@ registry:
port: 5000
targetPort: 5000
resources: {}
# External Registry connection (when external: true)
externalConnection:
# External Registry connection (when deploy: false)
external:
host: "localhost"
port: 5001
auth:
enabled: false
username: ""
password: ""
# Extra environment variables for Registry
extraEnv:
[]