A readiness probe checks if a container is ready to accept traffic. It helps Kubernetes know when to send requests to the container.
Click to reveal answer
beginner
How does Kubernetes use readiness probes in managing pods?
Kubernetes uses readiness probes to decide if a pod should receive traffic. If the probe fails, the pod is removed from the service endpoints until it passes again.
Click to reveal answer
intermediate
Name three types of readiness probes supported by Kubernetes.
Kubernetes supports HTTP GET, TCP socket, and command execution probes for readiness checks.
Click to reveal answer
intermediate
What happens if a readiness probe fails continuously?
If a readiness probe fails continuously, Kubernetes stops sending traffic to the pod but does not restart it. The pod stays running but is marked as not ready.
Click to reveal answer
beginner
Why is a readiness probe different from a liveness probe?
A readiness probe checks if a pod can receive traffic, while a liveness probe checks if a pod is alive and should be restarted if it fails.
Click to reveal answer
What does a readiness probe in Kubernetes do?
AChecks if a container is ready to accept traffic
BRestarts a container if it crashes
CMonitors CPU usage of a container
DScales the number of pods automatically
✗ Incorrect
A readiness probe checks if a container is ready to accept traffic so Kubernetes knows when to route requests.
Which of these is NOT a type of readiness probe?
AHTTP GET
BMemory usage check
CCommand execution
DTCP socket
✗ Incorrect
Memory usage check is not a readiness probe type. Kubernetes supports HTTP GET, TCP socket, and command execution probes.
If a readiness probe fails, what does Kubernetes do?
ADeletes the pod
BRestarts the pod immediately
CStops sending traffic to the pod
DScales up the pod count
✗ Incorrect
Kubernetes stops sending traffic to the pod but keeps it running if the readiness probe fails.
How is a readiness probe different from a liveness probe?
AReadiness probe restarts pods, liveness probe does not
BThey are the same
CLiveness probe checks traffic readiness, readiness probe checks CPU
DReadiness probe checks if pod can receive traffic, liveness probe checks if pod is alive
✗ Incorrect
Readiness probes check if a pod can receive traffic; liveness probes check if a pod is alive and should be restarted.
Which Kubernetes object uses readiness probes to manage traffic routing?
AService
BPod
CConfigMap
DNamespace
✗ Incorrect
Services use readiness probe results to decide which pods receive traffic.
Explain what a readiness probe is and why it is important in Kubernetes.
Think about how Kubernetes decides if a pod can handle requests.
You got /3 concepts.
Describe the types of readiness probes and how Kubernetes reacts when a readiness probe fails.
Consider the methods Kubernetes uses to check pod readiness and the impact of failure.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of a readiness probe in Kubernetes?
easy
A. To tell Kubernetes when a container is ready to receive traffic
B. To restart a container if it crashes
C. To monitor the CPU usage of a container
D. To update the container image automatically
Solution
Step 1: Understand readiness probe role
A readiness probe checks if a container is ready to accept requests, preventing traffic to unready containers.
Step 2: Compare with other options
Other options describe different Kubernetes features: restarts (liveness probe), monitoring (metrics), and updates (deployments).
Final Answer:
To tell Kubernetes when a container is ready to receive traffic -> Option A
Quick Check:
Readiness probe = container readiness [OK]
Hint: Readiness probe controls traffic flow to containers [OK]
Common Mistakes:
Confusing readiness probe with liveness probe
Thinking readiness probe restarts containers
Assuming readiness probe monitors resource usage
2. Which of the following is a valid way to define a readiness probe in a Kubernetes pod spec?
easy
A. readinessProbe:
httpGet:
path: /health
port: 8080
B. readinessProbe:
restartPolicy: Always
C. readinessProbe:
exec:
command: ["curl", "-f", "http://localhost:8080"]
D. readinessProbe:
tcpSocket:
port: 8080
Solution
Step 1: Review readiness probe types
Valid readiness probes include httpGet, tcpSocket, and exec commands.
Step 2: Check syntax correctness
readinessProbe:
httpGet:
path: /health
port: 8080 is now correctly indented. readinessProbe:
exec:
command: ["curl", "-f", "http://localhost:8080"] uses exec with correct command syntax as a list of strings. readinessProbe:
tcpSocket:
port: 8080 correctly defines tcpSocket with port. readinessProbe:
restartPolicy: Always is invalid because restartPolicy is not part of readiness probe.
Final Answer:
readinessProbe with tcpSocket and port -> Option D
Quick Check:
Valid readiness probe syntax = tcpSocket [OK]
Hint: Check indentation and valid probe keys for readiness probe [OK]
Common Mistakes:
Misplacing restartPolicy inside readinessProbe
Incorrect command format in exec probe
Wrong indentation causing YAML errors
3. Given this readiness probe configuration in a pod spec:
But Kubernetes always marks the pod as not ready. What is the most likely cause?
medium
A. The exec command syntax is invalid
B. The file /tmp/ready does not exist or is empty
C. initialDelaySeconds is too short
D. periodSeconds is too long
Solution
Step 1: Understand exec readiness probe behavior
The exec probe runs the command; it expects a zero exit code for success. If the file /tmp/ready does not exist, cat returns non-zero, causing failure.
Step 2: Check other options
Command syntax is valid. Timing values affect delay but not constant failure. So the missing or unreadable file is the cause.
Final Answer:
The file /tmp/ready does not exist or is empty -> Option B
5. You want to ensure your web server container only receives traffic after it finishes loading configuration and opens port 8080. Which readiness probe setup best achieves this?
hard
A. Use an exec readiness probe that runs a script checking config file and port status
B. Use an HTTP GET readiness probe on path /health with periodSeconds set to 1
C. Use a TCP socket readiness probe on port 8080 with initialDelaySeconds set to 10
D. Use a liveness probe instead of readiness probe to check port 8080
Solution
Step 1: Analyze readiness probe requirements
The container must be ready only after config is loaded and port is open. TCP socket or HTTP GET alone cannot check config loading.
Step 2: Evaluate probe options
Use a TCP socket readiness probe on port 8080 with initialDelaySeconds set to 10 checks only port open after delay, Use an HTTP GET readiness probe on path /health with periodSeconds set to 1 checks HTTP path frequently but not config. Use an exec readiness probe that runs a script checking config file and port status runs a script that can verify both config and port, making it the best choice. Use a liveness probe instead of readiness probe to check port 8080 is wrong because liveness probes do not control traffic routing.
Final Answer:
Use an exec readiness probe that runs a script checking config file and port status -> Option A
Quick Check:
Complex readiness checks need exec probe [OK]
Hint: Use exec probe for multi-condition readiness checks [OK]
Common Mistakes:
Using liveness probe instead of readiness probe
Relying only on TCP or HTTP probes for config readiness
Ignoring initialDelaySeconds impact on readiness
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.