CFN Cloud
Cloud Future New Life
en zh
2025-10-15 · 0 views

Probes

Tell Kubernetes when an app is ready or needs a restart.

Probes decide whether a Pod should receive traffic or be restarted.

Three types

  • readiness: can it receive traffic
  • liveness: should it restart
  • startup: protect slow startup

Example

readinessProbe:
  httpGet:
    path: /readyz
    port: 8080
  periodSeconds: 5
livenessProbe:
  httpGet:
    path: /livez
    port: 8080
  periodSeconds: 10

Common pitfalls

  • Using liveness as a traffic switch
  • Timeouts that are too short

Practical notes

  • Start with a quick inventory: kubectl get nodes, kubectl get pods -A, and kubectl get events -A.
  • Compare desired vs. observed state; kubectl describe usually explains drift or failed controllers.
  • Keep names, labels, and selectors consistent so Services and controllers can find Pods.

Quick checklist

  • The resource matches the intent you described in YAML.
  • Namespaces, RBAC, and images are correct for the target environment.
  • Health checks and logs are in place before promotion.

References