chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
Thank you for installing {{ .Chart.Name }}.
|
||||
|
||||
Your release is named {{ .Release.Name }}.
|
||||
|
||||
🔐 SECURITY WARNING:
|
||||
{{- if or (eq .Values.secrets.sessionSecret "2818143646516f6fffd707b36f334bbb") (eq .Values.secrets.magicLinkSecret "44da78b7bbb0dfe709cf38931d25dcdd") (eq .Values.secrets.encryptionKey "f686147ab967943ebbe9ed3b496e465a") (eq .Values.secrets.managedWorkerSecret "447c29678f9eaf289e9c4b70d3dd8a7f") }}
|
||||
You are using DEFAULT SECRETS which are NOT SECURE for production!
|
||||
|
||||
For production deployments, generate new secrets:
|
||||
1. Run: openssl rand -hex 16 (repeat for each secret)
|
||||
2. Override in your values.yaml:
|
||||
secrets:
|
||||
sessionSecret: "your-new-32-char-hex-secret"
|
||||
magicLinkSecret: "your-new-32-char-hex-secret"
|
||||
encryptionKey: "your-new-32-char-hex-secret"
|
||||
managedWorkerSecret: "your-new-32-char-hex-secret"
|
||||
{{- else }}
|
||||
Custom secrets detected - good for production deployment!
|
||||
{{- end }}
|
||||
|
||||
To get started:
|
||||
|
||||
1. Wait for all pods to be ready:
|
||||
kubectl get pods --namespace {{ .Release.Namespace }} -w
|
||||
|
||||
2. Access the webapp:
|
||||
{{- if .Values.webapp.ingress.enabled }}
|
||||
{{- range $host := .Values.webapp.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.webapp.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.webapp.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "trigger-v4.fullname" . }}-webapp)
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.webapp.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "trigger-v4.fullname" . }}-webapp'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "trigger-v4.fullname" . }}-webapp --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.webapp.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.webapp.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "{{ include "trigger-v4.selectorLabels" . }},app.kubernetes.io/component=webapp" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8030:$CONTAINER_PORT
|
||||
|
||||
The application will be available at http://localhost:8030
|
||||
{{- end }}
|
||||
|
||||
For more information about the deployment, run:
|
||||
kubectl --namespace {{ .Release.Namespace }} get all -l "{{ include "trigger-v4.selectorLabels" . }}"
|
||||
|
||||
{{- if .Values.webapp.bootstrap.enabled }}
|
||||
|
||||
Bootstrap Mode is enabled:
|
||||
- Worker group "{{ .Values.webapp.bootstrap.workerGroupName }}" will be automatically created
|
||||
- Worker token will be available at {{ .Values.webapp.bootstrap.workerTokenPath }}
|
||||
{{- end }}
|
||||
|
||||
Configuration:
|
||||
{{- if .Values.postgres.deploy }}
|
||||
- Using internal PostgreSQL
|
||||
{{- 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.deploy }}
|
||||
- Using internal Electric sync service
|
||||
{{- else }}
|
||||
- Using external Electric sync service at {{ .Values.electric.external.url }}
|
||||
{{- end }}
|
||||
{{- 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.s3.deploy }}
|
||||
- Using internal S3-compatible object storage (MinIO)
|
||||
{{- else }}
|
||||
- Using external S3-compatible object storage at {{ .Values.s3.external.endpoint }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.deploy }}
|
||||
- Using internal Docker registry
|
||||
{{- else }}
|
||||
- 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.
|
||||
Please ensure registry.external is properly configured to point at an external registry.
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,654 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "trigger-v4.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "trigger-v4.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "trigger-v4.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "trigger-v4.labels" -}}
|
||||
helm.sh/chart: {{ include "trigger-v4.chart" . }}
|
||||
{{ include "trigger-v4.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "trigger-v4.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "trigger-v4.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component labels
|
||||
*/}}
|
||||
{{- define "trigger-v4.componentLabels" -}}
|
||||
{{ include "trigger-v4.labels" . }}
|
||||
app.kubernetes.io/component: {{ .component }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Component selector labels
|
||||
*/}}
|
||||
{{- define "trigger-v4.componentSelectorLabels" -}}
|
||||
{{ include "trigger-v4.selectorLabels" . }}
|
||||
app.kubernetes.io/component: {{ .component }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{/*
|
||||
Get the full image name for webapp
|
||||
*/}}
|
||||
{{- define "trigger-v4.image" -}}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.webapp.image.registry -}}
|
||||
{{- $repository := .Values.webapp.image.repository -}}
|
||||
{{- $tag := .Values.webapp.image.tag | default .Chart.AppVersion -}}
|
||||
{{- if $registry }}
|
||||
{{- printf "%s/%s:%s" $registry $repository $tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" $repository $tag }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Get the full image name for supervisor
|
||||
*/}}
|
||||
{{- define "trigger-v4.supervisor.image" -}}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.supervisor.image.registry -}}
|
||||
{{- $repository := .Values.supervisor.image.repository -}}
|
||||
{{- $tag := .Values.supervisor.image.tag | default .Chart.AppVersion -}}
|
||||
{{- if $registry }}
|
||||
{{- printf "%s/%s:%s" $registry $repository $tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" $repository $tag }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Get the full image name for webapp volumePermissions init container
|
||||
*/}}
|
||||
{{- define "trigger-v4.webapp.volumePermissions.image" -}}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.webapp.volumePermissions.image.registry -}}
|
||||
{{- $repository := .Values.webapp.volumePermissions.image.repository -}}
|
||||
{{- $tag := .Values.webapp.volumePermissions.image.tag -}}
|
||||
{{- if $registry }}
|
||||
{{- printf "%s/%s:%s" $registry $repository $tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" $repository $tag }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Get the full image name for webapp tokenSyncer sidecar
|
||||
*/}}
|
||||
{{- define "trigger-v4.webapp.tokenSyncer.image" -}}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.webapp.tokenSyncer.image.registry -}}
|
||||
{{- $repository := .Values.webapp.tokenSyncer.image.repository -}}
|
||||
{{- $tag := .Values.webapp.tokenSyncer.image.tag -}}
|
||||
{{- if $registry }}
|
||||
{{- printf "%s/%s:%s" $registry $repository $tag }}
|
||||
{{- else }}
|
||||
{{- printf "%s:%s" $repository $tag }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL hostname (deprecated - used only for legacy DATABASE_HOST env var)
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.hostname" -}}
|
||||
{{- if .Values.postgres.deploy }}
|
||||
{{- printf "%s-postgres" .Release.Name }}
|
||||
{{- else }}
|
||||
{{- "external-postgres" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL connection string (fallback when not using secrets)
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.connectionString" -}}
|
||||
{{- if .Values.postgres.external.databaseUrl -}}
|
||||
{{ .Values.postgres.external.databaseUrl }}
|
||||
{{- 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 }}
|
||||
|
||||
{{/*
|
||||
Check if we should use DATABASE_URL from secret
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.useSecretUrl" -}}
|
||||
{{- and .Values.postgres.external.existingSecret -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis hostname
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.hostname" -}}
|
||||
{{- if .Values.redis.external.host }}
|
||||
{{- .Values.redis.external.host }}
|
||||
{{- else if .Values.redis.deploy }}
|
||||
{{- printf "%s-redis-master" .Release.Name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis connection details
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.host" -}}
|
||||
{{- include "trigger-v4.redis.hostname" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "trigger-v4.redis.port" -}}
|
||||
{{- if .Values.redis.external.host -}}
|
||||
{{ .Values.redis.external.port | default 6379 }}
|
||||
{{- else if .Values.redis.deploy -}}
|
||||
6379
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis password
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.password" -}}
|
||||
{{- if .Values.redis.external.host -}}
|
||||
{{ .Values.redis.external.password }}
|
||||
{{- else if .Values.redis.deploy -}}
|
||||
{{ .Values.redis.auth.password }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis TLS disabled setting
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.tlsDisabled" -}}
|
||||
{{- if .Values.redis.external.host -}}
|
||||
{{ not (.Values.redis.external.tls.enabled | default false) }}
|
||||
{{- else -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL external secret name
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.external.secretName" -}}
|
||||
{{- if .Values.postgres.external.existingSecret -}}
|
||||
{{ .Values.postgres.external.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.secretsName" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL external secret database URL key
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.external.databaseUrlKey" -}}
|
||||
{{- if .Values.postgres.external.existingSecret -}}
|
||||
{{ .Values.postgres.external.secretKeys.databaseUrlKey }}
|
||||
{{- else -}}
|
||||
postgres-database-url
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL external secret direct URL key
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.external.directUrlKey" -}}
|
||||
{{- if .Values.postgres.external.existingSecret -}}
|
||||
{{ .Values.postgres.external.secretKeys.directUrlKey | default .Values.postgres.external.secretKeys.databaseUrlKey }}
|
||||
{{- else -}}
|
||||
postgres-direct-url
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL direct URL (fallback to database URL if not set)
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.directUrl" -}}
|
||||
{{- if .Values.postgres.external.directUrl -}}
|
||||
{{ .Values.postgres.external.directUrl }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.postgres.connectionString" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis external secret name
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.external.secretName" -}}
|
||||
{{- if .Values.redis.external.existingSecret -}}
|
||||
{{ .Values.redis.external.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.secretsName" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis external secret password key
|
||||
*/}}
|
||||
{{- define "trigger-v4.redis.external.passwordKey" -}}
|
||||
{{- if .Values.redis.external.existingSecret -}}
|
||||
{{ .Values.redis.external.existingSecretPasswordKey }}
|
||||
{{- else -}}
|
||||
redis-password
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
ClickHouse external secret name
|
||||
*/}}
|
||||
{{- define "trigger-v4.clickhouse.external.secretName" -}}
|
||||
{{- if .Values.clickhouse.external.existingSecret -}}
|
||||
{{ .Values.clickhouse.external.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.secretsName" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
ClickHouse external secret password key
|
||||
*/}}
|
||||
{{- define "trigger-v4.clickhouse.external.passwordKey" -}}
|
||||
{{- if .Values.clickhouse.external.existingSecret -}}
|
||||
{{ .Values.clickhouse.external.existingSecretKey }}
|
||||
{{- else -}}
|
||||
clickhouse-password
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 external secret name
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.external.secretName" -}}
|
||||
{{- if .Values.s3.external.existingSecret -}}
|
||||
{{ .Values.s3.external.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.secretsName" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 external secret access key ID key
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.external.accessKeyIdKey" -}}
|
||||
{{- if .Values.s3.external.existingSecret -}}
|
||||
{{ .Values.s3.external.existingSecretAccessKeyIdKey }}
|
||||
{{- else -}}
|
||||
s3-access-key-id
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 external secret secret access key key
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.external.secretAccessKeyKey" -}}
|
||||
{{- if .Values.s3.external.existingSecret -}}
|
||||
{{ .Values.s3.external.existingSecretSecretAccessKeyKey }}
|
||||
{{- else -}}
|
||||
s3-secret-access-key
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 auth secret name
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.auth.secretName" -}}
|
||||
{{- if .Values.s3.auth.existingSecret -}}
|
||||
{{ .Values.s3.auth.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.secretsName" . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 auth secret access key ID key
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.auth.accessKeyIdKey" -}}
|
||||
{{- if .Values.s3.auth.existingSecret -}}
|
||||
{{ .Values.s3.auth.accessKeyIdSecretKey }}
|
||||
{{- else -}}
|
||||
s3-auth-access-key-id
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 auth secret secret access key key
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.auth.secretAccessKeyKey" -}}
|
||||
{{- if .Values.s3.auth.existingSecret -}}
|
||||
{{ .Values.s3.auth.secretAccessKeySecretKey }}
|
||||
{{- else -}}
|
||||
s3-auth-secret-access-key
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 auth effective access key ID (with fallback to rootUser)
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.auth.effectiveAccessKeyId" -}}
|
||||
{{- if .Values.s3.auth.accessKeyId -}}
|
||||
{{ .Values.s3.auth.accessKeyId }}
|
||||
{{- else -}}
|
||||
{{ .Values.s3.auth.rootUser }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 auth effective secret access key (with fallback to rootPassword)
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.auth.effectiveSecretAccessKey" -}}
|
||||
{{- if .Values.s3.auth.secretAccessKey -}}
|
||||
{{ .Values.s3.auth.secretAccessKey }}
|
||||
{{- else -}}
|
||||
{{ .Values.s3.auth.rootPassword }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Electric service URL
|
||||
*/}}
|
||||
{{- define "trigger-v4.electric.url" -}}
|
||||
{{- if .Values.electric.deploy -}}
|
||||
http://{{ include "trigger-v4.fullname" . }}-electric:{{ .Values.electric.service.port }}
|
||||
{{- else -}}
|
||||
{{ .Values.electric.external.url }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Whether realtime streams v2 (S2) is wired up: either the bundled s2-lite is
|
||||
deployed, or an external S2 endpoint has been configured.
|
||||
*/}}
|
||||
{{- define "trigger-v4.s2.enabled" -}}
|
||||
{{- if or .Values.s2.deploy .Values.s2.external.endpoint -}}
|
||||
true
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S2 API endpoint URL, including the /v1 suffix expected by the client.
|
||||
*/}}
|
||||
{{- define "trigger-v4.s2.url" -}}
|
||||
{{- if .Values.s2.deploy -}}
|
||||
http://{{ include "trigger-v4.fullname" . }}-s2:{{ .Values.s2.service.port }}/v1
|
||||
{{- else -}}
|
||||
{{ .Values.s2.external.endpoint }}
|
||||
{{- 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 for application (with secure parameter)
|
||||
|
||||
Note on the external+existingSecret branch: the password is expanded via
|
||||
Kubernetes' `$(VAR)` syntax, not shell `${VAR}`. Kubelet substitutes
|
||||
`$(CLICKHOUSE_PASSWORD)` at container-creation time from the
|
||||
CLICKHOUSE_PASSWORD env var declared just before CLICKHOUSE_URL in
|
||||
webapp.yaml. Shell-style `${...}` does not work here because
|
||||
`docker/scripts/entrypoint.sh` assigns CLICKHOUSE_URL to GOOSE_DBSTRING
|
||||
with a single-pass expansion (`export GOOSE_DBSTRING="$CLICKHOUSE_URL"`),
|
||||
so any inner `${...}` reaches goose verbatim and fails URL parsing.
|
||||
|
||||
CLICKHOUSE_PASSWORD must contain only URL-userinfo-safe characters — the
|
||||
value is substituted verbatim, so `@ : / ? # [ ] %` break the URL. Use a
|
||||
hex-encoded password or percent-encode before storing in the Secret.
|
||||
*/}}
|
||||
{{- define "trigger-v4.clickhouse.url" -}}
|
||||
{{- if .Values.clickhouse.deploy -}}
|
||||
{{- $protocol := ternary "https" "http" .Values.clickhouse.secure -}}
|
||||
{{- $secure := ternary "true" "false" .Values.clickhouse.secure -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.auth.username }}:{{ .Values.clickhouse.auth.password }}@{{ include "trigger-v4.clickhouse.hostname" . }}:8123?secure={{ $secure }}
|
||||
{{- else if .Values.clickhouse.external.host -}}
|
||||
{{- $protocol := ternary "https" "http" .Values.clickhouse.external.secure -}}
|
||||
{{- $secure := ternary "true" "false" .Values.clickhouse.external.secure -}}
|
||||
{{- if .Values.clickhouse.external.existingSecret -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.external.username }}:$(CLICKHOUSE_PASSWORD)@{{ .Values.clickhouse.external.host }}:{{ .Values.clickhouse.external.httpPort | default 8123 }}?secure={{ $secure }}
|
||||
{{- else -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.external.username }}:{{ .Values.clickhouse.external.password }}@{{ .Values.clickhouse.external.host }}:{{ .Values.clickhouse.external.httpPort | default 8123 }}?secure={{ $secure }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
ClickHouse URL for replication (without secure parameter)
|
||||
|
||||
See the note on clickhouse.url above — same `$(VAR)` vs `${VAR}` rationale
|
||||
applies to the replication URL.
|
||||
*/}}
|
||||
{{- define "trigger-v4.clickhouse.replication.url" -}}
|
||||
{{- if .Values.clickhouse.deploy -}}
|
||||
{{- $protocol := ternary "https" "http" .Values.clickhouse.secure -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.auth.username }}:{{ .Values.clickhouse.auth.password }}@{{ include "trigger-v4.clickhouse.hostname" . }}:8123
|
||||
{{- else if .Values.clickhouse.external.host -}}
|
||||
{{- $protocol := ternary "https" "http" .Values.clickhouse.external.secure -}}
|
||||
{{- if .Values.clickhouse.external.existingSecret -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.external.username }}:$(CLICKHOUSE_PASSWORD)@{{ .Values.clickhouse.external.host }}:{{ .Values.clickhouse.external.httpPort | default 8123 }}
|
||||
{{- else -}}
|
||||
{{ $protocol }}://{{ .Values.clickhouse.external.username }}:{{ .Values.clickhouse.external.password }}@{{ .Values.clickhouse.external.host }}:{{ .Values.clickhouse.external.httpPort | default 8123 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 hostname
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.hostname" -}}
|
||||
{{- if .Values.s3.external.endpoint }}
|
||||
{{- .Values.s3.external.endpoint }}
|
||||
{{- else if .Values.s3.deploy }}
|
||||
{{- printf "http://%s-minio:9000" .Release.Name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
S3 connection details
|
||||
*/}}
|
||||
{{- define "trigger-v4.s3.url" -}}
|
||||
{{- include "trigger-v4.s3.hostname" . }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Backward compatibility - MinIO helpers (deprecated)
|
||||
*/}}
|
||||
{{- define "trigger-v4.minio.hostname" -}}
|
||||
{{- include "trigger-v4.s3.hostname" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "trigger-v4.minio.url" -}}
|
||||
{{- include "trigger-v4.s3.url" . }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Get the secrets name - either existing secret or generated name
|
||||
*/}}
|
||||
{{- define "trigger-v4.secretsName" -}}
|
||||
{{- if .Values.secrets.existingSecret -}}
|
||||
{{ .Values.secrets.existingSecret }}
|
||||
{{- else -}}
|
||||
{{ include "trigger-v4.fullname" . }}-secrets
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Registry connection details
|
||||
*/}}
|
||||
{{- define "trigger-v4.registry.host" -}}
|
||||
{{- if .Values.registry.deploy -}}
|
||||
{{ .Values.registry.host }}
|
||||
{{- else -}}
|
||||
{{ .Values.registry.external.host }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Webapp connectivity check enabled
|
||||
*/}}
|
||||
{{- define "trigger-v4.webapp.connectivityCheckEnabled" -}}
|
||||
{{- $connectivityCheckEnabled := true -}}
|
||||
{{- if hasKey .Values.webapp "connectivityCheck" -}}
|
||||
{{- if hasKey .Values.webapp.connectivityCheck "postgres" -}}
|
||||
{{- $connectivityCheckEnabled = .Values.webapp.connectivityCheck.postgres -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $connectivityCheckEnabled -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
PostgreSQL host (for wait-for-it script)
|
||||
*/}}
|
||||
{{- define "trigger-v4.postgres.host" -}}
|
||||
{{- if .Values.postgres.deploy -}}
|
||||
{{ include "trigger-v4.postgres.hostname" . }}:5432
|
||||
{{- else if .Values.postgres.external.connectivityCheck.host -}}
|
||||
{{ .Values.postgres.external.connectivityCheck.host }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Supervisor connection details
|
||||
*/}}
|
||||
{{- define "trigger-v4.supervisor.url" -}}
|
||||
{{- if .Values.supervisor.enabled -}}
|
||||
http://{{ include "trigger-v4.fullname" . }}-supervisor:{{ .Values.supervisor.service.ports.workload }}
|
||||
{{- else -}}
|
||||
""
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the supervisor service account to use.
|
||||
When create is false, name must be set explicitly - falling back to the namespace's
|
||||
default ServiceAccount would silently grant it the RoleBinding's permissions.
|
||||
*/}}
|
||||
{{- define "trigger-v4.supervisorServiceAccountName" -}}
|
||||
{{- if .Values.supervisor.serviceAccount.create }}
|
||||
{{- default (printf "%s-supervisor" (include "trigger-v4.fullname" .)) .Values.supervisor.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- if not .Values.supervisor.serviceAccount.name }}
|
||||
{{- fail "supervisor.serviceAccount.name must be set when supervisor.serviceAccount.create is false" }}
|
||||
{{- end }}
|
||||
{{- .Values.supervisor.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the webapp service account to use.
|
||||
When create is false, name must be set explicitly - falling back to the namespace's
|
||||
default ServiceAccount would silently grant it the token-syncer RoleBinding's permissions.
|
||||
*/}}
|
||||
{{- define "trigger-v4.webappServiceAccountName" -}}
|
||||
{{- if .Values.webapp.serviceAccount.create }}
|
||||
{{- default (printf "%s-webapp" (include "trigger-v4.fullname" .)) .Values.webapp.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- if not .Values.webapp.serviceAccount.name }}
|
||||
{{- fail "webapp.serviceAccount.name must be set when webapp.serviceAccount.create is false" }}
|
||||
{{- end }}
|
||||
{{- .Values.webapp.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the supervisor role to use
|
||||
*/}}
|
||||
{{- define "trigger-v4.supervisorRoleName" -}}
|
||||
{{- default (printf "%s-supervisor-%s" (include "trigger-v4.fullname" .) .Release.Namespace) .Values.supervisor.rbac.role.name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Generate docker config for image pull secret
|
||||
*/}}
|
||||
{{- define "trigger-v4.imagePullSecret" }}
|
||||
{{- 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 (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 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Merge webapp ingress annotations to avoid duplicates
|
||||
*/}}
|
||||
{{- define "trigger-v4.webapp.ingress.annotations" -}}
|
||||
{{- $annotations := dict -}}
|
||||
{{- if .Values.webapp.ingress.annotations -}}
|
||||
{{- $annotations = .Values.webapp.ingress.annotations -}}
|
||||
{{- end -}}
|
||||
{{- if .Values.webapp.ingress.certManager.enabled -}}
|
||||
{{- $_ := set $annotations "cert-manager.io/cluster-issuer" .Values.webapp.ingress.certManager.clusterIssuer -}}
|
||||
{{- end -}}
|
||||
{{- 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 }}
|
||||
@@ -0,0 +1,109 @@
|
||||
{{- if .Values.electric.deploy }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-electric
|
||||
labels:
|
||||
{{- $component := "electric" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.electric.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.electric.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: electric
|
||||
{{- with .Values.electric.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
image: "{{ .Values.electric.image.registry }}/{{ .Values.electric.image.repository }}:{{ .Values.electric.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.electric.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.electric.service.targetPort }}
|
||||
protocol: TCP
|
||||
env:
|
||||
{{- if include "trigger-v4.postgres.useSecretUrl" . }}
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.postgres.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.postgres.external.databaseUrlKey" . }}
|
||||
{{- else }}
|
||||
- name: DATABASE_URL
|
||||
value: {{ include "trigger-v4.postgres.connectionString" . | quote }}
|
||||
{{- end }}
|
||||
- name: ELECTRIC_INSECURE
|
||||
value: {{ .Values.electric.config.insecure | quote }}
|
||||
- name: ELECTRIC_USAGE_REPORTING
|
||||
value: {{ .Values.electric.config.usageReporting | quote }}
|
||||
{{- with .Values.electric.extraEnvVars }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.electric.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.electric.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.electric.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.electric.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.electric.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.electric.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.electric.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.electric.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.electric.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.electric.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.electric.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.electric.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.electric.startupProbe.enabled }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.electric.startupProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.electric.startupProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.electric.startupProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.electric.startupProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.electric.startupProbe.successThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.electric.resources | nindent 12 }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-electric
|
||||
labels:
|
||||
{{- $component := "electric" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.electric.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.electric.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- range .Values.extraManifests }}
|
||||
---
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
@@ -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 }}
|
||||
@@ -0,0 +1,182 @@
|
||||
{{- if .Values.registry.deploy }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-registry
|
||||
labels:
|
||||
{{- $component := "registry" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: {{ include "trigger-v4.fullname" . }}-registry-headless
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.registry.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.registry.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: registry
|
||||
{{- with .Values.registry.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
image: "{{ .Values.registry.image.registry }}/{{ .Values.registry.image.repository }}:{{ .Values.registry.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.registry.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.registry.service.targetPort }}
|
||||
protocol: TCP
|
||||
{{- if or .Values.registry.auth.enabled .Values.registry.extraEnvVars }}
|
||||
env:
|
||||
{{- if .Values.registry.auth.enabled }}
|
||||
- name: REGISTRY_AUTH
|
||||
value: "htpasswd"
|
||||
- name: REGISTRY_AUTH_HTPASSWD_REALM
|
||||
value: "Registry Realm"
|
||||
- name: REGISTRY_AUTH_HTPASSWD_PATH
|
||||
value: "/auth/htpasswd"
|
||||
{{- end }}
|
||||
{{- with .Values.registry.extraEnvVars }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.registry.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.registry.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.registry.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.registry.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.registry.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.registry.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.registry.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.registry.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.registry.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.registry.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.startupProbe.enabled }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.registry.startupProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.registry.startupProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.registry.startupProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.registry.startupProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.registry.startupProbe.successThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.registry.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: {{ .Values.registry.persistence.volumeName }}
|
||||
mountPath: {{ .Values.registry.persistence.mountPath }}
|
||||
{{- if .Values.registry.persistence.subPath }}
|
||||
subPath: {{ .Values.registry.persistence.subPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.auth.enabled }}
|
||||
- name: registry-auth
|
||||
mountPath: /auth
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.registry.auth.enabled }}
|
||||
- name: registry-auth
|
||||
secret:
|
||||
secretName: {{ include "trigger-v4.fullname" . }}-registry-auth
|
||||
{{- end }}
|
||||
{{- if not .Values.registry.persistence.enabled }}
|
||||
- name: {{ .Values.registry.persistence.volumeName }}
|
||||
emptyDir: {}
|
||||
{{- else if .Values.registry.persistence.existingClaim }}
|
||||
- name: {{ .Values.registry.persistence.volumeName }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.registry.persistence.existingClaim }}
|
||||
{{- end }}
|
||||
{{- if .Values.registry.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: {{ .Values.registry.persistence.volumeName }}
|
||||
{{- with .Values.registry.persistence.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- $component := "registry" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
|
||||
{{- with .Values.registry.persistence.labels }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- toYaml .Values.registry.persistence.accessModes | nindent 10 }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.registry.persistence.size }}
|
||||
{{- $storageClass := .Values.registry.persistence.storageClass | default .Values.global.storageClass }}
|
||||
{{- if $storageClass }}
|
||||
storageClassName: {{ $storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.registry.persistence.selector }}
|
||||
selector:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.registry.persistence.dataSource }}
|
||||
dataSource:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-registry-headless
|
||||
labels:
|
||||
{{- $component := "registry" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.registry.service.port }}
|
||||
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" . }}-registry
|
||||
labels:
|
||||
{{- $component := "registry" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.registry.service.type }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.registry.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
selector:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,142 @@
|
||||
{{- if .Values.s2.deploy }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-s2-spec
|
||||
labels:
|
||||
{{- $component := "s2" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
data:
|
||||
s2-spec.json: |
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/s2-streamstore/s2/main/cli/schema.json",
|
||||
"basins": [
|
||||
{
|
||||
"name": {{ .Values.s2.basin | quote }},
|
||||
"config": {
|
||||
"create_stream_on_append": true,
|
||||
"create_stream_on_read": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-s2
|
||||
labels:
|
||||
{{- $component := "s2" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: {{ include "trigger-v4.fullname" . }}-s2
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
checksum/spec: {{ .Values.s2.basin | sha256sum }}
|
||||
{{- with .Values.s2.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.s2.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: s2
|
||||
{{- with .Values.s2.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
image: "{{ .Values.s2.image.registry }}/{{ .Values.s2.image.repository }}:{{ .Values.s2.image.tag }}{{ with .Values.s2.image.digest }}@{{ . }}{{ end }}"
|
||||
imagePullPolicy: {{ .Values.s2.image.pullPolicy }}
|
||||
command:
|
||||
- "lite"
|
||||
- "--init-file"
|
||||
- "/config/s2-spec.json"
|
||||
- "--local-root"
|
||||
- "/data"
|
||||
- "--port"
|
||||
- {{ .Values.s2.service.targetPort | quote }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.s2.service.targetPort }}
|
||||
protocol: TCP
|
||||
{{- if .Values.s2.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.s2.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.s2.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.s2.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.s2.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.s2.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.s2.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.s2.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.s2.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.s2.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.s2.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.s2.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.s2.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: spec
|
||||
mountPath: /config
|
||||
readOnly: true
|
||||
- name: data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: spec
|
||||
configMap:
|
||||
name: {{ include "trigger-v4.fullname" . }}-s2-spec
|
||||
{{- if not .Values.s2.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.s2.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
{{- if .Values.s2.persistence.retain }}
|
||||
annotations:
|
||||
helm.sh/resource-policy: keep
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.s2.persistence.accessMode }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.s2.persistence.size }}
|
||||
{{- if .Values.s2.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.s2.persistence.storageClass }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-s2
|
||||
labels:
|
||||
{{- $component := "s2" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.s2.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.s2.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,68 @@
|
||||
{{- if and .Values.secrets.enabled (not .Values.secrets.existingSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-secrets
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
SESSION_SECRET: {{ .Values.secrets.sessionSecret | b64enc | quote }}
|
||||
MAGIC_LINK_SECRET: {{ .Values.secrets.magicLinkSecret | b64enc | quote }}
|
||||
ENCRYPTION_KEY: {{ .Values.secrets.encryptionKey | b64enc | quote }}
|
||||
MANAGED_WORKER_SECRET: {{ .Values.secrets.managedWorkerSecret | b64enc | quote }}
|
||||
{{- if and .Values.s3.external.accessKeyId (not .Values.s3.external.existingSecret) }}
|
||||
s3-access-key-id: {{ .Values.s3.external.accessKeyId | b64enc | quote }}
|
||||
s3-secret-access-key: {{ .Values.s3.external.secretAccessKey | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.s3.deploy (not .Values.s3.auth.existingSecret) }}
|
||||
s3-auth-access-key-id: {{ include "trigger-v4.s3.auth.effectiveAccessKeyId" . | b64enc | quote }}
|
||||
s3-auth-secret-access-key: {{ include "trigger-v4.s3.auth.effectiveSecretAccessKey" . | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.postgres.external.databaseUrl (not .Values.postgres.external.existingSecret) }}
|
||||
postgres-database-url: {{ .Values.postgres.external.databaseUrl | b64enc | quote }}
|
||||
{{- if .Values.postgres.external.directUrl }}
|
||||
postgres-direct-url: {{ .Values.postgres.external.directUrl | b64enc | quote }}
|
||||
{{- else }}
|
||||
postgres-direct-url: {{ .Values.postgres.external.databaseUrl | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and .Values.redis.external.host (not .Values.redis.external.existingSecret) .Values.redis.external.password }}
|
||||
redis-password: {{ .Values.redis.external.password | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.clickhouse.external.host (not .Values.clickhouse.external.existingSecret) .Values.clickhouse.external.password }}
|
||||
clickhouse-password: {{ .Values.clickhouse.external.password | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if and .Values.registry.deploy .Values.registry.auth.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-registry-auth
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
htpasswd: {{ htpasswd .Values.registry.auth.username .Values.registry.auth.password | trim | b64enc | quote }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-registry-secret
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ include "trigger-v4.imagePullSecret" . | b64enc }}
|
||||
{{- else if and (not .Values.registry.deploy) .Values.registry.external.auth.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-registry-secret
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ include "trigger-v4.imagePullSecret" . | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{- if .Values.webapp.serviceMonitor.enabled }}
|
||||
---
|
||||
# Webapp ServiceMonitor
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: webapp
|
||||
{{- with .Values.webapp.serviceMonitor.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: webapp
|
||||
endpoints:
|
||||
- port: http
|
||||
path: {{ .Values.webapp.serviceMonitor.path }}
|
||||
interval: {{ .Values.webapp.serviceMonitor.interval }}
|
||||
{{- with .Values.webapp.serviceMonitor.basicAuth }}
|
||||
basicAuth:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.supervisor.serviceMonitor.enabled }}
|
||||
---
|
||||
# Supervisor ServiceMonitor
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-supervisor
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: supervisor
|
||||
{{- with .Values.supervisor.serviceMonitor.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: supervisor
|
||||
endpoints:
|
||||
- port: metrics
|
||||
path: {{ .Values.supervisor.serviceMonitor.path }}
|
||||
interval: {{ .Values.supervisor.serviceMonitor.interval }}
|
||||
{{- with .Values.supervisor.serviceMonitor.basicAuth }}
|
||||
basicAuth:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,295 @@
|
||||
{{- if .Values.supervisor.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.supervisorServiceAccountName" . }}
|
||||
labels:
|
||||
{{- $component := "supervisor" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
{{- with .Values.supervisor.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if .Values.supervisor.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.supervisorRoleName" . }}
|
||||
namespace: {{ default .Release.Namespace .Values.supervisor.config.kubernetes.namespace }}
|
||||
labels:
|
||||
{{- $component := "supervisor" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["create", "delete", "deletecollection", "get", "list", "watch"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.supervisorRoleName" . }}-binding
|
||||
namespace: {{ default .Release.Namespace .Values.supervisor.config.kubernetes.namespace }}
|
||||
labels:
|
||||
{{- $component := "supervisor" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "trigger-v4.supervisorServiceAccountName" . }}
|
||||
namespace: {{ default .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ include "trigger-v4.supervisorRoleName" . }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-supervisor
|
||||
labels:
|
||||
{{- $component := "supervisor" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxUnavailable: 0
|
||||
maxSurge: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
|
||||
{{- with .Values.supervisor.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "trigger-v4.supervisorServiceAccountName" . }}
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
{{- with .Values.supervisor.podSecurityContext }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.webapp.bootstrap.enabled }}
|
||||
initContainers:
|
||||
- name: init-shared
|
||||
image: busybox:1.35
|
||||
command: ['sh', '-c', 'mkdir -p /home/node/shared']
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /home/node/shared
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: supervisor
|
||||
image: {{ include "trigger-v4.supervisor.image" . }}
|
||||
imagePullPolicy: {{ .Values.supervisor.image.pullPolicy }}
|
||||
ports:
|
||||
- name: workload
|
||||
containerPort: {{ .Values.supervisor.service.ports.workload }}
|
||||
protocol: TCP
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.supervisor.service.ports.metrics }}
|
||||
protocol: TCP
|
||||
{{- if .Values.supervisor.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: workload
|
||||
initialDelaySeconds: {{ .Values.supervisor.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.supervisor.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.supervisor.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.supervisor.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.supervisor.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.supervisor.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: workload
|
||||
initialDelaySeconds: {{ .Values.supervisor.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.supervisor.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.supervisor.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.supervisor.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.supervisor.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.supervisor.startupProbe.enabled }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: workload
|
||||
initialDelaySeconds: {{ .Values.supervisor.startupProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.supervisor.startupProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.supervisor.startupProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.supervisor.startupProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.supervisor.startupProbe.successThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.supervisor.resources | nindent 12 }}
|
||||
env:
|
||||
# Core configuration
|
||||
- name: TRIGGER_API_URL
|
||||
value: "http://{{ include "trigger-v4.fullname" . }}-webapp:{{ .Values.webapp.service.port }}"
|
||||
- name: TRIGGER_WORKER_TOKEN
|
||||
{{- if .Values.webapp.bootstrap.enabled }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.fullname" . }}-worker-token
|
||||
key: token
|
||||
{{- else if .Values.supervisor.bootstrap.workerToken.secret.name }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.supervisor.bootstrap.workerToken.secret.name }}
|
||||
key: {{ .Values.supervisor.bootstrap.workerToken.secret.key }}
|
||||
{{- else }}
|
||||
value: {{ .Values.supervisor.bootstrap.workerToken.value | quote }}
|
||||
{{- end }}
|
||||
{{- if or .Values.secrets.enabled .Values.secrets.existingSecret }}
|
||||
- name: MANAGED_WORKER_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: MANAGED_WORKER_SECRET
|
||||
{{- end }}
|
||||
# Worker instance configuration
|
||||
- name: TRIGGER_WORKER_INSTANCE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
# Kubernetes configuration
|
||||
- name: KUBERNETES_NAMESPACE
|
||||
value: {{ default .Release.Namespace .Values.supervisor.config.kubernetes.namespace | quote }}
|
||||
- name: KUBERNETES_FORCE_ENABLED
|
||||
value: {{ .Values.supervisor.config.kubernetes.forceEnabled | quote }}
|
||||
- name: KUBERNETES_WORKER_NODETYPE_LABEL
|
||||
value: {{ .Values.supervisor.config.kubernetes.workerNodetypeLabel | quote }}
|
||||
{{- $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 }}
|
||||
- name: KUBERNETES_EPHEMERAL_STORAGE_SIZE_LIMIT
|
||||
value: {{ default "10Gi" .Values.supervisor.config.kubernetes.ephemeralStorageSizeLimit | quote }}
|
||||
- name: KUBERNETES_EPHEMERAL_STORAGE_SIZE_REQUEST
|
||||
value: {{ default "2Gi" .Values.supervisor.config.kubernetes.ephemeralStorageSizeRequest | quote }}
|
||||
# Pod cleaner configuration
|
||||
- name: POD_CLEANER_ENABLED
|
||||
value: {{ .Values.supervisor.config.podCleaner.enabled | quote }}
|
||||
- name: POD_CLEANER_BATCH_SIZE
|
||||
value: {{ .Values.supervisor.config.podCleaner.batchSize | quote }}
|
||||
- name: POD_CLEANER_INTERVAL_MS
|
||||
value: {{ .Values.supervisor.config.podCleaner.intervalMs | quote }}
|
||||
# Failed pod handler
|
||||
- name: FAILED_POD_HANDLER_ENABLED
|
||||
value: {{ .Values.supervisor.config.failedPodHandler.enabled | quote }}
|
||||
- name: FAILED_POD_HANDLER_RECONNECT_INTERVAL_MS
|
||||
value: {{ .Values.supervisor.config.failedPodHandler.reconnectIntervalMs | quote }}
|
||||
# Workload API configuration
|
||||
- name: TRIGGER_WORKLOAD_API_PROTOCOL
|
||||
value: {{ .Values.supervisor.config.workloadApi.protocol | quote }}
|
||||
- name: TRIGGER_WORKLOAD_API_DOMAIN
|
||||
value: "{{ include "trigger-v4.fullname" . }}-supervisor.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
- name: TRIGGER_WORKLOAD_API_PORT_EXTERNAL
|
||||
value: {{ .Values.supervisor.config.workloadApi.portExternal | quote }}
|
||||
- name: TRIGGER_WORKLOAD_API_PORT_INTERNAL
|
||||
value: {{ .Values.supervisor.config.workloadApi.portInternal | quote }}
|
||||
- name: TRIGGER_WORKLOAD_API_HOST_INTERNAL
|
||||
value: {{ .Values.supervisor.config.workloadApi.hostInternal | quote }}
|
||||
- name: TRIGGER_WORKLOAD_API_ENABLED
|
||||
value: {{ .Values.supervisor.config.workloadApi.enabled | quote }}
|
||||
# Dequeue configuration
|
||||
- name: TRIGGER_DEQUEUE_ENABLED
|
||||
value: {{ .Values.supervisor.config.dequeue.enabled | quote }}
|
||||
- name: TRIGGER_DEQUEUE_INTERVAL_MS
|
||||
value: {{ .Values.supervisor.config.dequeue.intervalMs | quote }}
|
||||
- name: TRIGGER_DEQUEUE_MAX_RUN_COUNT
|
||||
value: {{ .Values.supervisor.config.dequeue.maxRunCount | quote }}
|
||||
- name: TRIGGER_DEQUEUE_IDLE_INTERVAL_MS
|
||||
value: {{ .Values.supervisor.config.dequeue.idleIntervalMs | quote }}
|
||||
# Heartbeat configuration
|
||||
- name: RUNNER_HEARTBEAT_INTERVAL_SECONDS
|
||||
value: {{ .Values.supervisor.config.runner.heartbeatIntervalSeconds | quote }}
|
||||
- name: RUNNER_SNAPSHOT_POLL_INTERVAL_SECONDS
|
||||
value: {{ .Values.supervisor.config.runner.snapshotPollIntervalSeconds | quote }}
|
||||
# Metrics configuration
|
||||
- name: METRICS_ENABLED
|
||||
value: {{ .Values.supervisor.config.metrics.enabled | quote }}
|
||||
- name: METRICS_COLLECT_DEFAULTS
|
||||
value: {{ .Values.supervisor.config.metrics.collectDefaults | quote }}
|
||||
- name: METRICS_HOST
|
||||
value: {{ .Values.supervisor.config.metrics.host | quote }}
|
||||
- name: METRICS_PORT
|
||||
value: {{ .Values.supervisor.config.metrics.port | quote }}
|
||||
# Debug
|
||||
- name: DEBUG
|
||||
value: {{ .Values.supervisor.config.debug | quote }}
|
||||
# OTEL
|
||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
value: "http://{{ include "trigger-v4.fullname" . }}-webapp.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.webapp.service.port }}/otel"
|
||||
{{- with .Values.supervisor.extraEnvVars }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.webapp.bootstrap.enabled }}
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /home/node/shared
|
||||
{{- end }}
|
||||
{{- with .Values.supervisor.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.webapp.bootstrap.enabled }}
|
||||
volumes:
|
||||
- name: shared
|
||||
{{- if .Values.persistence.shared.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "trigger-v4.fullname" . }}-shared
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.supervisor.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.supervisor.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.supervisor.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-supervisor
|
||||
labels:
|
||||
{{- $component := "supervisor" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.supervisor.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.supervisor.service.ports.workload }}
|
||||
targetPort: workload
|
||||
protocol: TCP
|
||||
name: workload
|
||||
- port: {{ .Values.supervisor.service.ports.metrics }}
|
||||
targetPort: metrics
|
||||
protocol: TCP
|
||||
name: metrics
|
||||
selector:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.clickhouse.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-clickhouse"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-clickhouse
|
||||
image: curlimages/curl:8.14.1
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing ClickHouse HTTP interface..."
|
||||
curl -f --user "{{ .Values.clickhouse.auth.adminUser }}:{{ .Values.clickhouse.auth.adminPassword }}" "http://{{ include "trigger-v4.fullname" . }}-clickhouse:{{ .Values.clickhouse.service.ports.http }}/ping"
|
||||
echo "ClickHouse test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.electric.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-electric"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-electric
|
||||
image: curlimages/curl:8.14.1
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing Electric health endpoint..."
|
||||
curl -f http://{{ include "trigger-v4.fullname" . }}-electric:{{ .Values.electric.service.port }}/api/status
|
||||
echo "Electric test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.postgres.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-postgres"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-postgres
|
||||
image: {{ .Values.postgres.image.registry }}/{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing PostgreSQL connection..."
|
||||
pg_isready -h {{ include "trigger-v4.fullname" . }}-postgres -p {{ .Values.postgres.primary.service.ports.postgres }} -U {{ .Values.postgres.auth.username }}
|
||||
echo "PostgreSQL test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.redis.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-redis"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-redis
|
||||
image: {{ .Values.redis.image.registry }}/{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing Redis connection..."
|
||||
redis-cli -h {{ include "trigger-v4.fullname" . }}-redis-master -p {{ .Values.redis.master.service.ports.redis }} ping
|
||||
echo "Redis test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.s3.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-s3"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-s3
|
||||
image: curlimages/curl:8.14.1
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing S3 (MinIO) health endpoint..."
|
||||
curl -f http://{{ include "trigger-v4.fullname" . }}-minio:9000/minio/health/live
|
||||
echo "S3 test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if .Values.supervisor.deploy }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-supervisor"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-supervisor
|
||||
image: curlimages/curl:8.14.1
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing Supervisor metrics endpoint..."
|
||||
curl -f http://{{ include "trigger-v4.fullname" . }}-supervisor:{{ .Values.supervisor.service.ports.metrics }}/metrics
|
||||
echo "Supervisor test completed successfully"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "trigger-v4.fullname" . }}-test-webapp"
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: test-webapp
|
||||
image: curlimages/curl:8.14.1
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
echo "Testing webapp health endpoint..."
|
||||
curl -f http://{{ include "trigger-v4.fullname" . }}-webapp:{{ .Values.webapp.service.port }}/healthcheck
|
||||
echo "Webapp test completed successfully"
|
||||
@@ -0,0 +1,67 @@
|
||||
{{/*
|
||||
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 and (not .Values.postgres.external.databaseUrl) (not .Values.postgres.external.existingSecret) }}
|
||||
{{- fail "PostgreSQL external configuration is required when postgres.deploy=false. Please provide either postgres.external.databaseUrl or postgres.external.existingSecret" }}
|
||||
{{- 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 .Values.s3.deploy }}
|
||||
{{- if and (not .Values.s3.auth.existingSecret) (not .Values.s3.auth.accessKeyId) (not .Values.s3.auth.rootUser) }}
|
||||
{{- fail "S3 auth credentials are required when s3.deploy=true. Please provide either s3.auth.accessKeyId, s3.auth.existingSecret, or s3.auth.rootUser" }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if not .Values.s3.external.endpoint }}
|
||||
{{- fail "S3 external configuration is required when s3.deploy=false. Please provide s3.external.endpoint" }}
|
||||
{{- end }}
|
||||
{{- if and (not .Values.s3.external.existingSecret) (or (not .Values.s3.external.accessKeyId) (not .Values.s3.external.secretAccessKey)) }}
|
||||
{{- fail "S3 credentials are required when s3.deploy=false. Please provide either s3.external.existingSecret or both s3.external.accessKeyId and s3.external.secretAccessKey" }}
|
||||
{{- 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 and .Values.s2.deploy .Values.s2.external.endpoint }}
|
||||
{{- 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." }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not .Values.registry.deploy }}
|
||||
{{- if or (not .Values.registry.external.host) }}
|
||||
{{- fail "Registry external configuration is required when registry.deploy=false. Please provide registry.external.host" }}
|
||||
{{- 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"
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- 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 }}-webapp
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
annotations:
|
||||
{{- include "trigger-v4.webapp.ingress.annotations" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if .Values.webapp.ingress.className }}
|
||||
ingressClassName: {{ .Values.webapp.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.webapp.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.webapp.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- if .paths }}
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType | default "Prefix" }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}-webapp
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}-webapp
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,494 @@
|
||||
{{- if .Values.webapp.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.webappServiceAccountName" . }}
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
{{- with .Values.webapp.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp-token-syncer
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["create", "get", "update", "patch"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp-token-syncer
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "trigger-v4.webappServiceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp-token-syncer
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.webapp.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
kubectl.kubernetes.io/default-container: webapp
|
||||
{{- with .Values.webapp.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 8 }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "trigger-v4.webappServiceAccountName" . }}
|
||||
{{- with .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
{{- with .Values.webapp.podSecurityContext }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: volume-permissions
|
||||
image: {{ include "trigger-v4.webapp.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.webapp.volumePermissions.image.pullPolicy }}
|
||||
command: ['sh', '-c', 'mkdir -p /home/node/shared']
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /home/node/shared
|
||||
containers:
|
||||
- name: token-syncer
|
||||
image: {{ include "trigger-v4.webapp.tokenSyncer.image" . }}
|
||||
imagePullPolicy: {{ .Values.webapp.tokenSyncer.image.pullPolicy }}
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
TOKEN_FILE="/home/node/shared/worker_token"
|
||||
SECRET_NAME="{{ include "trigger-v4.fullname" . }}-worker-token"
|
||||
NAMESPACE="{{ .Release.Namespace }}"
|
||||
|
||||
echo "Token syncer starting..."
|
||||
echo "Monitoring: $TOKEN_FILE"
|
||||
echo "Target secret: $SECRET_NAME"
|
||||
|
||||
while true; do
|
||||
if [ -f "$TOKEN_FILE" ]; then
|
||||
TOKEN=$(cat "$TOKEN_FILE")
|
||||
if [ ! -z "$TOKEN" ]; then
|
||||
echo "Token file found, creating/updating secret..."
|
||||
|
||||
# Create or update the secret
|
||||
kubectl create secret generic "$SECRET_NAME" \
|
||||
--from-literal=token="$TOKEN" \
|
||||
--namespace="$NAMESPACE" \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Secret successfully created/updated"
|
||||
# Continue monitoring for updates
|
||||
sleep 30
|
||||
else
|
||||
echo "Failed to create/update secret, retrying in 5s..."
|
||||
sleep 5
|
||||
fi
|
||||
else
|
||||
echo "Token file exists but is empty, waiting..."
|
||||
sleep 2
|
||||
fi
|
||||
else
|
||||
echo "Waiting for token file..."
|
||||
sleep 2
|
||||
fi
|
||||
done
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /home/node/shared
|
||||
- name: webapp
|
||||
securityContext:
|
||||
{{- toYaml .Values.webapp.securityContext | nindent 12 }}
|
||||
image: {{ include "trigger-v4.image" . }}
|
||||
imagePullPolicy: {{ .Values.webapp.image.pullPolicy }}
|
||||
command:
|
||||
- ./scripts/entrypoint.sh
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.webapp.service.targetPort }}
|
||||
protocol: TCP
|
||||
{{- if .Values.webapp.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthcheck
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.webapp.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.webapp.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.webapp.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.webapp.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.webapp.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthcheck
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.webapp.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.webapp.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.webapp.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.webapp.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.webapp.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.startupProbe.enabled }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /healthcheck
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.webapp.startupProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.webapp.startupProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.webapp.startupProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.webapp.startupProbe.failureThreshold }}
|
||||
successThreshold: {{ .Values.webapp.startupProbe.successThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.webapp.resources | nindent 12 }}
|
||||
env:
|
||||
- name: APP_ORIGIN
|
||||
value: {{ .Values.webapp.appOrigin | quote }}
|
||||
- name: LOGIN_ORIGIN
|
||||
value: {{ .Values.webapp.loginOrigin | quote }}
|
||||
- name: API_ORIGIN
|
||||
value: {{ .Values.webapp.apiOrigin | quote }}
|
||||
- name: ELECTRIC_ORIGIN
|
||||
value: {{ include "trigger-v4.electric.url" . | quote }}
|
||||
{{- if include "trigger-v4.s2.enabled" . }}
|
||||
# Realtime streams v2, backed by S2 (bundled s2-lite or an external endpoint)
|
||||
- name: REALTIME_STREAMS_DEFAULT_VERSION
|
||||
value: {{ .Values.s2.defaultStreamVersion | quote }}
|
||||
- name: REALTIME_STREAMS_S2_ENDPOINT
|
||||
value: {{ include "trigger-v4.s2.url" . | quote }}
|
||||
- name: REALTIME_STREAMS_S2_BASIN
|
||||
value: {{ .Values.s2.basin | quote }}
|
||||
- name: REALTIME_STREAMS_S2_SKIP_ACCESS_TOKENS
|
||||
value: {{ .Values.s2.skipAccessTokens | quote }}
|
||||
{{- if and .Values.s2.external.endpoint .Values.s2.external.existingSecret }}
|
||||
- name: REALTIME_STREAMS_S2_ACCESS_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.s2.external.existingSecret }}
|
||||
key: {{ .Values.s2.external.existingSecretAccessTokenKey }}
|
||||
{{- else if .Values.s2.external.accessToken }}
|
||||
- name: REALTIME_STREAMS_S2_ACCESS_TOKEN
|
||||
value: {{ .Values.s2.external.accessToken | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if include "trigger-v4.postgres.useSecretUrl" . }}
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.postgres.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.postgres.external.databaseUrlKey" . }}
|
||||
- name: DIRECT_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.postgres.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.postgres.external.directUrlKey" . }}
|
||||
{{- else }}
|
||||
- name: DATABASE_URL
|
||||
value: {{ include "trigger-v4.postgres.connectionString" . | quote }}
|
||||
- name: DIRECT_URL
|
||||
value: {{ include "trigger-v4.postgres.directUrl" . | quote }}
|
||||
{{- end }}
|
||||
{{- if and (include "trigger-v4.webapp.connectivityCheckEnabled" .) (include "trigger-v4.postgres.host" .) }}
|
||||
- name: DATABASE_HOST
|
||||
value: {{ include "trigger-v4.postgres.host" . | quote }}
|
||||
{{- end }}
|
||||
- name: REDIS_HOST
|
||||
value: {{ include "trigger-v4.redis.host" . | quote }}
|
||||
- name: REDIS_PORT
|
||||
value: {{ include "trigger-v4.redis.port" . | quote }}
|
||||
{{- if and .Values.redis.external.host .Values.redis.external.existingSecret }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.redis.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.redis.external.passwordKey" . }}
|
||||
{{- else if include "trigger-v4.redis.password" . }}
|
||||
- name: REDIS_PASSWORD
|
||||
value: {{ include "trigger-v4.redis.password" . | quote }}
|
||||
{{- end }}
|
||||
- name: REDIS_TLS_DISABLED
|
||||
value: {{ include "trigger-v4.redis.tlsDisabled" . | quote }}
|
||||
- name: APP_LOG_LEVEL
|
||||
value: {{ .Values.webapp.logLevel | quote }}
|
||||
- name: DEV_OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
value: "{{ .Values.webapp.appOrigin }}/otel"
|
||||
- name: DEPLOY_REGISTRY_HOST
|
||||
value: {{ include "trigger-v4.registry.host" . | quote }}
|
||||
- name: DEPLOY_REGISTRY_NAMESPACE
|
||||
value: {{ .Values.registry.repositoryNamespace | quote }}
|
||||
- name: OBJECT_STORE_BASE_URL
|
||||
value: {{ include "trigger-v4.s3.url" . | quote }}
|
||||
- name: GRACEFUL_SHUTDOWN_TIMEOUT
|
||||
value: {{ .Values.webapp.gracefulShutdownTimeout | quote }}
|
||||
{{- if .Values.webapp.bootstrap.enabled }}
|
||||
- name: TRIGGER_BOOTSTRAP_ENABLED
|
||||
value: "1"
|
||||
- name: TRIGGER_BOOTSTRAP_WORKER_GROUP_NAME
|
||||
value: {{ .Values.webapp.bootstrap.workerGroupName | quote }}
|
||||
- name: TRIGGER_BOOTSTRAP_WORKER_TOKEN_PATH
|
||||
value: {{ .Values.webapp.bootstrap.workerTokenPath | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.taskPayloadOffloadThreshold }}
|
||||
- name: TASK_PAYLOAD_OFFLOAD_THRESHOLD
|
||||
value: {{ .Values.webapp.limits.taskPayloadOffloadThreshold | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.taskPayloadMaximumSize }}
|
||||
- name: TASK_PAYLOAD_MAXIMUM_SIZE
|
||||
value: {{ .Values.webapp.limits.taskPayloadMaximumSize | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.batchTaskPayloadMaximumSize }}
|
||||
- name: BATCH_TASK_PAYLOAD_MAXIMUM_SIZE
|
||||
value: {{ .Values.webapp.limits.batchTaskPayloadMaximumSize | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.taskRunMetadataMaximumSize }}
|
||||
- name: TASK_RUN_METADATA_MAXIMUM_SIZE
|
||||
value: {{ .Values.webapp.limits.taskRunMetadataMaximumSize | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.defaultEnvExecutionConcurrencyLimit }}
|
||||
- name: DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT
|
||||
value: {{ .Values.webapp.limits.defaultEnvExecutionConcurrencyLimit | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.limits.defaultOrgExecutionConcurrencyLimit }}
|
||||
- name: DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT
|
||||
value: {{ .Values.webapp.limits.defaultOrgExecutionConcurrencyLimit | quote }}
|
||||
{{- end }}
|
||||
{{- if or .Values.secrets.enabled .Values.secrets.existingSecret }}
|
||||
- name: SESSION_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: SESSION_SECRET
|
||||
- name: MAGIC_LINK_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: MAGIC_LINK_SECRET
|
||||
- name: ENCRYPTION_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: ENCRYPTION_KEY
|
||||
- name: MANAGED_WORKER_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: MANAGED_WORKER_SECRET
|
||||
{{- if .Values.s3.deploy }}
|
||||
{{- if .Values.s3.auth.existingSecret }}
|
||||
- name: OBJECT_STORE_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.s3.auth.secretName" . }}
|
||||
key: {{ include "trigger-v4.s3.auth.accessKeyIdKey" . }}
|
||||
- name: OBJECT_STORE_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.s3.auth.secretName" . }}
|
||||
key: {{ include "trigger-v4.s3.auth.secretAccessKeyKey" . }}
|
||||
{{- else }}
|
||||
- name: OBJECT_STORE_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: s3-auth-access-key-id
|
||||
- name: OBJECT_STORE_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: s3-auth-secret-access-key
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .Values.s3.external.existingSecret }}
|
||||
- name: OBJECT_STORE_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.s3.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.s3.external.accessKeyIdKey" . }}
|
||||
- name: OBJECT_STORE_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.s3.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.s3.external.secretAccessKeyKey" . }}
|
||||
{{- else if .Values.s3.external.accessKeyId }}
|
||||
- name: OBJECT_STORE_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: s3-access-key-id
|
||||
- name: OBJECT_STORE_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.secretsName" . }}
|
||||
key: s3-secret-access-key
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.observability }}
|
||||
{{- if .Values.webapp.observability.tracing.exporterUrl }}
|
||||
- name: INTERNAL_OTEL_TRACE_EXPORTER_URL
|
||||
value: {{ .Values.webapp.observability.tracing.exporterUrl | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.observability.tracing.exporterAuthHeaders }}
|
||||
- name: INTERNAL_OTEL_TRACE_EXPORTER_AUTH_HEADERS
|
||||
value: {{ .Values.webapp.observability.tracing.exporterAuthHeaders | quote }}
|
||||
{{- end }}
|
||||
- name: INTERNAL_OTEL_TRACE_LOGGING_ENABLED
|
||||
value: {{ .Values.webapp.observability.tracing.loggingEnabled | quote }}
|
||||
- name: INTERNAL_OTEL_TRACE_SAMPLING_RATE
|
||||
value: {{ .Values.webapp.observability.tracing.samplingRate | quote }}
|
||||
- name: INTERNAL_OTEL_TRACE_INSTRUMENT_PRISMA_ENABLED
|
||||
value: {{ .Values.webapp.observability.tracing.instrumentPrismaEnabled | quote }}
|
||||
- name: INTERNAL_OTEL_TRACE_DISABLED
|
||||
value: {{ .Values.webapp.observability.tracing.disabled | quote }}
|
||||
{{- if .Values.webapp.observability.logging.exporterUrl }}
|
||||
- name: INTERNAL_OTEL_LOG_EXPORTER_URL
|
||||
value: {{ .Values.webapp.observability.logging.exporterUrl | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.observability.metrics.exporterUrl }}
|
||||
- name: INTERNAL_OTEL_METRIC_EXPORTER_URL
|
||||
value: {{ .Values.webapp.observability.metrics.exporterUrl | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.webapp.observability.metrics.exporterAuthHeaders }}
|
||||
- name: INTERNAL_OTEL_METRIC_EXPORTER_AUTH_HEADERS
|
||||
value: {{ .Values.webapp.observability.metrics.exporterAuthHeaders | quote }}
|
||||
{{- end }}
|
||||
- name: INTERNAL_OTEL_METRIC_EXPORTER_ENABLED
|
||||
value: {{ .Values.webapp.observability.metrics.exporterEnabled | quote }}
|
||||
- name: INTERNAL_OTEL_METRIC_EXPORTER_INTERVAL_MS
|
||||
value: {{ .Values.webapp.observability.metrics.exporterIntervalMs | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.clickhouse.external.host .Values.clickhouse.external.existingSecret }}
|
||||
- name: CLICKHOUSE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "trigger-v4.clickhouse.external.secretName" . }}
|
||||
key: {{ include "trigger-v4.clickhouse.external.passwordKey" . }}
|
||||
{{- end }}
|
||||
- name: CLICKHOUSE_URL
|
||||
value: {{ include "trigger-v4.clickhouse.url" . | quote }}
|
||||
- name: CLICKHOUSE_LOG_LEVEL
|
||||
value: {{ .Values.webapp.clickhouse.logLevel | quote }}
|
||||
- name: RUN_REPLICATION_ENABLED
|
||||
value: "1"
|
||||
- name: RUN_REPLICATION_CLICKHOUSE_URL
|
||||
value: {{ include "trigger-v4.clickhouse.replication.url" . | quote }}
|
||||
- name: RUN_REPLICATION_LOG_LEVEL
|
||||
value: {{ .Values.webapp.runReplication.logLevel | quote }}
|
||||
{{- if not .Values.telemetry.enabled }}
|
||||
- name: TRIGGER_TELEMETRY_DISABLED
|
||||
value: "1"
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.extraEnvVars }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /home/node/shared
|
||||
{{- with .Values.webapp.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: shared
|
||||
{{- if .Values.persistence.shared.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "trigger-v4.fullname" . }}-shared
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.extraVolumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.webapp.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- tpl (toYaml .) $ | nindent 8 }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-webapp
|
||||
labels:
|
||||
{{- $component := "webapp" }}
|
||||
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.webapp.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.webapp.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "trigger-v4.componentSelectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 4 }}
|
||||
---
|
||||
{{- if .Values.persistence.shared.enabled }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "trigger-v4.fullname" . }}-shared
|
||||
{{- if .Values.persistence.shared.retain }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "trigger-v4.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.shared.accessMode }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.shared.size }}
|
||||
{{- $storageClass := .Values.persistence.shared.storageClass | default .Values.global.storageClass }}
|
||||
{{- if $storageClass }}
|
||||
storageClassName: {{ $storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user