Skip to content

Commit 4b53c85

Browse files
authored
Merge pull request #84 from vsilent/support-kata-container-runtime
Support kata container runtime
2 parents e4f3373 + be26060 commit 4b53c85

8 files changed

Lines changed: 475 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 0.1.6 — 2026-04-08
4+
### Added — Kata Containers Runtime Support
5+
6+
#### Container Runtime Selection (`commands/stacker.rs`)
7+
- `ContainerRuntime` enum (`runc`/`kata`) with serde support and Docker runtime name mapping
8+
- `detect_kata_runtime()` — cached detection via `docker info` with 5s timeout and `OnceLock`
9+
- `inject_runtime_into_compose()` — parses compose YAML and injects `runtime:` per-service
10+
- `DeployAppCommand` and `DeployWithConfigsCommand` accept optional `runtime` field
11+
- Graceful fallback: if Kata is requested but unavailable, deploys with runc and emits `kata_fallback` warning
12+
- Effective runtime reported in deploy result body
13+
14+
#### Capabilities Discovery (`comms/local_api.rs`)
15+
- `/capabilities` endpoint reports `"kata"` in features list when Kata runtime is detected on the host
16+
17+
#### Code Quality Fixes (PR #84 review)
18+
- `runtime_compose_tests` gated with `#[cfg(all(test, feature = "docker"))]` for minimal builds
19+
- Replaced blocking `std::path::Path::exists()` with `tokio::fs::try_exists()` in async deploy path
20+
- Added proper error logging in `unlink_handler` for `try_exists` failures
21+
22+
#### Tests
23+
- 14 new tests: enum behavior, serde deserialization, compose YAML injection (including edge cases), command parsing with runtime field
24+
25+
## 0.1.5 — 2026-03-26
26+
### Added — Long Polling, Vault Integration, Compose Agent Sidecar
27+
328
## 0.1.4 — 2026-03-13
429
### Added — CLI Improvements, Install Script & GitHub Releases
530

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "status-panel"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
edition = "2021"
55

66
[features]

TODO.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,36 @@
6060
- [ ] Expose health metrics indicating which control plane executed each command (`status_panel` vs `compose_agent`) so ops can track rollout and fallbacks.
6161
- [ ] Publish Vault secret schema: `secret/agent/{hash}/status_panel_token` and `secret/agent/{hash}/compose_agent_token`; refresh + cache them independently.
6262
- [x] Add config flag to disable compose agent (legacy mode) and emit warning log so Blog receives `compose_agent=false` via `/capabilities`.
63+
64+
## Kata Containers Support (Stacker Server)
65+
**Context**: The Status Panel Agent now supports `runtime` field (`runc`/`kata`) on `deploy_app` and `deploy_with_configs` commands, detects Kata availability via `docker info`, injects `runtime:` per-service into compose YAML, and reports `"kata"` in `/capabilities` features when available.
66+
67+
### Stacker API Changes
68+
- [ ] Add `runtime` field (string, optional, default `"runc"`) to `POST /api/v1/agent/commands/enqueue` payload for `deploy_app` and `deploy_with_configs` commands.
69+
- [ ] Add `runtime` field to the deployment model/database so per-deployment runtime preference is persisted across redeploys and restarts.
70+
- [ ] Validate `runtime` values on the Stacker side (`runc`, `kata`); reject unknown values with 422.
71+
- [ ] Read agent `/capabilities` response and store `kata` feature flag per agent; use this to prevent scheduling Kata deployments on agents that don't support it.
72+
73+
### CLI / UI Integration
74+
- [ ] Add `--runtime kata|runc` flag to `stacker deploy` CLI command; pass through to the agent command payload.
75+
- [ ] Show runtime selection option in the deployment UI (dropdown or toggle); default to `runc`, show `kata` only if agent capabilities include it.
76+
- [ ] Display effective runtime in deployment detail view (agent reports `"runtime"` in deploy result body).
77+
- [ ] Show `kata_fallback` warnings from agent result in the UI/CLI output so users know when Kata was unavailable.
78+
79+
### Vault / Config Management
80+
- [ ] Allow per-deployment runtime preference in Vault (`secret/agent/{hash}/runtime_preference`); agent can read this as a default when no explicit `runtime` is in the command payload.
81+
- [ ] Support org-level policy: "all deployments must use Kata" — Stacker enforces this before enqueuing commands.
82+
83+
### J2 Template Updates
84+
- [ ] Update compose J2 templates to optionally include `runtime:` field per-service when Kata is requested (alternative to agent-side YAML injection for new deployments).
85+
- [ ] Document that `runtime:` in compose YAML and `runtime` in command payload are complementary — agent-side injection is the fallback when templates don't include it.
86+
87+
### Host Provisioning
88+
- [ ] Create Ansible playbook for Kata setup: install `kata-containers`, configure `daemon.json` with Kata runtime, validate KVM access.
89+
- [ ] Add Terraform module for provisioning Kata-ready bare-metal hosts (Hetzner, OVH) with KVM enabled.
90+
- [ ] Document network constraints: Kata containers cannot use `network_mode: host`; advise `bridge` or `macvlan`.
91+
92+
### Monitoring & Observability
93+
- [ ] Add Prometheus metric `agent_deploy_runtime{runtime="kata|runc"}` counter to track Kata adoption.
94+
- [ ] Log `kata_fallback` events in agent audit trail for ops visibility.
95+
- [ ] Add dashboard widget showing Kata vs runc deployment distribution across fleet.

0 commit comments

Comments
 (0)