Skip to content

Commit bd65ebb

Browse files
authored
Merge pull request #361 from Flagsmith/feat/custom-probes
feat: `exec` liveness probes
2 parents 7516c4a + 5f01049 commit bd65ebb

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

charts/flagsmith/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: flagsmith
33
description: Flagsmith
44
type: application
5-
version: 0.74.0
5+
version: 0.75.0
66
appVersion: 2.174.0
77
dependencies:
88
- name: postgresql

charts/flagsmith/templates/deployment-api.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,15 @@ spec:
132132
- containerPort: {{ .Values.service.api.port }}
133133
env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
134134
livenessProbe:
135-
failureThreshold: {{ .Values.api.livenessProbe.failureThreshold }}
135+
{{- if .Values.api.livenessProbe.exec }}
136+
exec: {{ .Values.api.livenessProbe.exec | toYaml | nindent 12 }}
137+
{{- else if .Values.api.livenessProbe.path }}
136138
httpGet:
137139
path: {{ .Values.api.livenessProbe.path }}
138140
port: {{ .Values.service.api.port }}
139141
scheme: HTTP
142+
{{- end }}
143+
failureThreshold: {{ .Values.api.livenessProbe.failureThreshold }}
140144
initialDelaySeconds: {{ .Values.api.livenessProbe.initialDelaySeconds }}
141145
periodSeconds: {{ .Values.api.livenessProbe.periodSeconds }}
142146
successThreshold: {{ .Values.api.livenessProbe.successThreshold }}

charts/flagsmith/templates/deployment-task-processor.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,16 @@ spec:
8585
- containerPort: {{ .Values.service.taskProcessor.port }}
8686
env: {{ include (print $.Template.BasePath "/_task_processor_environment.yaml") . | nindent 8 }}
8787
livenessProbe:
88-
failureThreshold: {{ .Values.taskProcessor.livenessProbe.failureThreshold }}
88+
{{- $exec := .Values.taskProcessor.livenessProbe.exec | default .Values.api.livenessProbe.exec }}
89+
{{- if $exec }}
90+
exec: {{ $exec | toYaml | nindent 12 }}
91+
{{- else }}
8992
httpGet:
9093
path: /health/liveness
9194
port: {{ .Values.service.taskProcessor.port }}
9295
scheme: HTTP
96+
{{- end }}
97+
failureThreshold: {{ .Values.taskProcessor.livenessProbe.failureThreshold }}
9398
initialDelaySeconds: {{ .Values.taskProcessor.livenessProbe.initialDelaySeconds }}
9499
periodSeconds: {{ .Values.taskProcessor.livenessProbe.periodSeconds }}
95100
successThreshold: {{ .Values.taskProcessor.livenessProbe.successThreshold }}

charts/flagsmith/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ api:
7676
# runAsUser: 1000
7777
# runAsGroup: 1000
7878
livenessProbe:
79+
# path is the API path to be used for health checks. Used if exec is not set.
7980
path: /health/liveness
81+
# exec describes an ExecAction command which will run inside the API container.
82+
# See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe
83+
exec: {}
8084
failureThreshold: 5
8185
initialDelaySeconds: 5
8286
periodSeconds: 10
@@ -192,6 +196,10 @@ taskProcessor:
192196
queuePopSize: null
193197

194198
livenessProbe:
199+
# exec describes an ExecAction command which will run inside the API container.
200+
# Defaults to api.livenessProbe.exec.
201+
# See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe
202+
exec: {}
195203
failureThreshold: 5
196204
initialDelaySeconds: 5
197205
periodSeconds: 10

0 commit comments

Comments
 (0)