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
InformationalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
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.
- On any machine with kubectl access:
-
Inspect existing probes on target pods
- For each candidate pod, inspect its spec:
- Under
.spec.containers[].livenessProbeand.spec.containers[].readinessProbe, verify that:- Both probes exist.
- The command or HTTP/TCP/GRPC check is appropriate for determining health/readiness.
- For each candidate pod, inspect its spec:
-
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 inspec.template.spec.containers[], add or refinelivenessProbeandreadinessProbeper the application’s behavior (e.g., HTTP GET on a health endpoint, exec check, or TCP socket).
- Determine the owner (e.g., Deployment, StatefulSet) for pods missing probes:
-
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.
- On any machine with kubectl access, apply the edited manifest:
-
Verify probes are present and functioning
- After rollout completes, confirm probes on the new pods:
- Check probe status and events for failures:
- After rollout completes, confirm probes on the new pods:
-
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.
- For any container where probes are intentionally omitted (e.g., very short-lived Jobs), record:
Using kubectl
Using kubectl
spec.containers[] section of the output, inspect each container:- Problem indication:
livenessProbeis missing or empty. - Problem indication:
readinessProbeis missing or empty. - These fields must be under each container, not just in initContainers.
- 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.
spec.template.spec.containers[]:- Problem: long-running containers under this controller lack
livenessProbeand/orreadinessProbe. - Fix decisions should be made here (Deployment/StatefulSet/DaemonSet spec), then applied via your normal GitOps/manifest process.
Automation
Automation
- Any line where
HAS_LIVENESSisfalseindicates a container without alivenessProbe. - Any line where
HAS_READINESSisfalseindicates a container without areadinessProbe. - Focus review on long-running applications; short-lived batch/Job pods may legitimately omit probes.
- Use the
OWNERcolumn to locate and update the underlying controller manifest (e.g., Deployment) rather than editing individual pods.

