0
0
Kubernetesdevops~5 mins

Exec probe configuration in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an exec probe in Kubernetes?
An exec probe runs a command inside a container to check if the container is healthy. If the command succeeds, the container is considered healthy.
Click to reveal answer
beginner
Which Kubernetes probe type uses a command to check container health?
The exec probe type uses a command executed inside the container to check its health.
Click to reveal answer
intermediate
How do you define an exec probe in a Pod YAML file?
You define an exec probe under the livenessProbe or readinessProbe section with a command list under exec, like: <br>
livenessProbe:
  exec:
    command: ["/bin/check.sh"]
  initialDelaySeconds: 5
  periodSeconds: 10
Click to reveal answer
beginner
What happens if the exec probe command fails?
If the exec probe command returns a non-zero exit code, Kubernetes considers the container unhealthy and may restart it depending on the probe type.
Click to reveal answer
intermediate
Why use exec probes instead of HTTP or TCP probes?
Exec probes allow custom health checks by running any command inside the container, useful when HTTP or TCP checks are not applicable.
Click to reveal answer
What does an exec probe do in Kubernetes?
ARuns a command inside the container to check health
BSends an HTTP request to the container
CChecks if a TCP port is open
DMonitors container CPU usage
Where do you specify the exec command in a Kubernetes probe?
AUnder env: variables: in container spec
BUnder httpGet: path: in livenessProbe
CUnder exec: command: in livenessProbe or readinessProbe
DUnder tcpSocket: port: in readinessProbe
What exit code from an exec probe command means the container is healthy?
A1
B0
CAny non-zero code
D255
If an exec probe fails repeatedly, what does Kubernetes do?
ARestarts the container
BIgnores the failure
CDeletes the Pod immediately
DScales the deployment up
Which probe type is best when you need to run a custom script inside the container?
ATCP probe
BHTTP probe
CNone of the above
DExec probe
Explain how to configure an exec probe in a Kubernetes Pod YAML file.
Think about where the exec command goes and timing settings.
You got /3 concepts.
    Describe what happens when an exec probe command fails in Kubernetes.
    Focus on exit codes and Kubernetes reaction.
    You got /3 concepts.