

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Liveness Probes
incomplete
2: Readiness Probes
incomplete
3: Startup Probes
incomplete
4: Broken Cluster
incomplete
This lesson's interactive features are locked, please to keep using them
Some apps take quite a while to start (not any I've written, but you know, some other people's). They might need to load a big cache or run a bunch of database migrations before they can serve requests.
That can actually be a problem for liveness probes. If an app takes 180 seconds to start, but its liveness probe gives up after 15, Kubernetes kills the container before it ever finishes starting up... over and over again! Sure, you could add a long initialDelaySeconds to the liveness probe, but that makes it wait the full delay on every container start, even when the app starts quickly.
A startup probe solves this. Until it succeeds, Kubernetes holds off on the liveness and readiness probes. If it doesn't succeed in time, the container is restarted, just like with a failed liveness probe. Once it succeeds, it stops running, and the other probes take over:
startupProbe:
httpGet:
path: /healthz
port: 8080
periodSeconds: 2
failureThreshold: 30
livenessProbe:
httpGet:
path: /healthz
port: 8080
periodSeconds: 5
failureThreshold: 3The config above gives the app up to 60 seconds (30 checks, 2 seconds apart) to start up. But once it's running, a hung container is restarted within about 15 seconds.
The crawler team is about to ship a version of the crawler that loads a big keyword database when it starts, which can take up to 45 seconds.
Add startup and liveness probes to the crawler.
Submit the shell checks.