Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

What are typical values for readiness and liveness probe configurations, and how do you determine them?

Health probes in OpenShift/Kubernetes control when a pod is considered ready to receive traffic and when it should be restarted. The values you tune for readiness and liveness probes—InitialDelaySeconds, PeriodSeconds, TimeoutSeconds, and the thresholds (failureThreshold and, for readiness, successThreshold)—determine how quickly the system detects startup issues or run-time problems and how tolerant it is of transient delays. These fields map directly to how the app behaves. InitialDelaySeconds gives the app time to initialize before probes start, which is essential if the service needs a warm-up. PeriodSeconds sets how often probes run, balancing rapid detection with probe overhead. TimeoutSeconds specifies how long to wait for a probe response before counting it as a failure, so it should reflect the typical response time of your health check. Thresholds define how many consecutive probe successes or failures are required before the pod state changes: failureThreshold indicates how many consecutive failures trigger a restart or a not-ready state, while successThreshold (primarily relevant for readiness) determines how many consecutive successes are needed after a previous failure to mark the pod as ready again. To determine good values, observe your app’s startup time and normal response times. If the app needs 6 seconds to become fully initialized, you might set initialDelaySeconds around 6. Choose periodSeconds to provide timely fault detection without excessive probing—perhaps 5–10 seconds for a fast-moving service. Set timeoutSeconds to a bit above the typical probe response time, such as 1–2 seconds, so you don’t prematurely fail due to occasional slow responses. For thresholds, a common starting point is a few consecutive failures (e.g., 3) to avoid flapping, with a single consecutive success often enough for readiness after a failure. Adjust these values based on observed startup behavior and the rate of transient issues in your environment.

Health probes in OpenShift/Kubernetes control when a pod is considered ready to receive traffic and when it should be restarted. The values you tune for readiness and liveness probes—InitialDelaySeconds, PeriodSeconds, TimeoutSeconds, and the thresholds (failureThreshold and, for readiness, successThreshold)—determine how quickly the system detects startup issues or run-time problems and how tolerant it is of transient delays.

These fields map directly to how the app behaves. InitialDelaySeconds gives the app time to initialize before probes start, which is essential if the service needs a warm-up. PeriodSeconds sets how often probes run, balancing rapid detection with probe overhead. TimeoutSeconds specifies how long to wait for a probe response before counting it as a failure, so it should reflect the typical response time of your health check. Thresholds define how many consecutive probe successes or failures are required before the pod state changes: failureThreshold indicates how many consecutive failures trigger a restart or a not-ready state, while successThreshold (primarily relevant for readiness) determines how many consecutive successes are needed after a previous failure to mark the pod as ready again.

To determine good values, observe your app’s startup time and normal response times. If the app needs 6 seconds to become fully initialized, you might set initialDelaySeconds around 6. Choose periodSeconds to provide timely fault detection without excessive probing—perhaps 5–10 seconds for a fast-moving service. Set timeoutSeconds to a bit above the typical probe response time, such as 1–2 seconds, so you don’t prematurely fail due to occasional slow responses. For thresholds, a common starting point is a few consecutive failures (e.g., 3) to avoid flapping, with a single consecutive success often enough for readiness after a failure. Adjust these values based on observed startup behavior and the rate of transient issues in your environment.