mediumMultiple ChoiceObjective-mapped
Google ACE Practice Question: A team wants to automatically restart any GKE Pod…
A team wants to automatically restart any GKE Pod that fails a liveness probe three consecutive times. The probe should check HTTP GET /healthz on port 8080, starting after 30 seconds and checking every 10 seconds. Which Pod spec configuration implements this?
⚠ Common exam trap
Google Cloud often tests the distinction between readinessProbe and livenessProbe, trapping candidates who confuse 'restart on failure' with 'stop sending traffic on failure'.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 30 periodSeconds: 10 failureThreshold: 3
A livenessProbe with an HTTP GET on /healthz at port 8080, configured with initialDelaySeconds: 30, periodSeconds: 10, and failureThreshold: 3, will cause the kubelet to restart the Pod after three consecutive failed checks. This directly matches the requirement to restart on liveness probe failures, as liveness probes are specifically designed to determine if a container should be restarted.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
readinessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 30 periodSeconds: 10 failureThreshold: 3
Why it's wrong here
A readinessProbe controls whether a pod receives traffic by adding or removing it from Service endpoints, but it does not initiate a container restart. If the /healthz check fails, the pod is simply marked NotReady and its IP is removed from the load-balancing set, leaving the container running and possibly in a stuck state. Therefore, even with the same httpGet, delay, period, and threshold values, this probe would not satisfy the requirement to restart the container.
- ✓
livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 30 periodSeconds: 10 failureThreshold: 3
Why this is correct
This is the correct configuration because a livenessProbe is the Kubernetes mechanism that determines whether a container is still healthy after it has started. The httpGet hits /healthz on port 8080 after a 30-second initial delay, then every 10 seconds; when the probe fails three consecutive times, the kubelet kills the container and restarts it according to the pod's restartPolicy. That exactly matches the requirement to restart a container that is running but has become unhealthy.
- ✗
startupProbe: httpGet: path: /healthz port: 8080 failureThreshold: 3
Why it's wrong here
A startupProbe is evaluated only during the initial startup phase, not continuously throughout the container's lifetime. Its purpose is to delay liveness and readiness probes for slow-starting applications; once it succeeds, it is disabled. While a failing startupProbe could trigger a restart, it would catch problems that occur before the app is ready, not the later unresponsiveness described in the scenario. Using it here would misclassify the failure and not provide ongoing health checks.
- ✗
lifecycle: postStart: httpGet: path: /healthz port: 8080
Why it's wrong here
A postStart lifecycle hook executes exactly once, immediately after the container is created, to perform an initialization action. An HTTP GET to /healthz at that single moment cannot provide continuous health monitoring, and even if the request fails, Kubernetes does not restart the container based on a lifecycle hook result. This option is therefore unrelated to detecting an unresponsive application during runtime.
Go deeper
Related to this question
Learn chapter
Artifact Registry and Container Management
Key term
Container
A container is a lightweight, standalone software package that includes everything needed to run an application, such as code, runtime, system tools, and libraries.
Key term
Pod
A pod is the smallest deployable unit in Kubernetes, containing one or more containers that share storage, network, and a specification for how to run.
About these practice questions
One of 769 original ACE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.