Skip to content

Commit f1804a8

Browse files
totycroividito
authored andcommitted
Improve probe setup
Liveness probe is now a TCP probe. This has the effect that if the server is overloaded and does not respond to HTTP requests in time that it will not be killed as long as the server still listens on the TCP port (i.e. the server is actually alive). Therefore it can finish the requests (this shouldn't take forever due to gunicorn request timeouts). The readiness probe now is an HTTP probe, so if the server is overloaded, it won't receive any new requests. Instead of initialDelaySeconds, a startup HTTP probe is used which queries the service every second, so that it's marked as available as soon as it's actually available. This is vital for one of our use cases where we scale the service to zero and only activate it on the first request, i.e. users wait for the service to actually become available.
1 parent a673de8 commit f1804a8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

helm-chart/eoapi/templates/services/deployment.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
- "--root-path=/{{ $serviceName }}{{ $.Release.Name }}"
4141
{{- end }}{{/* needed for proxies and path rewrites on NLB */}}
4242
livenessProbe:
43+
tcpSocket:
44+
port: {{ $.Values.service.port }}
45+
failureThreshold: 3
46+
periodSeconds: 15
47+
successThreshold: 1
48+
timeoutSeconds: 1
49+
readinessProbe:
4350
httpGet:
4451
{{- if (eq $serviceName "stac") }}
4552
path: /_mgmt/ping
@@ -48,9 +55,20 @@ spec:
4855
{{- end }}
4956
port: {{ $.Values.service.port }}
5057
failureThreshold: 3
51-
initialDelaySeconds: 30
5258
periodSeconds: 15
5359
successThreshold: 1
60+
startupProbe:
61+
httpGet:
62+
{{- if (eq $serviceName "stac") }}
63+
path: /_mgmt/ping
64+
{{- else }}
65+
path: /healthz
66+
{{- end }}
67+
port: {{ $.Values.service.port }}
68+
# check every sec for 1 minute
69+
periodSeconds: 1
70+
failureThreshold: 60
71+
successThreshold: 1
5472
ports:
5573
- containerPort: {{ $.Values.service.port }}
5674
resources:

0 commit comments

Comments
 (0)