diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index a5befc9..ac5d854 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -106,3 +106,27 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Determine probe path based on image tag and overrides +*/}} +{{- define "fusionauth.probePath" -}} +{{- $probeName := .probeName -}} +{{- $overridePath := "" -}} +{{- if eq $probeName "liveness" -}} +{{- $overridePath = .Values.livenessProbe.httpGet.path -}} +{{- else if eq $probeName "readiness" -}} +{{- $overridePath = .Values.readinessProbe.httpGet.path -}} +{{- else if eq $probeName "startup" -}} +{{- $overridePath = .Values.startupProbe.httpGet.path -}} +{{- end -}} +{{- if $overridePath -}} +{{- $overridePath -}} +{{- else -}} +{{- if semverCompare ">=1.52.0" .Values.image.tag -}} +/api/health +{{- else -}} +/ +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index aaf8b88..a2c8cae 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -82,10 +82,13 @@ spec: containerPort: 9011 protocol: TCP livenessProbe: + {{- $_ := set .Values.livenessProbe "path" (include "fusionauth.probePath" (dict "Values" .Values "probeName" "liveness")) }} {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: + {{- $_ := set .Values.readinessProbe "path" (include "fusionauth.probePath" (dict "Values" .Values "probeName" "readiness")) }} {{- toYaml .Values.readinessProbe | nindent 12 }} startupProbe: + {{- $_ := set .Values.startupProbe "path" (include "fusionauth.probePath" (dict "Values" .Values "probeName" "startup")) }} {{- toYaml .Values.startupProbe | nindent 12 }} {{- with .Values.lifecycle }} lifecycle: diff --git a/chart/values.yaml b/chart/values.yaml index 24098da..958329c 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -258,7 +258,7 @@ podLabels: {} # livenessProbe -- Configures a livenessProbe to ensure fusionauth is running livenessProbe: httpGet: - path: / + # path: / # Defaults to / for <1.52.0, /api/health for >=1.52.0 - uncomment to override port: http failureThreshold: 3 periodSeconds: 30 @@ -266,14 +266,14 @@ livenessProbe: # readinessProbe -- Configures a readinessProbe to ensure fusionauth is ready for requests readinessProbe: httpGet: - path: / + # path: / # Defaults to / for <1.52.0, /api/health for >=1.52.0 - uncomment to override port: http failureThreshold: 5 timeoutSeconds: 5 # startupProbe -- Configures a startupProbe to ensure fusionauth has finished starting up startupProbe: httpGet: - path: / + # path: / # Defaults to / for <1.52.0, /api/health for >=1.52.0 - uncomment to override port: http failureThreshold: 20 periodSeconds: 10