docs: correct session disruption protection and expire_after tag - #368
Conversation
Two independent fixes in docs/infrastructure/kubernetes.md. Workbench sessions are protected from node reclamation by a PodDisruptionBudget that team-operator creates (<component>-sessions, maxUnavailable: 0), not by a karpenter.sh/do-not-disrupt annotation. That annotation is set nowhere in this repo. The PDB works identically on Karpenter (EKS) and cluster-autoscaler (AKS), since both drain via the standard Kubernetes Eviction API, which the API server enforces against PDBs -- so the mechanism is not Karpenter-specific. Also fix the KarpenterNodePool YAML tag in examples and prose: the docs wrote expireAfter, but the struct tag in lib/types/workload.go is expire_after.
|
Claude finished @Lytol's task in 35s —— View job PR Review
Both changes are accurate and the PR description is well-documented. Verification:
One minor nit on the session protection prose (line 299): The new paragraph is accurate but dense for a documentation page. The sentence "Karpenter drains nodes through the standard Kubernetes Eviction API, which the API server enforces against PDBs, so a Everything else looks good. The summary line at 159 (cloud-neutral, links to the detail section) and the full explanation at 299 complement each other well. |
Description
Two independent documentation fixes in
docs/infrastructure/kubernetes.md.1. Session disruption protection was described incorrectly
Lines 159 and 299 claimed Workbench sessions are protected from node reclamation by the
karpenter.sh/do-not-disrupt: "true"annotation. That annotation is set nowhere in this repository —grep -rn "do-not-disrupt" .matched only those two doc lines.The real mechanism is a PodDisruptionBudget created by team-operator:
<component>-sessions(e.g.main-workbench-sessions),maxUnavailable: 0, in theposit-teamnamespace, selecting that product's launcher-created pods.Crucially this is not Karpenter-specific. Both Karpenter and cluster-autoscaler drain nodes through the standard Kubernetes Eviction API (
pods/eviction), which the API server itself enforces against PDBs. The same PDB protects sessions identically on EKS and AKS. The previous text implied AKS clusters had no equivalent protection, which was misleading.This was verified empirically, not just by reading code: a server-side dry-run Eviction against a live session pod returns
429 TooManyRequests—"Cannot evict pod as it would violate the pod's disruption budget."Line 159 is a one-line summary in a section covering both clouds, so it is kept short and cloud-neutral with a link to the detailed passage. Line 299 sits under the Karpenter consolidation section where surrounding detail warranted a fuller explanation.
2.
expireAfter→expire_afterThe YAML examples and prose used
expireAfter, but the actual struct tag onKarpenterNodePoolinlib/types/workload.goisexpire_after. Anyone copying these examples would have had the field silently ignored.Fixed in five places (three YAML examples at lines 32, 176, 400; prose at 199 and 390) — three more than initially spotted. All other field names in those examples were checked against
KarpenterNodePool,KarpenterRequirement,KarpenterNodePoolLimitsandKarpenterTaint; no other mismatches found.Note
lib/steps/helm_aws.go:1535setsnodepoolSpec[...]["expireAfter"]— that is correct as-is, being the upstream Karpenter CRD's own camelCase field, distinct from ptd.yaml's snake_case config key.Category of change