Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You manage a Java microservice on Google Kubernetes Engine (GKE) experiencing intermittent CrashLoopBackOff events because kubelet restarts the container on failed livenessProbe checks.
You observe the following behavior:
livenessProbe: initialDelaySeconds: 20, periodSeconds: 5, timeoutSeconds: 1, failureThreshold: 3.Which probe configuration should you apply to prevent unnecessary container churn while maintaining timely failure detection?
livenessProbe and update it to initialDelaySeconds: 20, periodSeconds: 10, timeoutSeconds: 5, and failureThreshold: 7.This configuration keeps the initial delay at 20 seconds and attempts to cover the 80-second worst-case startup by raising failureThreshold to 7 at 10-second intervals (periodSeconds: 10), giving a total startup tolerance of 90 seconds (20 + 7 * 10), while increasing timeoutSeconds to 5.
livenessProbe parameters remain active for the entire lifetime of the container, failureThreshold: 7 with periodSeconds: 10 means a deadlocked container takes 70 seconds to restart—nearly double the required 30-to-40-second limit.kubelet intervenes.livenessProbe failureThreshold to absorb slow startup forces an equally long detection delay during steady-state operation.timeoutSeconds to 5 does absorb 3-second CPU delays, but at the expense of timely runtime recovery.Startup could take up to 90 seconds, no startupProbe could be used (such as on legacy Kubernetes clusters prior to startupProbe support), and a 70-second deadlock detection time were acceptable.
In modern GKE clusters, using failureThreshold on a livenessProbe to accommodate slow application startup is an anti-pattern. Defining a dedicated startupProbe allows a generous initialization window without sacrificing fast livenessProbe recovery once the service is running.
startupProbe with periodSeconds: 5, timeoutSeconds: 5, and failureThreshold: 18, and update the livenessProbe to initialDelaySeconds: 0, periodSeconds: 10, timeoutSeconds: 5, and failureThreshold: 3.Pairing a startupProbe with a tuned livenessProbe separates initialization protection from runtime health monitoring. In Kubernetes, kubelet holds off executing livenessProbe and readinessProbe checks until the startupProbe succeeds at least once, allowing each lifecycle phase to use independent timing and threshold parameters.
periodSeconds (5) by failureThreshold (18) grants up to 90 seconds for initialization. Because the probe runs every 5 seconds, a container that finishes booting in 30 seconds passes immediately rather than waiting a full 90 seconds.timeoutSeconds from 1 to 5 (while keeping it less than or equal to periodSeconds) prevents slow responses during CPU spikes from counting as probe failures.periodSeconds: 10 and failureThreshold: 3, a genuinely deadlocked application is detected and restarted in roughly 30 seconds without restarting on isolated transient blips.timeoutSeconds and failureThreshold values absorb brief CPU contention.timeoutSeconds does not exceed periodSeconds, avoiding overlapping or rejected checks.Unlike inflating initialDelaySeconds or failureThreshold on a livenessProbe alone, using a startupProbe avoids both early runtime blind spots and sluggish deadlock recovery. It achieves the lowest possible container churn while honoring the 30-to-40-second failure detection window.
livenessProbe and update it to initialDelaySeconds: 90, periodSeconds: 5, timeoutSeconds: 1, and failureThreshold: 1.This configuration delays the first livenessProbe check until 90 seconds after container start and instructs kubelet to restart the container immediately after a single failed probe (failureThreshold: 1) with a 1-second timeout (timeoutSeconds: 1).
timeoutSeconds: 1 and failureThreshold: 1, any single 3-second CPU spike causes kubelet to immediately kill and restart a healthy container.initialDelaySeconds: 90 forces Kubernetes to wait 90 seconds even when the application finishes starting in 30 seconds, leaving a 60-second blind spot if a deadlock happens shortly after boot.failureThreshold of 1 eliminates retry buffering against transient network, garbage collection, or CPU pauses.timeoutSeconds repeatedly fails when peak traffic delays responses up to 3 seconds.initialDelaySeconds cannot adapt when cold startup time varies between 30 and 80 seconds.CrashLoopBackOff risk: Frequent restarts under load quickly trigger exponential restart backoff delays.The application had a deterministic 90-second startup time, guaranteed sub-second health endpoint latency under all load conditions, and required immediate container termination upon any single missed check.
A common misconception is that lowering failureThreshold to 1 improves reliability by making failure detection faster. In practice, rapid failure detection must be balanced with probe tolerance (timeoutSeconds and failureThreshold) so brief resource contention does not destabilize healthy Pods.
readinessProbe with initialDelaySeconds: 80, periodSeconds: 10, timeoutSeconds: 5, and failureThreshold: 3, while keeping the livenessProbe unchanged.A readinessProbe tells Kubernetes whether a Pod is ready to receive client traffic from Services and load balancers. When a readinessProbe fails, kubelet marks the Pod as NotReady and removes its endpoint from load balancing without restarting the container.
livenessProbe remains unchanged (initialDelaySeconds: 20, periodSeconds: 5, timeoutSeconds: 1, failureThreshold: 3), kubelet still begins liveness checks at 20 seconds and restarts the container around 35 seconds, well before an 80-second startup completes.livenessProbe timeoutSeconds at 1 means 3-second CPU spikes during peak traffic continue to trigger unnecessary container restarts.readinessProbe does not delay or pause a livenessProbe; both run independently on their own schedules unless gated by a startupProbe.readinessProbe.initialDelaySeconds controls kubelet checks rather than the load balancer's own health check schedule.The goal were solely to stop Kubernetes Services from sending traffic to a Pod while it warms up a cache for 80 seconds, and the livenessProbe were not killing the container prematurely.
Confusing readinessProbe with startupProbe is a frequent mistake when troubleshooting CrashLoopBackOff events. Only a startupProbe (or adjusting livenessProbe parameters directly) prevents kubelet from terminating slow-starting containers.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated