What if your app could tell you when it's sick, all by itself?
Why Exec probe configuration in Kubernetes? - Purpose & Use Cases
Imagine you have a web app running in a container, and you want to check if it's healthy by manually logging into the container and running commands to see if it works.
This manual checking is slow, needs you to connect every time, and you might miss problems if you don't check often. It's easy to forget or make mistakes, causing downtime.
Exec probe configuration lets Kubernetes automatically run a command inside your container regularly to check if it is healthy. This way, the system knows when to restart or fix the app without you lifting a finger.
kubectl exec -it mypod -- curl http://localhost:8080/healthlivenessProbe:
exec:
command:
- curl
- -f
- http://localhost:8080/health
initialDelaySeconds: 10
periodSeconds: 5It enables automatic, reliable health checks inside containers, so your apps stay running smoothly without manual intervention.
A shopping website uses exec probes to check if its payment service is working. If the check fails, Kubernetes restarts the service instantly, avoiding lost sales.
Manual health checks are slow and error-prone.
Exec probes automate health checks by running commands inside containers.
This keeps apps healthy and reduces downtime automatically.