Kube-probe is a diagnostic tool used in Kubernetes to monitor the health of containers. It helps ensure that applications are running smoothly by performing periodic checks, known as probes, on the containers. These probes can be of three types: liveness, readiness, and startup. Each type serves a different purpose in maintaining the application's lifecycle and availability.
One common symptom encountered when using Kube-probe is the error message: Exec probe failed: command not found
. This indicates that the command specified in the exec probe is not recognized within the container's environment, leading to a failure in executing the probe.
The error occurs when the command defined in the exec probe is not installed or not available in the container's PATH
. This can happen if the container image does not include the necessary binaries or if the PATH
environment variable is not correctly set.
When this error occurs, Kubernetes may consider the container unhealthy, potentially leading to restarts or preventing the container from receiving traffic, depending on the type of probe that fails.
First, ensure that the command is installed in the container. You can do this by accessing the container's shell and running the command manually:
kubectl exec -it <pod-name> -- /bin/sh
# Check if the command is available
which <command-name>
If the command is not found, you may need to install it or use a different base image that includes the command.
Ensure that the command is located in a directory listed in the PATH
environment variable. You can check the PATH
by running:
echo $PATH
If the directory containing the command is not in the PATH
, you can modify the Dockerfile to include it:
ENV PATH="/your/custom/path:$PATH"
For more information on configuring probes in Kubernetes, refer to the official Kubernetes documentation. If you need guidance on modifying Docker images, check out the Dockerfile best practices.
By following these steps, you can resolve the 'Exec probe failed: command not found' error and ensure that your Kubernetes applications remain healthy and responsive.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)