domino_admin_toolkit.checks.test_pod_health module
Pod Health Check — Owner-Aware Classification
Data source: Kubernetes API (cluster-wide pod listing, batch ReplicaSet/Job lookups for owner resolution).
Question answered: “Are there pods in the cluster with current platform degradation that requires operator attention?”
- Key design decisions (RE-3490):
Resolves pod → owner chain (RS→Deployment, Job→CronJob) so retained historical pods are not confused with active failures.
FAILs only on evidence of current platform/system degradation.
Retained terminal pods whose controller recovered are WARN.
Customer compute failures are WARN (not platform degradation).
Every result row carries a concrete message — never the blanket “Failed pods have been detected.”
- See also:
test_dmm_pods_list.py — DMM-specific pod presence check
test_kube_events.py — event-level analysis (ImagePullBackOff, registry auth)
test_kubernetes.py:test_node_health — node-level conditions
test_kubernetes.py:test_container_restarts — restart frequency analysis
- pydantic model domino_admin_toolkit.checks.test_pod_health.PodHealthAnalyzer
Bases:
DataFrameAnalyzerBaseOwner-aware pod health classification.
The fixture only contains unhealthy pods (Running+Ready are dropped), so this analyzer never sees healthy siblings. For controller-managed Failed pods it uses a count heuristic: a single Failed pod with no waiting reason is treated as retained history (WARN); two or more Failed pods under the same owner are treated as current degradation.
- Severity rules:
- FAIL — current platform/system degradation:
Platform pod Pending >30 min.
Platform pod with an actionable waiting reason (CrashLoopBackOff, etc.).
Platform pod Failed with no controller (nothing will replace it).
Two or more Failed pods under the same controller.
Job pod whose owning Job is currently Failed.
Platform pod Running-not-Ready >30 min.
- WARN — retained history, startup, or non-platform:
Single Failed pod under a controller (likely retained).
Compute-namespace failures.
Evicted / NodeShutdown pods.
Terminating pods (deletion_timestamp set).
Running-not-Ready within the 30 min startup window.
- PASS:
Pending within the 30 min startup window.
- ERROR — unknown state (not false PASS):
Unclassified phase / unexpected data.
Job pod whose Job list call failed (status could not be determined).
- Fields:
- analyze(data)
Analyzes the full DataFrame and returns a list of CheckResult instances.
- Return type:
- Args:
data: The full DataFrame. Called once per
check_df()invocation.- Returns:
List[CheckResult]: A list containing the results of the analysis.
- Raises:
NotImplementedError: If this method is not implemented by subclasses.
- name: ClassVar[str] = 'PodHealthAnalyzer'
- domino_admin_toolkit.checks.test_pod_health.pod_health_data(k8s_client, platform_namespace, kube_system_namespace, domino_system_namespace)
Cluster-wide pod health DataFrame with resolved owners.
- domino_admin_toolkit.checks.test_pod_health.test_pod_health(pod_health_data, runner)
- Description:
Validates pod health across the cluster with owner-aware classification. Resolves pod ownership chains (ReplicaSet→Deployment, Job→CronJob) to distinguish current degradation from retained historical pods.
- Failure Conditions:
Kubernetes API list_pods failure (ERROR — not treated as a healthy cluster)
Platform pod in CrashLoopBackOff / ImagePullBackOff
Platform pod Pending >30 minutes with scheduling failure
Platform pod Failed with no controller (e.g. helm hook) or no healthy replacement
Platform Job pod whose owning Job is currently Failed
Job pod whose Job list call failed (ERROR — status could not be determined)
Platform pod Running but not Ready for >30 minutes
- Troubleshooting Steps:
Check the output table for FAIL rows — each row has namespace, pod, owner, and reason
kubectl describe pod -n <namespace> <pod-name>
kubectl get events -n <namespace> –field-selector involvedObject.name=<pod-name>
For scheduling failures: kubectl describe node <node-name> (check taints, capacity)
- Resolution Steps:
CrashLoopBackOff: inspect logs — kubectl logs -n <namespace> <pod-name> –tail=200
Scheduling failures: check node capacity, taints, resource requests
Failed Jobs: inspect job spec, re-trigger — kubectl get job -n <namespace>
ImagePullBackOff: verify image exists and registry credentials are configured
- Required Permissions:
Platform admin (kubectl read on all namespaces)
- See also:
test_dmm_pods_list.py — DMM-specific pod presence check
test_kube_events.py — event-level analysis (ImagePullBackOff, registry auth)
test_kubernetes.py:test_node_health — node-level conditions
test_kubernetes.py:test_container_restarts — restart frequency analysis