feat(agent-lifecycle): k8s RuntimeDriver — projects Pod state onto the 6-state model - #148
Merged
Merged
Conversation
…e 6-state model studio#146 slice 1. `crates/agent-lifecycle/src/k8s.rs` mirrors `ecs.rs`'s shape (`K8sDriver`/`K8sPod` alongside `EcsDriver`/`EcsTask`), implementing `RuntimeDriver` for k8s per the already-approved ADR §6 projection table: Pod phase + readinessProbe → Starting/Running, `deletionTimestamp != null` → Stopping, `Unknown` phase (node lost) or CrashLoopBackOff → Unhealthy. This is a direct port of an existing design decision, not a new one — `k8s_driver.rs`'s module doc flagged this exact gap as deferred when the k8s `ProvisionDriver` write path landed (studio#63 slice 3b). 🤖 Generated with Claude Code
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
studio#146 slice 1 of 4 (k8s fleet roster/observe UI). Adds
crates/agent-lifecycle/src/k8s.rs, aRuntimeDriverimplementation for k8s mirroringecs.rs's shape (K8sDriver/K8sPodalongsideEcsDriver/EcsTask).This is a direct port of an already-approved design, not a new decision:
docs/adr/agent-lifecycle.md§6's projection table already has a k8s column (drafted alongside ECS's), andcrates/oabctl/src/k8s_driver.rs's own module doc explicitly flagged this as deferred work when the k8sProvisionDriverwrite path landed (studio#63 slice 3b): "Observing k8s state into the canonical 6-state ... is also out of scope here ... to land as its own follow-up."Mapping, per the ADR table:
metadata.deletionTimestamp != null→ Stopping (mirrors ECS'sdesiredStatus STOPPED)Unknownphase (kubelet not reporting / node lost) → Unhealthy(fenced), same treatment as a lost leaseaccepting_work, unchanged mechanism from ECS)ready_check_definedmirrorsEcsTask::health_check_defined's "no probe ≠ fault" distinction — a pod with no declared readiness probe just hasn't finished starting whenready == false, not a fault.Only the
RuntimeDriverprojection lands here — the actualkube::Api<Pod>list/observe call, the oab-mcp roster tool, and the console wiring are separate slices (tracked in #146).Test plan
cargo test -p agent-lifecycle --lib— 20/20 passing (11 existing + 9 new k8s cases, mirroringecs.rs's table-driven test style)cargo check -p agent-lifecycle— cleanbuild-test), not run locally per this sandbox's disk constraints🤖 Generated with Claude Code