Skip to content

The open alternative to Salesforce, designed for AI.

feat(helm): parametrize liveness, readiness and startup probes for server (#22268)

Miguel873f8ad24c5a
diff --git a/packages/twenty-docker/helm/twenty/templates/deployment-server.yaml b/packages/twenty-docker/helm/twenty/templates/deployment-server.yaml
index 5f9cde43444..c87f39fff8c 100644
--- a/packages/twenty-docker/helm/twenty/templates/deployment-server.yaml
+++ b/packages/twenty-docker/helm/twenty/templates/deployment-server.yaml
@@ -184,22 +184,18 @@ spec:
- name: http-tcp
containerPort: {{ include "twenty.server.containerPort" . }}
protocol: TCP
+ {{- with .Values.server.startupProbe }}
+ startupProbe:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.server.livenessProbe }}
livenessProbe:
- httpGet:
- path: /
- port: {{ include "twenty.server.containerPort" . }}
- initialDelaySeconds: 60
- periodSeconds: 10
- timeoutSeconds: 5
- failureThreshold: 5
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.server.readinessProbe }}
readinessProbe:
- httpGet:
- path: /
- port: {{ include "twenty.server.containerPort" . }}
- initialDelaySeconds: 40
- periodSeconds: 5
- timeoutSeconds: 5
- failureThreshold: 5
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
volumeMounts:
diff --git a/packages/twenty-docker/helm/twenty/values.schema.json b/packages/twenty-docker/helm/twenty/values.schema.json
index 9bfe0eebddd..88cf0c9799b 100644
--- a/packages/twenty-docker/helm/twenty/values.schema.json
+++ b/packages/twenty-docker/helm/twenty/values.schema.json
@@ -3,6 +3,54 @@
"title": "Twenty Helm Chart Values",
"type": "object",
"additionalProperties": true,
+ "definitions": {
+ "probe": {
+ "oneOf": [
+ { "type": "null" },
+ {
+ "type": "object",
+ "properties": {
+ "httpGet": {
+ "type": "object",
+ "properties": {
+ "path": { "type": "string" },
+ "port": { "type": ["string", "integer"] },
+ "scheme": { "type": "string", "enum": ["HTTP", "HTTPS"] },
+ "host": { "type": "string" },
+ "httpHeaders": { "type": "array" }
+ }
+ },
+ "tcpSocket": {
+ "type": "object",
+ "properties": {
+ "port": { "type": ["string", "integer"] },
+ "host": { "type": "string" }
+ },
+ "required": ["port"]
+ },
+ "exec": {
+ "type": "object",
+ "properties": {
+ "command": { "type": "array", "items": { "type": "string" } }
+ },
+ "required": ["command"]
+ },
+ "initialDelaySeconds": { "type": "integer", "minimum": 0 },
+ "periodSeconds": { "type": "integer", "minimum": 1 },
+ "timeoutSeconds": { "type": "integer", "minimum": 1 },
+ "successThreshold": { "type": "integer", "minimum": 1 },
+ "failureThreshold": { "type": "integer", "minimum": 1 },
+ "terminationGracePeriodSeconds": { "type": "integer", "minimum": 1 }
+ },
+ "oneOf": [
+ { "required": ["httpGet"] },
+ { "required": ["tcpSocket"] },
+ { "required": ["exec"] }
+ ]
+ }
+ ]
+ }
+ },
"properties": {
"image": {
"type": "object",
@@ -146,7 +194,10 @@
},
"affinity": { "type": "object" },
"dnsPolicy": { "type": ["string", "null"], "enum": ["ClusterFirst", "ClusterFirstWithHostNet", "Default", "None", null] },
- "dnsConfig": { "type": "object" }
+ "dnsConfig": { "type": "object" },
+ "startupProbe": { "$ref": "#/definitions/probe" },
+ "livenessProbe": { "$ref": "#/definitions/probe" },
+ "readinessProbe": { "$ref": "#/definitions/probe" }
}
},
diff --git a/packages/twenty-docker/helm/twenty/values.yaml b/packages/twenty-docker/helm/twenty/values.yaml
index 633426ac468..85a479846db 100644
--- a/packages/twenty-docker/helm/twenty/values.yaml
+++ b/packages/twenty-docker/helm/twenty/values.yaml
@@ -105,6 +105,31 @@ server:
dnsPolicy: ~
dnsConfig: {}
+ # Health probes for the server container. Set any probe to null to disable it.
+ # startupProbe gates the slow initial boot (up to periodSeconds x failureThreshold),
+ # so liveness/readiness intentionally carry no initialDelaySeconds.
+ startupProbe:
+ httpGet:
+ path: /healthz
+ port: http-tcp
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 30
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: http-tcp
+ periodSeconds: 30
+ timeoutSeconds: 5
+ failureThreshold: 3
+ readinessProbe:
+ httpGet:
+ path: /healthz
+ port: http-tcp
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 3
+
# Worker deployment
worker:
enabled: true