Kubectl Probes
Liveness, readiness, and startup probes that keep traffic healthy.
- liveness probe
- readiness probe
- startup probe
- health check
- probe failed
Kubectl Probes
Liveness, readiness, and startup probes that keep traffic healthy.
Commands
| Command | What it does | |
|---|---|---|
| `kubectl describe pod <p> | grep -A6 Probes` | Read configured probes |
| `kubectl get events --sort-by=.lastTimestamp | grep -i probe` | Probe failure history |
curl localhost:8080/healthz | Test the health endpoint manually | |
kubectl logs <p> --previous | Logs of the container probes killed |
Example
livenessProbe:
httpGet: {path: /healthz, port: 8080}
periodSeconds: 10
readinessProbe:
httpGet: {path: /readyz, port: 8080}
periodSeconds: 5
FAQ
liveness vs readiness?
Liveness restarts broken containers; readiness only removes them from service endpoints during warmup or trouble.
Why do probes flap after deploy?
Slow cold starts: add a startupProbe (or initialDelaySeconds) so liveness does not kill warming pods.
Întrebări frecvente
liveness vs readiness?
Liveness restarts broken containers; readiness only removes them from service endpoints during warmup or trouble.
Why do probes flap after deploy?
Slow cold starts: add a startupProbe (or initialDelaySeconds) so liveness does not kill warming pods.
Kubernetes
Kubectl Config and Context
Point kubectl at the right cluster and switch contexts safely.
Kubectl Pods
Inspect pods, describe failures, and get a shell inside.
Kubectl Deployments
Create, update, and inspect Deployments that own your pods.
Kubectl Services
Expose pods stably with ClusterIP, NodePort, and LoadBalancer.