Kubernetes is very SMART (No BS) π
It can happily detect Pod failures with ease.
QUICK HELP: If you resonate with my work, please checkout my Youtube and Substack. I totally appreciate your support. Thank You.
Reasons for pod failure can be anything:
1. Configuration errors.
2. Crashing containers.
3. Network problems.
or any other things.
But when Pod fails, "Readiness Probes" can help us out.
- They monitor Pod readiness before sending traffic.
- Kubelet detects readiness probe failures.
- And then "API Server" is updated.
Alright.
Let's assume:
A Pod is not ready to get traffic.
Who makes changes to service endpoint?
1. It's the Service Controller.
2. It notices changes of Pods that are not ready.
3. It then continues to update the service endpoints.
Meanwhile; Services can use the endpoint information
to route traffic only to the healthy pods.
Smart, isn't it?
That's it for today.
Repost this β»οΈ It might help someone out there!
I'm
. Follow me for Kubernetes, Devops and tech content.Thank you so much for reading this. If you found it interesting, do spread the word about it. You may also find my other content interesting, find them below.
A couple of things missing from this description that might help a reader.
The readiness probe is supposed to account for an application not being ready to serve a request when it is launched.
Think of an application loading data from a disk or just taking a couple of seconds to initialise.
That's why it has a parameter `initialDelaySeconds` that only check for readiness after a certain number of seconds.
If a pod is not ready, it won't receive traffic but the controller won't do anything else about it.
There are other probes like the Liveness probe. This probe checks instead if the application is running and healthy and if not it restarts the pod.