|
| 1 | +# pdbblockingnodedrain Investigation |
| 2 | + |
| 3 | +Investigates PodDisruptionBudgets (PDBs) blocking node drain during HCP cluster upgrades, |
| 4 | +triggered by the `HCPNodepoolUpgradeDelay` alert. |
| 5 | + |
| 6 | +When a node drain stalls during an upgrade, this investigation identifies which PDBs are |
| 7 | +blocking eviction, classifies them as customer-managed or platform-managed, and assesses |
| 8 | +whether scaling can resolve the issue without requiring a PDB change. |
| 9 | + |
| 10 | +## Investigation Flow |
| 11 | + |
| 12 | +| # | Check | Description | Type | |
| 13 | +|---|-------|-------------|------| |
| 14 | +| 1 | **Draining nodes** | Lists all nodes with the `node.kubernetes.io/unschedulable` taint and flags those stalled longer than 10 minutes | Informational | |
| 15 | +| 2 | **Blocking PDBs** | Enumerates PDBs with `disruptionsAllowed=0` whose selected pods are on stalled nodes; resolves owner workloads (Deployment, StatefulSet, etc.) and classifies each PDB as customer-managed or platform-managed based on namespace | Informational | |
| 16 | +| 3 | **Scaling assessment** | For each blocking PDB, compares `minAvailable`/`maxUnavailable` against healthy replica count to determine if scaling up the workload would unblock the drain | Informational | |
| 17 | + |
| 18 | +If no stalled nodes are found, the investigation silences the alert. Otherwise, it escalates |
| 19 | +to SRE with all collected findings. |
| 20 | + |
| 21 | +## Design Decisions |
| 22 | + |
| 23 | +### Eviction event correlation not implemented |
| 24 | + |
| 25 | +The Jira ticket (ROSAENG-14105) originally called for correlating eviction failure events |
| 26 | +(e.g. "Cannot evict pod", "disruption budget") with stalled nodes. Testing showed these |
| 27 | +events are produced by the drain controller on the management cluster, not on the service |
| 28 | +cluster. Accessing MC events would require RHOBS integration (blocked by ROSAENG-15920) and |
| 29 | +MC-to-RHOBS log forwarding on staging (not yet available). The blocking PDB check (step 2) |
| 30 | +already provides definitive detection without events: if a PDB has `disruptionsAllowed=0` and |
| 31 | +its pods are on a draining node, it is the blocker. |
| 32 | + |
| 33 | +## Architecture |
| 34 | + |
| 35 | +Single-phase resource build: `rb.WithCluster().WithK8sClient().WithNotes().Build()` |
| 36 | + |
| 37 | +All checks run against the service cluster K8s API using controller-runtime's client. |
| 38 | + |
| 39 | +### Platform vs customer classification |
| 40 | + |
| 41 | +A PDB is classified as platform-managed if its namespace starts with `openshift-` or `kube-`, |
| 42 | +or is exactly `openshift` or `default`. All other namespaces are treated as customer-managed. |
| 43 | +This determines the remediation guidance (customer should fix vs. platform issue to escalate). |
| 44 | + |
| 45 | +## Testing |
| 46 | + |
| 47 | +Refer to the [testing README](./testing/README.md) for instructions on testing this investigation. |
0 commit comments