Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a2243ab
docs(rfc): decide the per-node model in RFC 0018
Gal-Zaidman Nov 8, 2026
c8b94a9
feat(k8s): require a pod-bound identity for shared supervisors
Gal-Zaidman Nov 22, 2026
5b967b1
feat(k8s): add the node supervisor topology and node identity
Gal-Zaidman Nov 8, 2026
26a6c05
feat(k8s): pin node-topology instances to their node supervisor
Gal-Zaidman Nov 8, 2026
919e7ee
feat(helm): run the shared supervisor as a per-node DaemonSet
Gal-Zaidman Nov 8, 2026
633b788
feat(k8s): launch node-topology sandboxes once scheduled
Gal-Zaidman Nov 18, 2026
09fe9d4
feat(k8s): support the additional destination CA with shared supervisors
Gal-Zaidman Nov 8, 2026
51b3a82
docs(rfc): propose the external network enforcer and native-network mode
Gal-Zaidman Nov 18, 2026
0f661b1
feat(k8s): configure native-network mode with an external_enforcer table
Gal-Zaidman Nov 30, 2026
ca3bea1
feat(k8s): reach node supervisors on an operator pod network
Gal-Zaidman Nov 30, 2026
54b36de
feat(server): authenticate the native-network enforcer with its own h…
Gal-Zaidman Nov 30, 2026
34f19d0
feat(supervisor-control): serve the native-network enforcer on the ho…
Gal-Zaidman Nov 30, 2026
76ec7c8
feat(server): filter enforcer snapshots by declared node shards
Gal-Zaidman Nov 25, 2026
4253cc0
feat(supervisor): read the native-network resource claim
Gal-Zaidman Nov 30, 2026
a5374f4
feat(server): gate activation, policy status, and credential installs…
Gal-Zaidman Nov 22, 2026
9fea086
feat(k8s): run native-network mode in the gateway supervisor topology
Gal-Zaidman Nov 25, 2026
bf48f37
feat(supervisor): skip the proxy and policy DNS for native-network sa…
Gal-Zaidman Nov 8, 2026
559016e
feat(sandbox): leave agent sockets to the kernel in native-network mode
Gal-Zaidman Nov 8, 2026
344a3ea
fix(sandbox-backend): admit one handshake per source past the shared cap
Gal-Zaidman Nov 8, 2026
39bf109
feat(k8s): point native-network sandboxes at the configured resolvers
Gal-Zaidman Nov 30, 2026
0405690
feat(server): store the restrictive default policy for native-network…
Gal-Zaidman Nov 18, 2026
3ac1dfc
feat(k8s): schedule native-network sandboxes only to enforcer-ready n…
Gal-Zaidman Nov 30, 2026
4c84ce4
feat(server): require the experimental feature for native-network mode
Gal-Zaidman Nov 30, 2026
401e18a
fix(server): limit the enforcer to native-network sandboxes and rotat…
Gal-Zaidman Nov 30, 2026
f190c28
docs(gateway): name the agent variables that trust the additional CA
Gal-Zaidman Nov 30, 2026
081896e
fix(sandbox-backend): warn once per free handshake slot exhaustion ep…
Gal-Zaidman Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .agents/skills/helm-dev-environment/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ shared process namespace. The sidecar sends SIGKILL to the supervisor as the
same UID; it needs no host PID namespace, capabilities, or runtime socket.
The default k3d/kind test continues to kill through the node container runtime.

`mise run e2e:kubernetes:shared-supervisor-node` runs the
`supervisor_topology: node` e2e (`ci/values-supervisor-node.yaml`) on a
two-node k3d cluster.

### Shared supervisor high availability

`mise run e2e:kubernetes:shared-supervisor-spiffe-node-local` validates direct
Expand Down
8 changes: 7 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test-group = "kubernetes-ha"
# they kill members or gateways, or scale the pool. Never run them at once.
# Test names, not binary(), for the reason above.
[[profile.e2e-kubernetes.overrides]]
filter = "test(/^(losing_a_supervisor_pod_moves_its_sandboxes_without_restarting_them|scaling_a_supervisor_pool_up_and_down_keeps_its_sandboxes_running|pool_sessions_follow_their_supervisors_gateway|shared_supervisor_acts_as_each_sandboxs_stable_spiffe_identity|supervisors_spread_evenly_across_gateways)$/)"
filter = "test(/^(losing_a_supervisor_pod_moves_its_sandboxes_without_restarting_them|scaling_a_supervisor_pool_up_and_down_keeps_its_sandboxes_running|pool_sessions_follow_their_supervisors_gateway|shared_supervisor_acts_as_each_sandboxs_stable_spiffe_identity|supervisors_spread_evenly_across_gateways|each_workload_is_served_by_its_own_nodes_supervisor|a_supervisor_claiming_another_nodes_member_id_is_refused)$/)"
test-group = "kubernetes-shared-supervisor-pool"

# Scaling the pool runs two bounded Helm upgrades (up to 6 minutes each), waits
Expand All @@ -59,6 +59,12 @@ slow-timeout = { period = "60s", terminate-after = 15 }
filter = "test(/^supervisors_spread_evenly_across_gateways$/)"
slow-timeout = { period = "60s", terminate-after = 20 }

# Restarting a node supervisor waits for its replacement to receive the
# supervisor token, attach, and re-adopt the node's instances.
[[profile.e2e-kubernetes.overrides]]
filter = "test(/^each_workload_is_served_by_its_own_nodes_supervisor$/)"
slow-timeout = { period = "60s", terminate-after = 12 }

# Relative to the profile store dir (`e2e/rust/target/nextest/e2e-kubernetes/`).
[profile.e2e-kubernetes.junit]
path = "../../../../../results/e2e-kubernetes.xml"
2 changes: 2 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ Available task variants:
| `e2e:kubernetes:shared-supervisor` | One-member shared supervisor pool for the gateway's sandboxes (gateway TLS through the port-forward) |
| `e2e:kubernetes:shared-supervisor-ha` | Two-replica shared supervisor pool behind two gateway replicas on PostgreSQL: kills the member that owns a sandbox and checks the sandbox is adopted, not restarted; crashes and restarts gateways and checks each sandbox's session stays on its supervisor's gateway |
| `e2e:kubernetes:shared-supervisor-scaling` | One-member shared supervisor pool: scales it to two members and back with `helm upgrade`, checking sandboxes stay running and the removed member hands its sandboxes off |
| `e2e:kubernetes:additional-ca-shared` | Additional destination CA with a one-member shared supervisor pool: checks the bundle reaches sandboxes without a ConfigMap or mount, and that removing it applies after a gateway restart and sandbox stop/start |
| `e2e:kubernetes:tracing` | Deploys a Jaeger collector, exports gateway traces to it, and fails unless Jaeger receives gateway and Kubernetes compute-driver spans for a new sandbox. The only Kubernetes lane that exports traces |

Kubernetes e2e environment variables:
Expand All @@ -1005,6 +1006,7 @@ Kubernetes e2e environment variables:
| `OPENSHELL_E2E_KUBE_CONFORMANCE` | `0` skips the conformance suites that otherwise run before the lane's Rust tests |
| `OPENSHELL_E2E_KUBE_JAEGER` | `1` deploys a Jaeger collector, points gateway OTLP export at it, and sets `OPENSHELL_E2E_JAEGER_QUERY_URL` to its query API. Unset, the gateway exports no traces |
| `OPENSHELL_E2E_KUBE_TLS` | `1` reaches the gateway over mTLS through the port-forward; pair it with an overlay that keeps gateway TLS on, such as `ci/values-tls-port-forward.yaml` |
| `OPENSHELL_E2E_KUBE_SUPERVISOR_TOPOLOGY` | `gateway` tells the `additional_ca` test the release uses shared supervisors, such as with `ci/values-supervisor.yaml` |
| `OPENSHELL_E2E_KUBERNETES_FEATURES` | Cargo feature flags (default: `e2e,e2e-host-gateway,e2e-kubernetes`) |
| `IMAGE_TAG` | Gateway/supervisor image tag (default: `latest` for existing clusters) |
| `OPENSHELL_REGISTRY` | Image registry prefix (default: `ghcr.io/ai-openshell/openshell`) |
Expand Down
50 changes: 38 additions & 12 deletions crates/openshell-cli/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,18 @@ pub async fn sandbox_create(
config: SandboxCreateConfig<'_>,
workspace: &str,
tls: &TlsOptions,
) -> Result<i32> {
// The create flow holds several sandbox records; keep it off the
// caller's stack (clippy::large_futures).
Box::pin(create_sandbox(server, gateway_name, config, workspace, tls)).await
}

async fn create_sandbox(
server: &str,
gateway_name: &str,
config: SandboxCreateConfig<'_>,
workspace: &str,
tls: &TlsOptions,
) -> Result<i32> {
let SandboxCreateConfig {
name,
Expand Down Expand Up @@ -2174,6 +2186,7 @@ where

let config_result = client
.get_sandbox_config(GetSandboxConfigRequest {
sandbox_id: String::new(),
name: name.to_string(),
workspace_scope: Some(openshell_core::proto::workspace_selector(
workspace.to_string(),
Expand Down Expand Up @@ -6016,6 +6029,7 @@ pub async fn sandbox_settings_get(
let mut client = grpc_client(server, tls).await?;
let response = client
.get_sandbox_config(GetSandboxConfigRequest {
sandbox_id: String::new(),
name: name.to_string(),
workspace_scope: Some(openshell_core::proto::workspace_selector(
workspace.to_string(),
Expand Down Expand Up @@ -6373,13 +6387,10 @@ pub async fn sandbox_policy_set(

// Poll for status until loaded, failed, or timeout.
let deadline = Instant::now() + Duration::from_secs(timeout_secs);
let mut supervisor_loaded = false;
loop {
if Instant::now() > deadline {
eprintln!(
"{} Timeout waiting for policy version {} to load",
"✗".red().bold(),
resp.version
);
print_policy_wait_timeout(resp.version, supervisor_loaded);
std::process::exit(124);
}

Expand Down Expand Up @@ -6428,7 +6439,7 @@ pub async fn sandbox_policy_set(
);
return Ok(());
}
_ => {} // still pending, keep polling
_ => supervisor_loaded = rev.loaded_time.is_some(),
}
}
}
Expand Down Expand Up @@ -6473,6 +6484,7 @@ pub async fn sandbox_policy_update(
let mut client = grpc_client(server, tls).await?;
let current = client
.get_sandbox_config(GetSandboxConfigRequest {
sandbox_id: String::new(),
name: name.to_string(),
workspace_scope: Some(openshell_core::proto::workspace_selector(
workspace.to_string(),
Expand Down Expand Up @@ -6551,13 +6563,10 @@ pub async fn sandbox_policy_update(
}

let deadline = Instant::now() + Duration::from_secs(timeout_secs);
let mut supervisor_loaded = false;
loop {
if Instant::now() > deadline {
eprintln!(
"{} Timeout waiting for policy version {} to load",
"✗".red().bold(),
response.version
);
print_policy_wait_timeout(response.version, supervisor_loaded);
std::process::exit(124);
}

Expand Down Expand Up @@ -6606,12 +6615,28 @@ pub async fn sandbox_policy_update(
);
return Ok(());
}
_ => {}
_ => supervisor_loaded = rev.loaded_time.is_some(),
}
}
}
}

/// A loaded time on a pending revision means the supervisor loaded it and
/// the native-network enforcer has not accepted it yet.
fn print_policy_wait_timeout(version: u32, supervisor_loaded: bool) {
let detail = if supervisor_loaded {
": the supervisor loaded it; waiting for the network enforcer"
} else {
""
};
eprintln!(
"{} Timeout waiting for policy version {} to load{}",
"✗".red().bold(),
version,
detail
);
}

pub async fn sandbox_policy_get(
server: &str,
name: &str,
Expand Down Expand Up @@ -6771,6 +6796,7 @@ where

let config = client
.get_sandbox_config(GetSandboxConfigRequest {
sandbox_id: String::new(),
name: name.to_string(),
workspace_scope: Some(openshell_core::proto::workspace_selector(
workspace.to_string(),
Expand Down
12 changes: 12 additions & 0 deletions crates/openshell-core/src/grpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ async fn fetch_settings_snapshot_with_client(
supported_capabilities,
workspace_scope: workspace.map(crate::proto::workspace_selector),
name: sandbox_name.to_string(),
sandbox_id: String::new(),
})
.await
.map_err(grpc_status_error)?;
Expand Down Expand Up @@ -2062,6 +2063,11 @@ pub struct SettingsPollResult {
pub service_routes: Vec<crate::proto::SandboxServiceRoute>,
pub configuration_instance_id: String,
pub configuration_admitted: bool,
/// The gateway holds this instance's first activation; neither activate
/// nor report a rejection.
pub activation_pending: bool,
/// Native-network mode: the provider revision the enforcer accepted.
pub enforcer_provider_env_revision: u64,
pub configuration_error: String,
pub policy: Option<ProtoSandboxPolicy>,
pub version: u32,
Expand Down Expand Up @@ -2090,6 +2096,8 @@ fn settings_poll_result(inner: crate::proto::GetSandboxConfigResponse) -> Settin
service_routes: inner.service_routes,
configuration_instance_id: inner.configuration_instance_id,
configuration_admitted: inner.configuration_admitted,
activation_pending: inner.activation_pending,
enforcer_provider_env_revision: inner.enforcer_provider_env_revision,
configuration_error: inner.configuration_error,
policy: inner.policy,
version: inner.version,
Expand Down Expand Up @@ -2131,6 +2139,8 @@ impl From<crate::proto::SandboxConfigSnapshot> for SettingsPollResult {
policy_validation_failure_mode: snapshot.policy_validation_failure_mode,
extension_authentication_enabled: snapshot.extension_authentication_enabled,
configuration_admitted: snapshot.configuration_admitted,
activation_pending: snapshot.activation_pending,
enforcer_provider_env_revision: snapshot.enforcer_provider_env_revision,
provider_attachment_epoch: snapshot.provider_attachment_epoch,
configuration_instance_id: snapshot.configuration_instance_id,
configuration_error: snapshot.configuration_error,
Expand Down Expand Up @@ -2308,6 +2318,7 @@ mod provider_snapshot_tests {
..Default::default()
},
ProviderEnvironmentValue {
workload_placeholder: String::new(),
name: "TOKEN".to_string(),
value: "redacted".to_string(),
classification: ProviderEnvironmentValueClassification::StaticCredential.into(),
Expand Down Expand Up @@ -2423,6 +2434,7 @@ impl CachedOpenShellClient {
supported_capabilities: self.supported_capabilities.clone(),
workspace_scope,
name: sandbox_name.to_string(),
sandbox_id: String::new(),
})
.await
.into_diagnostic()?;
Expand Down
Loading