Challenge - 5 Problems
Exec Probe Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the result of this exec probe configuration?
Given the following Kubernetes pod YAML snippet, what will be the status of the exec probe if the command exits with code 1?
Kubernetes
livenessProbe:
exec:
command:
- /bin/sh
- -c
- exit 1
initialDelaySeconds: 5
periodSeconds: 10Attempts:
2 left
💡 Hint
Exec probes consider exit code 0 as success; any other code means failure.
✗ Incorrect
In Kubernetes exec probes, the command's exit code 0 means success. Any non-zero exit code means the probe failed, causing the container to be restarted if it's a liveness probe.
❓ Configuration
intermediate2:00remaining
Identify the correct exec probe configuration to check a file exists
Which exec probe configuration correctly checks if the file /tmp/healthy exists inside the container?
Attempts:
2 left
💡 Hint
Use a command that returns exit code 0 if the file exists.
✗ Incorrect
The 'test -f /tmp/healthy' command returns exit code 0 if the file exists, making it suitable for exec probes.
❓ Troubleshoot
advanced2:00remaining
Why does this exec probe always fail?
A pod has this exec probe:
livenessProbe:
exec:
command:
- /bin/false
initialDelaySeconds: 5
periodSeconds: 10
Why does the container keep restarting?
Attempts:
2 left
💡 Hint
Check the exit code behavior of /bin/false.
✗ Incorrect
/bin/false is a command that always exits with code 1, so the exec probe always fails, causing container restarts.
🔀 Workflow
advanced2:00remaining
Order the steps to add an exec readiness probe to a deployment
Put these steps in the correct order to add an exec readiness probe that checks if a service is ready:
Attempts:
2 left
💡 Hint
You must edit before applying, and verify last.
✗ Incorrect
First edit the YAML, then add the readinessProbe, apply changes, and finally verify pod status.
✅ Best Practice
expert2:00remaining
Which exec probe command is best for checking a web server health inside a container?
You want an exec probe to check if a web server inside the container is healthy by verifying port 8080 is open. Which command is best?
Attempts:
2 left
💡 Hint
Use a command that checks if a port is open without requiring HTTP response.
✗ Incorrect
'nc -z localhost 8080' checks if port 8080 is open and returns exit code 0 if yes, suitable for exec probes.