A licensing microservice needs a custom in-container check that runs a shell command and uses its exit code. Which probe handler fits?
Select an answer to reveal the explanation.
Short Explanation
Sometimes health isn’t an HTTP path—it’s ‘did this script exit cleanly?’ An exec probe runs your command in the container and passes on exit code 0. Keep the command light so probes don’t become the outage.
Full Explanation
A licensing microservice that needs a custom in-container check should use an exec probe that runs a shell command inside the container and treats exit code 0 as success. exec probes are the flexible CKAD tool for municipal apps whose health cannot be expressed as a simple HTTP path or TCP port—license daemons often expose CLI status commands precisely for this purpose.
Why the other options fail by concept: Only annotating the Pod with a human-readable health note does nothing for kubelet probing. httpGet to a random high port ignoring the body does not run the custom check. tcpSocket against the API server’s control-plane port from the Pod is unrelated to the licensing process health and is an anti-pattern.
Exam caveat: exec probes fork processes—avoid heavy checks at aggressive periods that starve the app CPU. Quote commands correctly as argv arrays in YAML. Ensure the command exists in minimal/distroless images or probes will fail permanently. Prefer dedicated health binaries over fragile shell pipelines when possible.
Operational check: Add exec.command for the license status CLI, apply, kubectl describe pod for probe success, then make the command fail in a test build and confirm readiness/liveness reactions match the intended thresholds.