Skip to content

Commit

Permalink
feat: ✨ Probes: Readiness & Liveness solution: StartupProbe
Browse files Browse the repository at this point in the history
A startup probe in Kubernetes is a mechanism to determine if a container has successfully started and initialized. It is particularly useful for slow-starting containers that require additional time to become fully operational. Kubernetes uses the startup probe to monitor the container's initialization process, and once the container passes the startup check, it transitions to liveness and readiness checks, ensuring the application has enough time to initialize before serving traffic.
  • Loading branch information
kevencript committed Mar 18, 2023
1 parent 9a8a796 commit 02a0d06
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ spec:
spec:
containers:
- name: go-http-app
image: wesleywillians/hello-go:v5.4 # Probe on port /healthz (+ readiness check: if app is up < 10s it will fail. This way, readiness will only be "ready" when the pod is healthy)
image: wesleywillians/hello-go:v5.5 # Probe on port /healthz (+ readiness check: if app is up < 10s it will fail. This way, readiness will only be "ready" when the pod is healthy)
startupProbe: # This will BLOCK the readiness and liveness until the StartupProbe is done
httpGet:
path: /healthz
port: 8000 # Should be the CONTAINER port
periodSeconds: 2
failureThreshold: 10

readinessProbe:
httpGet:
path: /healthz
Expand Down

0 comments on commit 02a0d06

Please sign in to comment.