Skip to main content

More Info:

Advisory: long-running containers should define livenessProbe and readinessProbe so Kubernetes can restart hung pods and keep traffic off pods that are not ready.

Risk Level

Informational

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. Identify long-running pods and candidate containers
    • On any machine with kubectl access:
    • Focus on:
      • Workload pods (Deployments, StatefulSets, DaemonSets, Jobs that run indefinitely).
      • Exclude obviously short-lived Jobs/CronJobs and completed pods.
  2. Inspect existing probes on target pods
    • For each candidate pod, inspect its spec:
    • Under .spec.containers[].livenessProbe and .spec.containers[].readinessProbe, verify that:
      • Both probes exist.
      • The command or HTTP/TCP/GRPC check is appropriate for determining health/readiness.
  3. Locate and edit the owning workload manifest
    • Determine the owner (e.g., Deployment, StatefulSet) for pods missing probes:
    • Fetch the current manifest for editing:
    • In /tmp/<kind>-<name>.yaml, under each long-running container in spec.template.spec.containers[], add or refine livenessProbe and readinessProbe per the application’s behavior (e.g., HTTP GET on a health endpoint, exec check, or TCP socket).
  4. Apply the updated workload manifests
    • On any machine with kubectl access, apply the edited manifest:
    • Be aware: updating a Pod template will trigger a rollout; pods will be recreated. Confirm this is acceptable or coordinate a maintenance window.
  5. Verify probes are present and functioning
    • After rollout completes, confirm probes on the new pods:
    • Check probe status and events for failures:
  6. Document exceptions for workloads without probes
    • For any container where probes are intentionally omitted (e.g., very short-lived Jobs), record:
      • Workload name, namespace, and rationale.
      • Evidence of behavior:
    • Store this documentation in your configuration/IaC repo or security exception register.
Look for long-running workloads (services, APIs, workers, cron controllers, etc.) as candidates to review. Short-lived batch jobs may reasonably not use probes.
In the spec.containers[] section of the output, inspect each container:
  • Problem indication: livenessProbe is missing or empty.
  • Problem indication: readinessProbe is missing or empty.
  • These fields must be under each container, not just in initContainers.
Interpretation:
  • Each line is a pod with at least one issue.
  • liveness_missing=true: none of the containers in this pod define a livenessProbe.
  • readiness_missing=true: none of the containers in this pod define a readinessProbe.
  • These pods need human review to decide whether probes are appropriate for each container.
Again, inspect spec.template.spec.containers[]:
  • Problem: long-running containers under this controller lack livenessProbe and/or readinessProbe.
  • Fix decisions should be made here (Deployment/StatefulSet/DaemonSet spec), then applied via your normal GitOps/manifest process.
How to interpret the output:
  • Any line where HAS_LIVENESS is false indicates a container without a livenessProbe.
  • Any line where HAS_READINESS is false indicates a container without a readinessProbe.
  • Focus review on long-running applications; short-lived batch/Job pods may legitimately omit probes.
  • Use the OWNER column to locate and update the underlying controller manifest (e.g., Deployment) rather than editing individual pods.