liveness probe
A health check that answers only whether a process is alive enough to keep running; if it keeps failing, the orchestrator, such as Kubernetes, restarts it.
Checking dependencies in liveness can restart every pod at once during a brief outage.
In more detail
It should fail only for problems a restart can fix, such as a stuck process. Keep dependency checks out of it, or a database outage restarts every instance at once.
Examples
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 5Go: a small /health handler that writes okRelated terms
- readiness probe — A check that decides whether a pod should receive traffic right now; failing it removes the pod from its Service without restarting it.
- health check — A regular automated test of whether a program or service is working, such as a request to its health endpoint or a command run inside its container.
- restart policy — A setting that tells Docker or Kubernetes whether to start a container again automatically after it exits.
- Kubernetes — An open-source system that runs and manages containers across a cluster of machines.
- container orchestrator — A system that decides where containers run and keeps them running, restarting, scaling and replacing them automatically.
- startup probe — A check Kubernetes runs only while a container is starting, holding off the other probes until it passes.
- cascading failure — A failure in one part of a system that overloads or breaks the parts around it, spreading until much more is down.
- deadlock — A state where two or more pieces of work each wait for the other forever, so none can continue.
- health endpoint — A web address, often /health, that a service answers quickly to show it is up.
- container probe — A regular check the kubelet runs against a container, such as an HTTP request or a command, to decide whether it is started, ready or alive.
- CrashLoopBackOff — A container status meaning the container keeps exiting after it starts, so the kubelet is waiting longer and longer before restarting it.
Related guides
Taught in
- Self-Healing And Autoscaling: Who Restarts, Who Replaces, Who Adds — Certified Kubernetes Administrator (CKA) Exam Prep
- Running, And Still Down — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Probes And Health Checks — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Observability: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Final Review: Where Your Marks Are At Risk — Certified Kubernetes Application Developer (CKAD) Exam Prep
- From Local Containers To Kubernetes — Docker Architecture & Production Containers
- Health Checks — Modern .NET Core, C# & Enterprise Microservices
- Health Probes & Graceful Shutdown: Kubernetes Lifecycles — Production Full-Stack Engineering
- Serving HTTP with net/http Server — Concurrent Systems Programming with Go
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration
- Control Plane: etcd, API Server, Scheduler, Controllers — Kubernetes: Production-Grade Container Orchestration
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Bootstrap A Local Cluster And Check Your Context — Kubernetes: Production-Grade Container Orchestration
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: Probes, Logs, exec And CrashLoopBackOff — Kubernetes: Production-Grade Container Orchestration
- Volumes, PersistentVolumes And PersistentVolumeClaims — Kubernetes: Production-Grade Container Orchestration
- etcd Snapshots And A Tested Restore — Kubernetes: Production-Grade Container Orchestration
References
- Health checks in ASP.NET Core
- Kubernetes: configure liveness, readiness and startup probes
- Health checks in ASP.NET Core
- Kubernetes: Liveness, readiness and startup probes