Microsoft Certified: DevOps Engineer ExpertImplement a Site Reliability Engineering (SRE) strategyMedium

A DevOps team is implementing a health monitoring strategy for a new critical microservice deployed on Azure Kubernetes Service (AKS). They want to ensure that the service is not only running but also capable of processing requests correctly. Which type of probe should they configure in their Kubernetes deployment to check if the application inside the container is ready to serve traffic and remove it from the service load balancer if it becomes unresponsive?

  1. AStartup Probe
  2. BPreStop Hook
  3. CReadiness Probe
  4. DLiveness Probe
Show answer & explanation

Correct answer: C. Readiness Probe

A Readiness Probe is designed to check if a container is ready to serve traffic. If it fails, Kubernetes removes the pod's IP address from the endpoints of all services, effectively taking it out of the load balancer rotation until it becomes ready again.

Why the other options are wrong

  • A. Startup Probes are used to detect if an application has successfully started, especially for slow-starting applications, before Liveness and Readiness probes take over.
  • B. PreStop Hooks are executed just before a container is terminated, which is not related to health checks for serving traffic.
  • D. Liveness Probes determine if a container is running. If it fails, Kubernetes restarts the container, which is not the goal of temporarily removing it from the load balancer.

Kubernetes Readiness Probe

A mechanism in Kubernetes to determine if a container is ready to serve requests. If it fails, the pod is removed from service load balancing.

  • Ensures traffic is only sent to healthy instances.
  • Can be HTTP, TCP, or command-based.
  • Prevents traffic from being routed to a pod that is still initializing or temporarily unhealthy.

Memory trick: Probes: Kubernetes' way of checking if your app is alive, ready, or just starting up.

More Implement a Site Reliability Engineering (SRE) strategy questions