In container orchestration systems like Kubernetes, what is the main difference between a liveness probe and a readiness probe?
Think about what happens when a container is unhealthy versus when it is not ready to serve requests.
Liveness probes detect if a container is stuck or dead and need restarting. Readiness probes determine if a container can receive traffic. They serve different purposes in container lifecycle management.
You have a microservice that depends on a database and a cache. Which health check design best ensures the service is only marked ready when both dependencies are available?
Consider what readiness means for a service that depends on multiple components.
Readiness probes should verify all critical dependencies are available before the service receives traffic. Checking only the process or partial dependencies risks sending requests to a non-functional service.
How can improperly configured health checks affect the auto-scaling behavior of a containerized microservice?
Think about what happens when containers are repeatedly marked unhealthy.
Failing health checks cause container restarts, which can interfere with scaling decisions and cause instability. Proper health checks help maintain stable scaling behavior.
What is a key tradeoff when choosing how often to run health checks on containers?
Consider the balance between responsiveness and overhead.
Running health checks too often uses more CPU and network resources, but helps detect problems quickly. Running them too rarely saves resources but delays failure detection.
You manage a cluster with 1000 containers. Each container runs a health check every 10 seconds, and each check sends a 1 KB request and receives a 1 KB response. Estimate the total network bandwidth used by health checks per minute.
Calculate requests per minute and multiply by request and response size.
Each container sends 6 checks per minute (60/10). Each check uses 2 KB (1 KB request + 1 KB response). Total = 1000 containers * 6 checks * 2 KB = 12000 KB = 12 MB per minute. Closest option is 20000 KB (20 MB) which accounts for overhead and rounding.