What is the main purpose of a readiness probe in Kubernetes?
Think about when Kubernetes should send traffic to a pod.
The readiness probe tells Kubernetes if the pod is ready to accept traffic. If the probe fails, Kubernetes stops sending requests to that pod until it passes again.
Given the following liveness probe configuration, what will Kubernetes do if the probe fails repeatedly?
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3Remember what a liveness probe is designed to do.
The liveness probe checks if the container is alive. If it fails the configured number of times, Kubernetes restarts the container to try to fix the problem.
Arrange the following Kubernetes probe checks in the order they are typically performed during pod lifecycle:
Think about what happens first when a pod starts and how traffic is routed.
The startup probe runs first to check if the app has started. Then readiness probe checks if it can receive traffic. If ready, pod is added to endpoints. Liveness probe runs continuously to check if app is alive.
A pod is running but not receiving any traffic. The readiness probe is configured but the pod never becomes ready. What is the most likely cause?
Focus on what controls traffic routing to pods.
If the readiness probe fails, Kubernetes considers the pod not ready and excludes it from the service endpoints, so it won't receive traffic.
Why is it recommended to use a startup probe for applications with long initialization times?
Think about what happens if liveness probes run too early on slow-starting apps.
Startup probes allow Kubernetes to wait longer for the app to start before running liveness probes. This avoids killing the container too soon.