Which statement correctly describes the difference between liveness and readiness probes in microservices?
Think about what happens when a service is unhealthy versus when it is not ready to serve requests.
Liveness probes detect if a service is alive and restart it if it is not. Readiness probes check if the service is ready to receive traffic without restarting it.
You have a microservice that loads a large configuration file on startup and then serves requests. Which probe setup is best to ensure smooth traffic routing and automatic recovery?
Consider what happens if the service is running but not ready to serve requests.
The readiness probe ensures traffic is sent only after configuration is loaded. The liveness probe ensures the service is restarted if it crashes.
What is the likely impact if a readiness probe is misconfigured to always fail in a Kubernetes deployment with autoscaling?
Think about how readiness affects traffic routing and autoscaling decisions.
If readiness probe always fails, pods are marked not ready and do not receive traffic. Autoscaler may add more pods to handle traffic, causing resource waste.
What is a tradeoff when setting very frequent liveness and readiness probe intervals in a microservice?
Consider what happens when probes run too often versus too rarely.
Frequent probes detect failures faster but consume more resources. Less frequent probes save resources but delay detection.
A Kubernetes cluster runs 100 microservice pods. Each liveness probe sends a 1KB HTTP request every 10 seconds, and each readiness probe sends a 1KB HTTP request every 5 seconds. Estimate the total network bandwidth used by probes per minute.
Calculate requests per pod per minute, multiply by request size and number of pods.
Each pod sends 6 liveness probes (60/10) and 12 readiness probes (60/5) per minute. Total requests per pod = 18. Total KB per pod = 18 KB. For 100 pods = 1800 KB per minute.