Repository navigation
feat(sdk): route sandboxes on Kubernetes gateways to in-cluster model servers - #13063
Merged
Merged
Conversation
Native vLLM authentication guards only `/v1` paths. On a live bearer service, `POST /invocations` returned a full chat completion without the key, and `/tokenize` and `/metrics` answered too (review finding X1). Recipe `VLLM_*` variables can also register management routes under `/v1`, such as `/v1/load_lora_adapter`, which any key holder could then call (X1-L1). Bearer services now launch with `--middleware nemoclaw_vllm_routes.OpenAIRoutes`, which vLLM adds as its outermost user middleware. It passes `GET /v1/models`, `POST` to the five inference endpoints, and public `GET /health`. Every other request, including `OPTIONS` (X1-N2) and `HEAD /health` (X1-N1), gets 404 before reaching vLLM, and WebSockets are closed. The `vllm`, `vllm-amd64` and `qwen38` images install the filter, run a GPU-free check against vLLM's own `build_app` during the image build (X1-T1), and carry `org.nemoclaw.inference.routes=openai-v2`. Docker bearer installs require that label, and the provider's rejection names it and `docs/build.md` (X1-N3). The build stages the route files only into contexts whose Dockerfile copies them (X1-N4). Services without authentication are unchanged. BREAKING CHANGE: bearer vLLM images built before this change lack the routes label, so plan and apply reject them. Rebuild them. Validation: - `cargo ci` passed in 690 s on Linux ARM64: 1380 tests, 4 doctests, and 127 lifecycle tests. - With the production hunks reverted, the 4 new or extended Rust tests fail and the build-context test does not compile. They pass on this branch. - Removing the label from the lifecycle fixture makes the two bearer `remote_service` tests fail at plan, through the bundled provider, with the new rejection. - The image-build test file passed 6/6 against vLLM's real app in an image built from #12736 whose route files are byte-identical. With a pass-through filter 4 of the 6 tests fail; with the earlier `openai-v1` filter, 3 fail. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, and test fixtures ## Failure Review of #12736 found six problems that do not depend on Kubernetes: - OpenShell rejection text was discarded. `remote_error` maps every gateway status to a fixed category, so on kind a CreateSandbox rejection for conflicting `allowed_ips` endpoint metadata reached the user only as "observation query failed". - Removing a ready sandbox still read its active-policy status, which teardown does not use; a failing status read blocked removal. - The deployment lock is an `flock` on the open file description. A child spawned concurrently holds a copy of the descriptor until `exec`, so dropping `Store` could leave the deployment locked, and the next open failed with "another operation holds the deployment lock". - Several tests wrote a script and executed it at once. A concurrent spawn that inherited the write descriptor made the exec fail with "Text file busy" (ETXTBSY). - `cargo images build --platform linux/amd64 hermes` failed with Bake's "failed to find target hermes". - The docs did not give the OpenClaw request format, how to recover when a malformed request leaves the runtime `unknown` (#12642), or that gateway profiles written before #12941 cannot be read. ## Decision - `ObservationError` gains `Rejected { operation, code, detail }`. `remote_rejection` keeps the gateway's detail only for CreateWorkspace, CreateSandbox, DeleteProvider and DeleteProviderProfile, whose requests carry no credentials, and only for FailedPrecondition, InvalidArgument, AlreadyExists, OutOfRange and ResourceExhausted. `sanitized_detail` reduces the detail to printable ASCII of at most 1024 characters and redacts bearer tokens, key/value credentials and token-like runs; `sanitized_resource_detail` also keeps one known resource name. Credential-bearing requests, reads and exec keep category-only errors. - `Rejected` owns its text, so `ObservationError` is `Clone` but no longer `Copy`; workspace callers clone it. - Teardown of a ready sandbox skips the active-policy status read. The owned identity checks still run. - `Drop for Store` unlocks before the file closes, which releases the lock for every copy of the descriptor. - Test fixtures execute an existing interpreter or binary and pass the written script as data. The provider staging test, which now runs the staged file through `/bin/sh`, asserts the executable bit that OpenTofu needs. - `images::plan` lists each platform's harnesses with `buildx bake --print agents` and names the platforms that build a requested harness; other selections keep Bake's resolution. - Docs: the headless OpenClaw request, the reported malformed-request failure and the whole-deployment replacement procedure, which rejections keep their detail, and the profile-format break. API change: `ObservationError` (also `nemoclaw_sdk::ObservationError`) is no longer `Copy` and has a new variant. Code that copies it must call `.clone()`, and exhaustive matches need a `Rejected` arm. Every use in this workspace is updated. ## Validation - `cargo ci` on linux_arm64 passed in 690 s: fmt, clippy `-D warnings`, build, 1387 nextest tests (174 skipped) and 4 doctests, schema, bundle, and 127 lifecycle tests (48 skipped). - Each new test failed with its production change reverted and passed with it: the two `remote_rejection` unit tests, the three redaction tests, the rejection-detail and ready-sandbox teardown fake-gateway tests, the lock test, and the harness-platform test. The credential-privacy test passes on v1 by design; it failed when CreateProvider was opted into rejection detail. The staging test failed when staging cleared the executable bit. - Repeated `cargo test` runs on this host: the `nemoclaw-sdk` lib suite passed 22 of 22 runs (v1: 7 of 22, with tests that reopen the deployment lock failing), and the `nemoclaw-test-fixtures` lib suite 50 of 50 (v1: 46 of 50; the kept failure logs show "Text file busy"). The other touched suites passed 10 of 10 on both. - `nemoclaw-build docs --check` passed. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odel budget Plan and apply accepted OpenClaw and Hermes routes to managed vLLM and Ollama services whose serving.contextTokens could not hold the agent's prompt, and reported nothing. The managed Ollama examples served 8192 tokens, while one measured initial OpenClaw prompt used 19,947 tokens. The pinned Hermes Agent refuses a window below 64,000 tokens or, when it cannot read the window through the sandbox proxy, assumes 131,072 (review finding HM-1). Before any mutation, plan and apply now emit Progress::Warning for a route to a managed vLLM or Ollama service when: - an OpenClaw route's effective contextWindow exceeds the service's serving.contextTokens; - the smaller of the two cannot hold 20,000 prompt tokens plus the route's reply allowance; - the route's token metadata cannot be assessed; or - a Hermes route's service serves fewer than 64,000 tokens. The warnings never reject a document. The CLI collects them even with --progress off and prints them in text output and in a JSON `warnings` field, including when the command fails. The managed Ollama examples now serve 32768 tokens with a matching route contextWindow. Progress gains a Warning variant, so exhaustive matches on it need a new arm. Validation: cargo ci passed on linux_arm64 in 526 s (fmt, clippy -D warnings, build, 1391/1391 tests, schema, bundle, 127/127 lifecycle tests). Without the production change the 14 new tests do not compile. With only the Progress::Warning variant, 10 of the 12 advisory tests fail, and the 2 tests that assert no warning fail under boundary mutants (<= 64000, >= contextTokens). With the CLI ignoring warnings, both CLI tests fail. The branch CLI reports 2 and 1 warnings for the previous managed Ollama examples and none for the updated ones. `nemoclaw-build docs --check` passes. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts and profile sources ## Failure #12736 routes sandboxes to model Pods that the deployment runs in its cluster, and the OpenShell and Fabric providers could not express that: - Provider credentials are parsed and resolved only through `nemoclaw_docker::credentials`; a caller cannot supply another source. - An inference profile grants only the literal IP in its endpoint URL. A cluster model is reached by a `<name>.svc.cluster.local` host, so a sandbox policy cannot grant its ClusterIP, and nothing checks which Service owns the address. - Two internal invariants, the profile metadata field set and the static search rule, were enforced with `expect`, so a violation would abort the provider instead of returning an observation error. Review finding N1b on #12736: only the ignored bundled lifecycle test constructed `FabricProvider::with_services`, so a regression that dropped the injected callbacks passed the regular test step. ## Decision - `openshell_provider::Services` validates and resolves credential sources, validates a cluster source, and returns a cluster Service's verified addresses. `DockerServices` keeps the Docker credential behaviour and returns `BindingMismatch` for every cluster source. `GatewayClient::with_services`, `OpenShell::connect_with_services`, `OpenShellProvider::with_services` and `FabricProvider::with_services` inject an implementation. `Default` and `OpenShell::connect` use `DockerServices`, and the bundled provider binaries still use the defaults. - `openshell_provider_profile` gains an optional `cluster_source`. It is a bound field, resets when omitted on update, and any change replaces the profile. `nemoclaw_openshell::profile::cluster_definition` accepts only an `http://<host>.svc.cluster.local:<port>/v1` endpoint and grants only the addresses `Services::cluster_addresses` returns, after `service_address_allowed` rejects unspecified, loopback, multicast, link-local, broadcast and IPv4-mapped addresses. The source and addresses are kept in their own annotations; refresh re-reads the addresses and refuses a profile whose endpoints no longer match. - `PolicyInput.cluster_grants` names managed rules whose `allowed_ips` come from verified cluster profiles (`RuntimeBinding::granted_policy`). Sandbox create and refresh check each grant against the deployment's own profile. The field is omitted from serialized policy when empty, so stored sandbox annotations do not change. - `nemoclaw_tofu::Definition::bound_fields`: refresh returns `BindingMismatch` when an observed bound field differs from state, treating omission as the empty value. Without it, a refresh wrote a substituted `cluster_source` into state. - `annotations()` returns `Result`, so unknown metadata returns `Incomplete`; an unparsable search rule returns `Query`. - The SDK's `image_runtime::policy_input` sets an empty `cluster_grants`; nothing in the SDK produces grants yet. Docker and Podman deployments are unchanged: the SDK emits no cluster source or cluster grants. The provider schema gains `openshell_provider_profile.cluster_source` and the `openshell_sandbox` policy block's `cluster_grants`; with `DockerServices`, a resource that sets either fails when the provider creates or reads it. ## Validation - `cargo ci` on linux_arm64 passed in 709 s: fmt, clippy `-D warnings`, build, 1393 nextest tests (174 skipped) and 4 doctests, schema, bundle, and 127 lifecycle tests (48 skipped), including all 44 `openshell-provider::contract` and 3 `fabric-provider::contract` tests. - On the base, the two new `nemoclaw-provider` refresh tests fail and the other four new tests do not compile. On this tree, each new test failed under a mutant of the production code it covers and passed without it: dropping the `bound_fields` check, restoring the v1 profile definition, making `FabricProvider::with_services` ignore its services (the N1b mutant), and restoring either `expect`. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…el services Managed vLLM and Ollama containers on Docker always ran with a fixed 104 GiB memory limit and no CPU cap. Any image, model, or serving change replaced a running model container without asking, so a routine re-apply could take a serving model down. Each managed vLLM or Ollama service now accepts container.cpuLimitMillis, container.memoryLimitGiB, and a service-level updatePolicy (Preserve, the default, or Recreate): - A CPU limit becomes a CFS quota per 100 ms period, the period kubelet and docker --cpus use, raised to the kernel's 1 ms minimum. A memory limit sets memory and memory_swap. Omitted limits add no CPU settings or labels and keep the 104 GiB memory limit. - Labels force replacement when a limit changes. The pinned Docker provider (v4.6.0) otherwise updates limits in place: it drops the CFS quota from updates, and lowering memory on a running model can OOM-kill it (review finding CL-1). - Under Preserve, plan and apply refuse a plan that deletes a running or incompletely observed model container, or lowers its memory, with DockerModelUpdateRefused. The CLI help names spec.services.<name>.updatePolicy. Missing or stopped containers are still replaced. - An explicit memory limit must cover private shared memory and the recipe's preparation memory. Breaking change: under the default Preserve, changing a Docker model's image, model, serving settings, or limits no longer replaces a running container. Set updatePolicy: Recreate to allow the replacement and its downtime. The release notes, inference guide, and change table say so. Validation on linux_arm64: cargo ci passed every step in 686 s: fmt, clippy -D warnings, build, 1385 nextest tests and 4 doctests, schema check, bundle, and 127 lifecycle tests. Each of the 8 new tests fails on v1 without this change, and the remote_service lifecycle scenarios fail against a bundle built from v1's production code. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Kubernetes API ## Failure #12736 runs vLLM and Ollama model services on managed Kubernetes and OpenShift gateways. The SDK had no code that creates, verifies, updates or removes a model's cluster objects, so a cluster gateway could not host a model service. The review of #12736 at 487cfc8 found these defects in that code; the code here contains the fixes from the later #12736 commits: - X2-AUTOSCALE (high): readiness stopped on the first `PodScheduled=False/Unschedulable`, which Kubernetes also reports while an autoscaler adds a Node, preemption runs, a claim binds or a device plugin registers. - X2-PRESERVE-NEVER-SERVED and X2-PREFLIGHT-TERMINAL (medium): `Preserve` refused to replace a Pod that never served, and the Node check ran for Failed and never-scheduled Pods, so recovery needed list-Nodes permission and broke on admission-injected init containers. - X2-RBAC-MSG, X2-RECREATE-NONSCHED and X2-TESTS (low): a denied Node list read "observation permission denied", an image-only update under `Recreate` skipped the Node check, and 8 preflight mutants survived. - STOPPED-RT (low, code part): `ModelRuntimeStopped` did not name the Pod. ## Decision Add the reconciler as an SDK library behind a configuration gate, so it can be reviewed and tested before any document reaches it: - `kubernetes::services`: `Spec` and `StorageSpec` for the `kubernetes_service` and `kubernetes_service_storage` resource kinds; retained model and credential PVCs; an immutable ConfigMap, a ClusterIP Service, a NetworkPolicy that admits only OpenShell supervisor Pods on the serving port, and a non-root single-GPU Pod. - `Operations`: preflight, ensure, read, remove, recover and wait_ready. Each create saves its address in a local receipt first, so a lost response is reported, not adopted. Every read verifies the cluster, namespace UID, claims and owned objects against the receipt. Admission is checked with server-side dry runs, for replacements under temporary names before the current Pod is stopped. - Readiness: a 30 s transient budget, a 9 h overall budget, and a 15-minute Unschedulable grace that restarts when the rejection clears and ignores Pods nominated by preemption. Only a fresh runtime status with a nonzero PID from the recorded container is ready. - Update policy: `Preserve` refuses to replace a Pod that may be serving (`status::may_serve`). Before `Recreate` replaces one, the admitted replacement is checked against Node labels, taints and allocatable capacity; changed scheduling inputs need list-Nodes permission and the refusal names it. - `ObservationError` gains the Kubernetes object, model runtime, scheduling, update-refusal, unrecorded-resource and admission variants. `Cluster` gains `create_model`, `dry_run` and `dry_run_object`. vLLM and Ollama services gain an optional `kubernetes` field. The fake Kubernetes API gains fault controls. - Gate: Kubernetes and OpenShift gateways keep `spec.services` `maxProperties: 0`, and every other gateway forbids a service's `kubernetes` field. No document can reach the new code. The cluster rule that requires `container.cpuLimitMillis` and `container.memoryLimitGiB` with `kubernetes` is left for the PR that lifts the gate. With it, a Docker service with `kubernetes` and no limits was refused with "cluster model services require container.cpuLimitMillis" instead of the gate. ## Validation - `cargo ci` on linux_arm64 passed in 722 s: fmt, clippy `-D warnings`, build, 1507 nextest tests (174 skipped; 89 new) and 4 doctests, schema, bundle, and 127 lifecycle tests (48 skipped), including the `kubernetes_hcl` and `kubernetes_lifecycle` provider contract tests. - On the base, the new integration tests do not compile (no `nemoclaw_sdk::kubernetes::services`), and the readiness and status unit tests live in modules this commit adds. The two gate tests also failed on the base, because the field does not exist there. - With the container-limit rule restored, both gate tests failed with the limit message. 15 production mutants each failed at least one new test, 45 of the 89 in total: no Unschedulable grace, no grace reset, nominated Pods counted as rejected, no `Preserve` refusal, every Pod treated as serving, no Node check, no dry runs, unverified claims or cluster identity, open ingress, stale status accepted, terminal Pods ignored, unchecked object drift, and either gate rule removed. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gateways ## Failure Managed Kubernetes and OpenShift gateways rejected every vLLM and Ollama service, so a cluster deployment needed a model endpoint outside NemoClaw. The reconciler behind the configuration gate could not be used: nothing compiled a document to its resources, and the provider did not serve them. The review of #12736 found these defects in the code that connects it; this commit contains the #12736 fixes: - X2-TAINT (high): a first apply that stopped at readiness, for example on an Unschedulable Pod, left the service resource tainted; no supported apply recovered it. - NEW-M1-DRIFT (low): no OpenTofu contract test changed cluster objects between applies. - N2b and X1-N3 (nits): a wrong-architecture runtime image got the generic metadata message, and the label message did not name org.nemoclaw.inference.routes. - STOPPED-RT (docs part), D3n, L1 and MG-WORD-3 (docs). ## Decision Lift the gate for managed cluster gateways and connect the reconciler: - Configuration: a vLLM or Ollama service on a managed Kubernetes or OpenShift gateway needs `kubernetes` settings, explicit `container.cpuLimitMillis` and `container.memoryLimitGiB`, private IPC and no Docker placement; `KubernetesService::resolve` combines them with the service-level `updatePolicy`. External gateways still reject services, and Docker and Podman still reject `kubernetes`. - Compile: the runtime stage emits `nemoclaw_kubernetes_service_storage` (prevent_destroy) and `nemoclaw_kubernetes_service`, ahead of agents. - Provider: `ClusterServicesBackend` serves both types. Owner and generation are derived from the spec. A first apply that is not ready returns `Mutation::stopped`: complete state with a warning, so OpenTofu does not taint it and an unchanged apply resumes waiting. The provider refuses bound port changes and removal outside destroy. - Images: plan and apply verify each cluster runtime image's platform and labels from its metadata bundle; bearer vLLM needs the routes label. - Deployment: cluster bindings and teardown, corrections limited to model workloads after a failed rollout, and a NetworkPolicy warning for every cluster service. Sandboxes cannot route to these services yet: that needs endpoint grants and credential reads that are not part of this commit. Validation rejects a provider whose `serviceRef` names a cluster service with "inference providers cannot reference cluster model services yet; use an external endpoint", instead of the later "invalid native inference policy". Tests use temporary fixtures with an external endpoint. The legacy `kubernetes.{cpuLimitMillis,memoryLimitGiB,updatePolicy}` layout from #12736 branch builds is not accepted. ## Validation - `cargo ci` on linux_arm64 passed in 607 s: fmt, clippy `-D warnings`, build, 1544 nextest tests (182 skipped; the base ran 1507) and 4 doctests, schema, bundle, and 135 lifecycle tests (48 skipped; the base ran 127), among them the 8 new contract tests through OpenTofu. `nemoclaw-build docs --check` passed. - On the base, with this commit's tests: the SDK and provider integration binaries do not compile (`Mutation::stopped`, `Definition::derived`); with those two files from the base, 18 new tests fail, and the 8 contract tests fail because the base provider does not serve the resource types. 12 unit tests are in files the base lacks. 10 pass on the base, which rejects every cluster service. - 22 production mutants, applied one at a time, each disabled one change, such as the X2-TAINT fix (`Mutation::stopped` replaced by a partial error), the routing refusal, the container-limit rule, owner and generation derivation, the bound port refusal or the routes label. Together they failed 37 of the 48 new or renamed tests. Three survived: the defensive Docker `Preserve` guard, the SDK's retained-storage comparison and the deployment image preflight, which the provider repeats. - `nemoclaw-provider::contract` summed budget 110 -> 150 s: the 8 new tests add 43.6 s locally, about 30 s at CI speed, putting the binary at its old budget. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## Failure Sandboxes could not use the cluster vLLM and Ollama services that the previous commit deploys: validation refused every inference provider whose `serviceRef` names a cluster service. Without that refusal, a routed document failed with "invalid native inference policy": the sandbox policy had no way to grant the private Service address, and the OpenShell provider could not read the bearer key, which lives in the model Pod's credential PVC. The review of #12736 found these defects in the routing code; this commit contains the #12736 fixes: - F1 (blocker): OpenShell rejected every sandbox that used a cluster model service, because the sandbox rule and the provider profile gave the same endpoint different `allowed_ips`. - F8 (high): the endpoint used the short `<svc>.<ns>.svc` name, which does not resolve in OpenShell sandboxes (no DNS search list). - U1 (low): a serving-port change got the generic sandbox refusal instead of naming whole-deployment destroy. - T2-PINS (low): three cluster credential-source checks had no test. - SEC-TRUST (low, security and inference guides), NEW-SDK-LIFECYCLE, MG-WORD-2, T5-T7 and DOCKER-CONTRAST (nits). ## Decision Route only through identities the deployment owns and verifies: - Credentials: a bearer cluster vLLM registration carries a `clusterService` credential source (owner, model name, storage, exact endpoint). The bundled OpenShell provider validates it and reads the key by exec into the model Pod, only while the Pod runs with its recorded identity; the key stays out of OpenTofu state. - Grants: the provider profile carries `cluster_source` provenance and the sandbox policy marks the rule as a cluster grant. The provider fills it with the owned Service's verified ClusterIPs, after checking that ready EndpointSlice members are the recorded Pod. - Endpoints use `<service>.<namespace>.svc.cluster.local`, compared exactly with the bound storage. - A routed cluster service's port change is refused before runtime reconciliation with the port message, even with separate state files. - The bundle's OpenShell and Fabric providers are built from nemoclaw-provider with these callbacks (`OpenShellServices`). - Add `examples/kubernetes/local-{vllm,ollama}.yaml`, the cluster cases of the context advisory, and the security and routing docs, and list the `cluster_credentials` lifecycle tests in the contributing docs. Remove the previous commit's refusal, its test and the unrouted test fixtures. ## Validation - `cargo ci` on linux_arm64 passed in 661 s: fmt, clippy `-D warnings`, build, 1573 nextest tests (185 skipped; the base ran 1544) and 4 doctests, schema, bundle, and 138 lifecycle tests (the base ran 135), among them the two bundled cluster credential tests and the SDK port-change test. `nemoclaw-build docs --check` passed. - On the base (the previous commit's production code with this commit's tests): 26 of the 32 new tests do not compile, because they call APIs this commit adds (`Source::ClusterService`, `OpenShellServices`, `cluster_inference_profile`, the Pod credential and endpoint reads). The other 6, including the SDK port-change lifecycle test, fail: 5 because the cluster examples are refused, 1 because export accepts endpoint provenance drift. Without the refusal, the 5 fail with "invalid native inference policy". - 26 mutants, one at a time, each disabled one behavior the new tests cover: the credential source, its owner, name and host checks, the Pod readiness, restart and key-format checks, `cluster_source`, cluster grants, the EndpointSlice, ClusterIP and receipt checks, the exact FQDN, the port refusal, and the bundled providers' callbacks. Every new test failed under at least one. One survived: OpenShell's `.svc.cluster.local` suffix check, which the SDK's exact host comparison precedes on every path. The tree equals #12736 merged with v1 except the dropped legacy-field migration and the deviations the split documents. Split from #12736. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This was referenced Oct 13, 2026
Closed
Contributor
|
This repository limits you to 5 open pull requests. Please close or merge an existing PR before opening another one. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base now includes v1 025b95a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR-6 now includes v1 025b95a. Resolve the docs conflicts with v1's retained-resource removal (#12929): - docs/inference.md: keep v1's link to Remove Retained Resources for Docker services and state that removing a cluster service's PVCs is not covered yet (#12640), because that procedure covers only Docker engines. - docs/kubernetes.md: keep this branch's destroy and retention text and add v1's sentence that removing the retained resources is not covered yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bearer route filter was a Python ASGI middleware loaded through
vLLM's `--middleware` flag. Three images installed it and ran a Python
check during every build, and the build staged both files. NemoClaw
keeps its own code and tests in Rust.
The supervisor now owns the published port for bearer services. It
binds `0.0.0.0:<serving.port>` before starting vLLM, so a port conflict
fails startup, and starts vLLM on `127.0.0.1` at the next port, or 65534
when `serving.port` is 65535. Its hyper HTTP/1.1 server forwards only
`GET /health`, `GET /v1/models` and `POST` to the five inference
endpoints, matching the method and the raw request-target path exactly.
Every other request, including absolute-form targets, `CONNECT`,
`OPTIONS`, `HEAD` and protocol upgrades, gets 404
`{"error":"Not found"}` without a connection to vLLM. Forwarded
requests keep their query and end-to-end headers, including
`Authorization`, lose hop-by-hop headers, and stream in both
directions; a client disconnect closes the vLLM request, and an
unreachable vLLM gives 502. vLLM's uvicorn trusts forwarding headers
from loopback, so the filter sets `X-Forwarded-For` to the connecting
address and drops `X-Forwarded-Proto`. Request headers must arrive
within 30 s. If the filter fails, the supervisor stops vLLM and reports
the error; when supervision ends, the filter closes its listener and
connections. Readiness still probes `/v1/models` with the key, now
through the filter. Services without authentication are unchanged.
The Python filter, its build check and their staging are removed, and
`runtimes/vllm/test_auth.py` returns to its v1 content. The images keep
`org.nemoclaw.inference.routes=openai-v2`, which now identifies the
supervisor filter. The runtime declares hyper, hyper-util and
http-body-util at the versions reqwest already locks; its dependency
closure gains only httpdate 1.0.3.
Validation:
- `cargo ci` passed in 537 s on Linux ARM64: 1401 tests,
4 doctests, and 127 lifecycle tests.
- The 15 route tests do not compile without `routes.rs`. Each of 15
mutations of it, such as passing every request, keeping hop-by-hop
headers, buffering responses or dropping the header timeout, fails
at least one of them. The changed SDK launch test fails on the parent.
- The ignored retained-source rebuild passed offline in 52 s.
- An image built from this tree with `runtimes/vllm/build.json` has
ID sha256:6adb9cc9088b and the routes label, and contains no Python
route file. It was not run on a GPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1 moved from 7d7772e to 64c384e (#13390 to #13413). Conflict: docs/security.md's inference transport row. #13388 says NemoClaw accepts HTTP and HTTPS URLs and recommends HTTPS for credentialed endpoints; this branch adds that a key for an in-cluster Service endpoint crosses the cluster network over plain HTTP. The row keeps both, and v1's new onboarding catalog row. `schema --check` reports both generated files current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second live run on kind followed the corrected "Use a Model Server in the Cluster" steps and both examples, and a review read them again. The run worked only after a change to the vLLM example, and found gaps in the Ollama steps. ## Failure - With the vLLM example as written, OpenClaw asked for `max_completion_tokens=166699`, and vLLM, with a 32768-token context, answered 400. With `maxTokens: 8192` it still answered 400, because OpenClaw's prompt is about 22-28k tokens. 2048 worked. - For Ollama, `rollout status` finished at the first `GET /api/version`, but the runtime logged "ready: managed service readiness confirmed" about 50 s later, after loading the model. Requests before then can fail. - "Run Ollama Instead" did not say to install the `ollama` provider, to read `data.ollama_runtime.ollama.spec`, or to rename the Deployment's `configMapKeyRef` and `claimName`. Followed as written, the Ollama Pod waits for the vLLM ConfigMap or mounts the vLLM PVC. The copied probe comment "GET /health needs no key" was wrong for Ollama. - The page did not say that both runtimes refuse to start without `host_reserve_gib` (default 32) plus 20 GiB of the node's available memory, on a GPU with its own memory. - The key change did not say to retire the old key. - Both examples use OpenClaw, which cannot start in OpenShell sandboxes with the pinned Fabric (#13372); the page did not say so. ## Change - Both examples set `maxTokens: 2048` on the route, with a comment, as v1's OpenClaw examples do; `examples/managed-ollama-gpu.yaml` uses the same value for `qwen3:0.6b`. The Ollama example says to wait until the model is loaded. - "Run Ollama Instead" names the `ollama` provider, shows the `spec` output, lists the `configMapKeyRef` and `claimName` renames, gives the probe comment for Ollama, and waits for the runtime's log line after the rollout. - "You need" states the node memory check, from `vllm::hardware_capacity::check_memory` and `ollama::hardware_capacity::check_memory`: `host_reserve_gib` plus 20 GiB for a GPU with its own memory, the GPU budget plus 20 GiB on `dgx-spark` and `rtx-spark`. - After a key change, readers remove the old key and unset its variable. - One sentence links #13372. - `docs/limits.md`: the Ollama steps have now been tried, so the row lists only OpenShift and other network plugins as untested. ## Validation - The live run used `maxTokens: 2048` for vLLM and reached an OpenClaw reply. The Ollama turn ran without `maxTokens`; the value added here was not run. - The docs' `vllm_runtime` and `ollama_runtime` blocks, including the new `spec` output, compute their specs with OpenTofu and the bundle's providers; both report `hostReserveGiB` 32. - The onboarding journeys for both examples, `deployment_journey` and `kubernetes_inference` pass. `nemoclaw-build docs --check` passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaveezy
marked this pull request as ready for review
October 18, 2026 11:01
…-routing Rework: drop the cluster-DNS special cases and remove the general rule that forbade a credential on http: endpoints, leaving destination policy to OpenShell. Discovery skips catalog reads NemoClaw's own connection rules disallow instead of failing compilation. Keep the Kubernetes credential fix; shorten the in-cluster model server docs.
cv
enabled auto-merge (squash)
October 18, 2026 12:53
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-13063.docs.buildwithfern.com/nemoclaw |
10 tasks
9 of 14 tasks
This was referenced Oct 19, 2026
cv
added a commit
that referenced
this pull request
Oct 19, 2026
…in-cluster route (#13484) ## Failure #12734 asks for unit and fixture coverage of managed-gateway OIDC authentication, token refresh and authentication failures, and of per-agent identity and routing for agents that use cluster-local inference. The Kubernetes gateway code that #13414 and #13063 added had little of either. **OIDC.** Every SDK Kubernetes operations and connect test used the development profile, so the `oidc` branches from #13414 had no unit or fixture test: the auth resource identified by its namespace once ready, no issuer objects or signing material, and the token read from the variable `tokenEnv` names. The forwarded fake-gateway tests always supplied the token the gateway expected. Only the live `kubernetes_live::oidc` test refuses a token on the managed Kubernetes path, and it checks neither the error class nor that nothing changed. **Several agents on an in-cluster model.** `kubernetes_inference` covered one sandbox, from the `local.yaml` fixture. No test checked per-agent names or routes for the three-agent cluster examples: `example_configurations_are_valid_fabric_configurations` compiles them only to validate their Fabric configurations. The #13063 commit message names catalog-skip tests, such as `kubernetes_inference::cluster_gateways_read_no_model_catalog_for_a_cluster_service`, that v1 does not have. ## Decision These tests characterize existing behavior; no production code changes. ### OIDC - `kubernetes_operations`: with an `oidc` spec, `ensure` of the auth resource adds no cluster objects and no local signing material. `read` reports no identity before the resource is ready, and the namespace UID after. - `kubernetes_connect`: `running` takes the spec to prepare from. A connection's token equals the value of the variable `tokenEnv` names, and no state file contains it. When that variable is unset or empty, `connect` fails with the `tokenEnv` message. - Tests can't safely set a variable while others run, so `tokenEnv` names variables that Cargo and nextest set for every test process: `CARGO_MANIFEST_DIR` holds a token, and `CARGO_PKG_LICENSE_FILE` is empty because the package declares an SPDX license. `PATH`, the precedent in `fake_gateway_tests`, can't be used: the schema forbids it as `tokenEnv`, so the operations refuse the spec with `Query` before `connect` reads a token. - `fake_gateway_tests`: the `Forward` stub's token is now a field, and `Forward::client` opens a new `GatewayClient`. A gateway that requires a fresh token refuses every call with a stale one, so nothing changes, and the provider reports `ObservationError::Authentication` without state. That variant carries no gateway text, so it can't echo the token. A new client with the fresh token then succeeds, as the next command's provider process would; a `GatewayClient` keeps its client for the process's lifetime. No test changes a variable's value between commands. That a refreshed token takes effect on the next command follows from these tests and `an_existing_issuers_token_reaches_gateway_only_runs`, which resolves `tokenEnv` into OpenTofu's environment on each command. ### Three agents on one in-cluster route `three_agents_on_a_cluster_gateway_share_one_service_registration_with_their_own_rules` compiles `examples/kubernetes/external-gateway.yaml` and `examples/openshift/external-gateway.yaml` with the provider endpoint set to `http://qwen.models.svc.cluster.local:8000/v1`. It checks: - one `openshell_inference` whose server is the Service endpoint with the example provider's credential, and no `cluster_source`; - in each of the three sandboxes, an FQDN rule for the Service's host, port and `/v1/**`, without `allowed_ips` or `cluster_grants`; - one `fabric_agent` per sandbox, named by that sandbox's `agent.name`, whose models use the Service as `base_url`; - the same graph with `spec.sandboxes` reversed. `examples/kubernetes/managed-development.yaml` keeps its hosted endpoint, because its explicit policies name it, and is checked only for agent names. The test reads agent names from each document: `main` in the external examples, `primary` in managed-development. `a_cluster_service_endpoint_reads_no_catalog_while_https_and_private_addresses_keep_theirs` pins the skip that #13063 landed in `endpoint_requests`: an endpoint that fails `validate_endpoint`, such as plain HTTP to a Service name, has no catalog request, while an HTTPS endpoint and plain HTTP to `10.0.0.5` each keep one. The rule lookup and the expected Service rule endpoints move into helpers that the single-sandbox test also uses. Its assertions are unchanged. ## Validation The tests passed when added. If one fails later, the fix belongs in its own PR, with that test as its failing test. - `cargo ci` passed: tools, fmt, clippy, build, test (1606 passed), schema, bundle, and lifecycle (150 passed), within budget. - `cargo nextest run -p nemoclaw-sdk -E 'test(/kubernetes_connect|kubernetes_operations|kubernetes_inference|inference_discovery/)'` and `cargo nextest run -p openshell-provider --lib` pass. - `cargo test -p nemoclaw-sdk --test integration` on the three new OIDC tests passes, so both Cargo variables are set under `cargo test` too. - Each key assertion failed against a temporary change, since reverted. - OIDC inputs and fixtures: development auth on `ensure`; an existing auth directory; a receipt already marked ready; `tokenEnv` naming another variable; the token copied into the state directory; a set variable in the missing-token test; a missing client TLS Secret; the stale forward supplying the fresh token; a gateway accepting any token; a new client with a third token. - Production mutations: `operations.rs` identifying the `oidc` auth resource by its first issuer object; `operations.rs` accepting an empty token; `Mutation::failed` carrying state; no credential on a registration that several sandboxes share. - Routing inputs: a second registration, another Service port, a `cluster_source`, a cluster grant or `allowed_ips` on one sandbox, agents named after their sandboxes (also for managed-development alone), another model `base_url`, agent metadata that depends on sandbox order, no validation skip, rejected private HTTP, and skipped HTTPS. - On a single-node k3s v1.36.5 cluster (linux_arm64) with Agent Sandbox v0.5.0, the `live-kind` profile without the kind-only registry test passed: `kubernetes_live::the_gateway_installs_authenticates_and_is_removed_keeping_storage`, `kubernetes_live::on_openshift_the_sandbox_runs_as_the_namespace_uid`, `kubernetes_live::oidc::a_managed_gateway_accepts_an_existing_issuers_tokens_and_refuses_another_audience`, and the three `kubernetes_chart` tests. The agent was the Pi image from v1 CI's `live-images-linux_arm64` artifact for `d33d50647`, imported into k3s by digest. 6 passed in 82 s. - Deferred to CI: `cargo ci live-docker`, and `cargo ci live-kind` on kind including `kubernetes_live::registry`, which `cargo ci` selects because `openshell-provider` changed. Docker isn't installed on this host. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
This was referenced Oct 26, 2026
cv
added a commit
that referenced
this pull request
Oct 27, 2026
…not on clusters (#13824) ## Failure NemoClaw manages vLLM and Ollama containers on a local Docker engine (`spec.services`) but places no model servers on Kubernetes or OpenShift. The reason lived only in #12732's closing comments, and `scope.md` lists the managed gateways among NemoClaw's kept decisions but not managed model services. A contributor recently asked whether cluster model servers were unsupported, or supported but still to be translated into Kubernetes resources. ## Decision Add the rule to the decisions `scope.md` keeps as NemoClaw's own promises: - **Docker:** NemoClaw manages the services because nothing else on a single host decides whether a model fits the GPU and memory, when the server is ready, or where its key and model cache live. - **Kubernetes and OpenShift:** the platform does all of that (scheduler and GPU device plugin, probes, Secrets, operators), so NemoClaw places no model servers there. Sandboxes reach a server the platform runs through an inference provider at its Service address (#13063). - **Shared contract:** both paths start from the same runtime images and the same `vllm_runtime` and `ollama_runtime` descriptions. The SDK's managed installers compile the same data sources (`RUNTIME_DATA_SOURCE` in `services/installers/{vllm,ollama}`). Only who applies them differs. The entry links #12732, where the decision was made, and the "Use a Model Server in the Cluster" section. ## Validation `cargo run --locked -p nemoclaw-build -- fern check` reports 0 errors and 1 warning, which is not from this change. `git diff --check` is clean.
This was referenced Oct 27, 2026
cv
pushed a commit
that referenced
this pull request
Oct 27, 2026
) ## Failure Reviewing #13080's follow-ups (#13837) turned up docs that no longer match v1: references to the Qwen recipe #13506 removed, an incomplete list of cluster rights, links to closed issues as open work, an HTTPS-only claim #13063 relaxed, and a skills example the schema rejects. ## Decision ```mermaid flowchart LR R["recipes.md: inline Qwen example and adapter"] --> R2["Removed (#13506)"] K["kubernetes.md: cluster rights"] --> K2["Add ServiceAccounts, Roles,<br/>RoleBindings, pods/portforward"] K3["kubernetes.md: #12709 open"] --> K4["Link Pull from Private Registries"] U["usage.md: Podman removal not covered"] --> U2["Link the Podman removal steps"] U3["usage.md: credentials require HTTPS"] --> U4["Prefer HTTPS, as inference.md says"] A["agents.md: harness under agent"] --> A2["harness, with kind, on the sandbox"] ``` - The rights are what the pinned chart creates with NemoClaw's values (`serviceAccount.create` and `rbac.create` default on) and the port-forward the SDK opens to the gateway pod. - #12709 closed after #13412 added Docker registry logins; #12640's Podman removal steps are in `usage.md`. ## Validation - The `agents.md` example, merged into `examples/fabric-openclaw.yaml`, validates against the schema; the old one fails with "'harness' was unexpected". - `cargo run --locked -p nemoclaw-build -- docs --check` passes; `git diff --check` is clean. Part of #13837. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
cv
pushed a commit
that referenced
this pull request
Oct 28, 2026
## Failure `docs/limits.md` says NemoClaw's vLLM runtime has been tried as a model server in the cluster, but the only such run (#13063, 2026-10-18) used a locally modified OpenClaw image, and the row doesn't say whether a key was used. `docs/kubernetes.md` still says the route was tried on one kind cluster, although #12733's OpenShift Local run also got Pi replies through in-cluster Ollama. ## Decision The keyed run that #13546 asks for is now [recorded on the issue](#13546 (comment)). At `v1` `e2eb215a4`, an OpenClaw agent on a managed gateway got a reply through an in-cluster vLLM server behind a key, on kind with one GB300 worker. The agent and runtime images were built from that revision without changes. - The limits row now names that run, and says vLLM on OpenShift is untested. - The Kubernetes guide's sentence counts the OpenShift Local node. ```mermaid flowchart LR A[OpenClaw sandbox] --> S[OpenShell supervisor Pod] S -- key added by OpenShell --> V["vLLM Service<br/>models namespace"] V --> G[GB300 worker] R["Run record<br/>#13546"] -.-> L[docs/limits.md row] O["OpenShift Local Ollama run<br/>#12733"] -.-> K[docs/kubernetes.md sentence] ``` Part of #13546; it closes after this merges. ## Validation - `git diff --check` is clean, and both links point at existing anchors. - `nemoclaw-build fern check` didn't run locally because this host has no npm, so CI runs it. - The run itself is in the linked record. Since that run, `v1` has moved to OpenShell 0.1.5 and Agent Sandbox v1.0.3.
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.
Sandboxes on a Kubernetes or OpenShift gateway can now use a model server that the user runs in the same cluster, addressed by its Service name:
http://<service>.<namespace>.svc.cluster.local:<port>/v1, optionally with a key. NemoClaw places nothing on the cluster. This is the "Placing servers" model of #13131: the platform owns placement, readiness and the key.The PR also fixes a
v1bug that the key needs: on a managed Kubernetes gateway, any provider with acredentialfailed at apply with "observation authentication failed".Supersedes the earlier stacked version of this PR; #13061 and #13062 are parked.
Why
Before this PR, YAML that names an in-cluster Service failed in two places (both seen by compiling
examples/kubernetes/managed-development.yamlwith the endpoint changed):credential: plan and compile failed with "inference discovery inputs are invalid". The control-host model-catalog read accepts plain HTTP only to a literal loopback or private address (nemoclaw-backendvalidate_endpoint), and the machine running NemoClaw usually cannot resolve cluster DNS anyway.credential: the schema rejected the document, becauseconfig/schema/validation.rsforbadecredentialon everyhttp:endpoint.A YAML user could reach an in-cluster server only by a literal ClusterIP and without a key, and that address changes when the Service is recreated. HCL users can already do this with a literal
openshell_inferenceserver (docs/inference.md, "Supply the Key on Other Platforms").The first live run of the keyed form on kind then failed at apply in
v1itself, before OpenShell received the provider (fix in commit 4 below).What changes
Six commits and three merges of
v1. The first merge tookv1's tree unchanged (parents46eea8340andef3115d4e). The second,2fa69d20a, mergesv1at7d7772eda(#13411), and the third,c9136276a, mergesv1at64c384eff(#13413); their conflicts and test adaptations are listed after the commits.feat(sdk): route Kubernetes sandboxes to in-cluster Services)inference_discovery::is_cluster_service_endpointaccepts exactlyhttp://<service>.<namespace>.svc.cluster.local:<port>with an optional path: a DNS-1035 service label, a DNS-1123 namespace label, and an explicit, nonzero, unpadded port. Nothing else matches.EndpointRequest::for_providerskips the catalog read for that form whengateway.runtime.provideriskubernetesoropenshift. Plan (endpoint_requests) and onboarding (inference_request_for_document) both use it, so they ask the same questions.openshell_inferenceserver with that endpoint, gives the sandbox an FQDN rule withoutallowed_ipsorcluster_grants, and passes the endpoint to Fabric asbase_url.feat(sdk): accept a key for in-cluster Service endpoints), a separate commit so it can be dropped (Q1 below)credentialis allowed on the Service form only when the gateway runtime iskubernetesoropenshift. The provider definition still forbids a key on every otherhttp:endpoint, and a document-level rule forbids it on the Service form with Docker or Podman, in all five places a provider can be declared.not.docs(kubernetes): use a model server that runs in the cluster)docs/kubernetes.md, "Use a Model Server in the Cluster": the endpoint form and its limits, then a procedure that runs NemoClaw's vLLM runtime fromvllm_runtime's spec,launchandrequirements: a Secret for the key, a ConfigMap for the spec, a PVC, aRecreateDeployment with/healthstartup and readiness probes, a ClusterIP Service, an ingress NetworkPolicy that admits only OpenShell supervisor Pods, and waiting for the rollout, because apply does not check the server.examples/kubernetes/in-cluster-vllm.yaml(endpoint andcredential) andin-cluster-ollama.yaml(endpoint only).docs/inference.md(service-mode row, the HTTPS exception, link from "Supply the Key on Other Platforms"),docs/limits.md(the Qualify more platforms, placements, models, and integrations #12641 row now covers only services NemoClaw places) anddocs/security.md(who can read the key; the plain-HTTP exception).schemas/nemoclaw-v1alpha1.schema.jsonanddocs/reference/configuration.mdare regenerated.fix(openshell-provider): resolve credential variables on managed Kubernetes gateways)credentialon such a gateway, HTTPS included.ForwardSecrets. That map holds only the forward's bearer token and TLS file paths, namedtoken,ca,certificateandkey. A provider'scredential_env, such asQWEN_INFERENCE_KEY, missed it, so apply failed with "observation authentication failed" and the gateway received noCreateProvider. Acredential_envnamedtokenresolved, and sent the gateway's bearer token to OpenShell as the provider's credential.OpenShell::connect_with_credentials(crate-private) takes the two resolvers separately;connect_with_servicespasses the same one for both, so direct connections are unchanged. A missing or empty variable still fails withAuthentication.tokenstill resolved to the gateway's token, which the second new test catches. The second live run used this commit.docs(kubernetes): correct the in-cluster model server steps)memory { gpu_memory_gib = 20, kv_cache_gib = 6 }. Without it, Qwen3-4B's 7.5 GiB of weights, the default 8 GiB KV cache and 2 GiB exceed the default 16 GiB budget, and the server crash-loops with "model weights exceed the declared GPU memory budget".docs/provider.md'svllm_runtimeexample gets the same block.tool_parser = "hermes"andreasoning_parser = "qwen3"; without a tool parser, vLLM answers OpenClaw with HTTP 400.ollama_runtimeon port 11434, the Ollama runtime image, the namesollama, no key, probes onGET /api/version(Ollama has no/health), and the example's sandbox namespace.runtimeClassNamewhere the node's default container runtime is not NVIDIA's.BLOCKED_CONTROL_PLANE_PORTS, OpenShell5a7728c).docs/limits.mdrow for what has been tried and what is untested.docs(kubernetes): finish the in-cluster server steps from the live run)maxTokens: 2048on the route, with a comment. Without it, OpenClaw asked vLLM formax_completion_tokens=166699, and vLLM, with a 32768-token context, answered 400; 8192 also failed, because OpenClaw's prompt is about 22-28k tokens.v1's OpenClaw examples all setmaxTokens, andexamples/managed-ollama-gpu.yamluses 2048 for the same Ollama model.ollamaprovider and thedata.ollama_runtime.ollama.specoutput in step 1, the ConfigMapollama-runtimein step 2, andconfigMapKeyRef.nameollama-runtimeandclaimNameollama-datain step 3. It replaces the copied probe comment "GET /health needs no key".rollout statusfinishes as soon as Ollama listens, before the runtime has loaded the model, so step 4 also waits for the runtime's log line "ready: managed service readiness confirmed".host_reserve_gib(default 32) plus 20 GiB of the node's available memory for a GPU with its own memory, or the GPU budget plus 20 GiB ondgx-sparkandrtx-spark(vllm::hardware_capacity::check_memory,ollama::hardware_capacity::check_memory).docs/limits.mdrow now says the vLLM and Ollama runtimes were tried on one kind cluster; OpenShift and other network plugins are untested.The second
v1merge:deployment_journeycounts 40 single-sandbox examples:v1added eight and this branch adds two.v1'sapidescription and this branch'scredentialandendpointdescriptions;schema --checkreports both generated files current.policy.managedan unlabeled list, so two tests from this branch now find the inference grant by itsname.The third
v1merge (#13390, #13388, #13409, #13413):docs/security.md's inference transport row. docs(security): distinguish inference TLS and CA trust boundaries #13388 says NemoClaw accepts HTTP and HTTPS URLs and recommends HTTPS for credentialed endpoints; this branch adds that a key for an in-cluster Service endpoint crosses the cluster network over plain HTTP. The row keeps both, next tov1's new onboarding catalog row.schema --checkreports both generated files current after feat(kubernetes): reference existing image pull Secrets #13390'simagePullSecrets.git diff --stat upstream/v1 HEAD:Production code is about 125 lines; the schema grows because the document-level key rule repeats for each provider location.
rcgenis a new dev-dependency ofopenshell-provider, for the fake gateway's certificates; the lock file already held it.Breaking or user-visible changes
credential. Plan and onboarding read no model catalog for it, so a successful plan does not show that the server runs or serves the route's model.credentialvariable resolves from the environment wherenemoclawruns, as on every other gateway, instead of failing apply. A variable namedtoken,ca,certificateorkeyno longer resolves to the forward's own credentials.http:endpoint still takes no key.v1.publish = falsecrates): newnemoclaw_sdk::inference_discovery::is_cluster_service_endpointandEndpointRequest::for_provider.nemoclaw_authoring::inference_request_for_documentreturnsNonefor such a route, as it does for a managed-service route.Test proof
cargo ci --full(linux_arm64, final head)It ran on head
eda1e3fbe, tree27f526e77, withupstream/v1at64c384eff.59545ebf4: the third merge'sv1commits add 4 tests to this step. This PR's 14 new names are its 12 tests and the 2 generated onboarding journeys (tui::tests::example_journeys::kubernetes_in_cluster_{vllm,ollama}).openshell-provider::contract99.3 s of 105 s).New tests: red without the production change, green with it
Twelve new tests, plus two onboarding example journeys that the build generates from the new examples. Red runs reverted only production sources in the working tree, or ran before they existed; the final
cargo ci --fullran on the committed tree.kubernetes_inference::a_cluster_service_endpoint_is_an_http_service_dns_name_with_an_explicit_port(7 accepted and 38 rejected endpoints)kubernetes_inference::cluster_gateways_read_no_model_catalog_for_a_cluster_service(Kubernetes and OpenShift, external and managed)endpoint_requestsfails: "HTTP requires a literal loopback address or private inference address"kubernetes_inference::a_cluster_service_compiles_to_a_literal_server_and_an_fqdn_sandbox_ruleallowed_ipsorcluster_grants, Fabricbase_urldiscovery_queries::a_cluster_service_route_has_no_control_host_catalog_to_read(authoring)inference_request_for_documentreturnsSome(EndpointRequest { endpoint: "http://qwen.models.svc.cluster.local:8000/v1", .. })None; neither plan nor onboarding reads a catalogkubernetes_inference::a_cluster_service_endpoint_takes_a_key_only_with_a_cluster_gateway(5 provider locations; compiledcredential_env)kubernetes_inference::a_constructed_document_cannot_send_a_key_to_a_service_from_a_local_gatewayvalidaterejects the document after its gateway moves to Dockerkubernetes_inference::only_the_service_form_takes_a_key_over_plain_httpleft: false, right: true)http:endpoint with a key parses exactly whenis_cluster_service_endpointaccepts itopenshell-providerfake_gateway_tests::a_managed_kubernetes_gateway_resolves_provider_credentials_from_the_environmentprovider: Some(Authentication), the live failurePATHas its credentialopenshell-providerfake_gateway_tests::a_providers_credential_variable_never_resolves_to_the_forwards_credentialstokenregisters with the forward's bearer token (left: None, right: Some(Authentication))token,ca,certificateandkeyeach fail withAuthentication, and the gateway receives no providerThe two provider tests reach the fake gateway through
GatewayClientwith a fake forward that supplies a bearer token and mutual-TLS files, asSdkKubernetesdoes; the fixture gateway requires both, so the workspace and profile they create first also show that the forward still authenticates the connection.PATHstands in for a key because a test cannot set a variable safely while other tests run. With the first live run's scratch fallback in place of the fix (mutation), the first test passes and the second fails attoken.Guards and characterization, which pass before and after by design:
kubernetes_inference::local_gateways_still_reject_a_cluster_service_endpointfails when the skip ignores the gateway runtime (mutation).kubernetes_inference::other_endpoints_on_cluster_gateways_keep_their_catalog_readsfails when anyhttp:name containing.svccounts as a Service (mutation); that mutation also fails the endpoint table.agent.inferencelocation from the document-level key rule failsa_cluster_service_endpoint_takes_a_key_only_with_a_cluster_gatewayat "docker agent inference" (mutation).openshell-providerfake_gateway_tests::a_service_name_profile_and_a_sandbox_without_grants_pass_endpoint_ambiguity_checks(rows from thelocalandhermes-authfixtures, unauthenticated and authenticated): it composes the provider profile and the sandbox policy that the fake gateway received with OpenShell's owncompose_effective_policyandfind_endpoint_ambiguities. The check finds no ambiguity, and a ClusterIP on the sandbox's rule alone gives exactly oneallowed_ipsconflict. It passes onv1with no production change; the first live run confirmed it on an OpenShell v0.1.4 gateway, and the second stored the same rule.Other checks
vllm_runtimeandollama_runtimeblocks, including the Ollama block's newspecoutput, anddocs/provider.md'svllm_runtimeexample compute their specs with OpenTofu 1.12.6 and thevllmandollamaproviders of the final head's bundle.ollama_runtimereports port 11434,/dataand nokey_env, and both specs carryhostReserveGiB32, the default the node-memory bullet names.kubectlclient dry run against an empty kubeconfig; the second live run ran the Secret and ConfigMap commands on a cluster. The key change was never run on a cluster.nemoclaw-build docs, thendocs --check, pass on the final head, including link and anchor checks.nemoclaw-build fern checkneeds Node.js, which this host lacks; deferred to CI.maxTokens: 2048ran; the Ollama example's did not, and the Ollama readiness wait was observed, not run as written), the thirdv1merge, the key change, OpenShift, and other network plugins.Live evidence (not qualification; #12732 stays open)
The second live run, on 2026-10-18, used head
59545ebf4:v17d7772edaand commits 1-5. Since then the branch gained commit 6, which makes the docs changes this run called for, and the thirdv1merge (64c384eff); this PR's own code did not change, andv1's changes from that merge did not run live.Setup. A kind cluster with one GB300 worker and the
nvidiaRuntimeClass (the worker's containerd default runtime isrunc). The linux_arm64 bundle came from that head'scargo ci --full; the vLLM runtime, Ollama runtime and OpenClaw agent images were built from that head and loaded on the worker by digest. The docs steps ran as written, except for the namespaces, the image digests, the deployment UID and context,hardware(gb300,arm64), andruntimeClassName: nvidia, which step 3 says to set on such a node.Locally modified agent image. With the pinned Fabric v0.5.0, OpenClaw cannot start in OpenShell sandboxes (
v1#13372). The first apply registered the keyed provider and created the sandbox, then stopped at the agent withstart_failed; Fabric's start reportedsetpriv: activate capabilities: Operation not permitted, with and without the key. Every later apply in this run used the head's OpenClaw image with/usr/bin/setprivremoved, built locally for this run only. Withoutsetpriv, Fabric's adapter runs the OpenClaw gateway directly.Keyed vLLM (
in-cluster-vllm.yamlwithQWEN_INFERENCE_KEYset):Provider fix: apply registered the keyed provider
qwenon the managed Kubernetes gateway. At620ea6966this step failed with "observation authentication failed".Server: steps 1-4 created the Secret, ConfigMap, PVC, Deployment, Service and NetworkPolicy, and
rollout statusfinished in 296 s. Inside the model Pod,/healthanswered 200 without a key;/v1/modelsanswered 401 without a key and with a wrong key, and chat 401 without a key; with the key,/v1/modelsand a chat with tools andtool_choice: autoanswered 200.Policy rule: a read-only
GetSandboxshowed one network rule, the same after each sandbox replacement:The agent's model entry names that endpoint as
base_url, and its key variable holds anopenshell:resolve:env:placeholder.OpenClaw turn: with the example's route as committed before commit 6, the turn failed with vLLM 400 (
max_completion_tokens=166699 cannot be greater than max_model_len); withmaxTokens: 8192it failed the same way (prompt of at least 24,577 tokens). WithmaxTokens: 2048the turnsucceeded: 6 ×POST /v1/chat/completions -> 200, all from the sandbox's OpenShell supervisor Pod; the sandbox's workload Pod never reached the server. The 4B model did not reply with the requested words; it tried a messaging tool.401 without the key: a Pod with the supervisor labels in the sandbox namespace got
GET /v1/models401 without a key, while the supervisor's requests got 200, so OpenShell supplied the key.Key exposure, 0 matches in each place: the sandbox environment (only the placeholder variable and
NEMOCLAW_ANONYMOUS_API_KEY="unused"name a key); all 24 sandbox files under/sandboxand/tmpoutside the Node compile cache, including OpenClaw's configuration, its SQLite WAL and its log;export; the deployment state directory; ConfigMaps in both namespaces; Secrets in the gateway namespace, raw and base64; the logs of 4 gateway-namespace containers; the model Pod log.Export: keeps
credential: {env: QWEN_INFERENCE_KEY}andmaxTokens: 2048; planning the export reports no changes.Keyless Ollama ("Run Ollama Instead" steps 1-4, then
in-cluster-ollama.yamlwithoutmaxTokens):rollout statusfinished in 25 s; plan and apply succeeded; one turn replied "in-cluster ok" with 1 ×POST /v1/chat/completions -> 200from the supervisor Pod.ollama.nemoclaw-pr13063-r2-omodels.svc.cluster.local:11434 ports [11434] protocol=rest allowed_ips=[], withcluster_grants: []. The agent usesNEMOCLAW_ANONYMOUS_API_KEY.NetworkPolicy:
defaulttimed out, and so did a Pod with the supervisor labels indefault./api/versionand/v1/models. Without a key, the NetworkPolicy is the only access control, as the docs say.Earlier findings. The first live run (2026-10-16, head
620ea6966onv1ef3115d4e) found the provider bug that commit 4 fixes and the docs gaps that commit 5 fixes; this run confirmed both. Its re-apply-after-destroy failure is fixed inv1by #13408: here, destroy and a new apply with the same state succeeded.v1observations, not this PR: after the failed agent start,plan --destroyand destroy succeeded. After that start failure, apply refused to replace the sandbox for a changedimage.ref("apply cannot replace sandbox 'assistant'; its files and conversation history are not separately retained"), but replaced it for a changed routemaxTokens, which deletes the same files.Cleanup. Both destroys completed; the run's namespaces and their PVs were deleted; the cluster's namespaces, PVs, PVCs and cluster-scoped objects match the start; GPU memory was 0 MiB at the end. The key file was deleted after the last check.
Review items left unchanged
http://qwen.models.svc:8000/v1) fails planning with the generic "inference discovery inputs are invalid" (discovery.rsdrops the cause). The text predates this PR; a hint naming the accepted form could follow separately.validate_endpoint_urlrejects only some control characters. The host stays the Service, so the key goes nowhere else; the fix belongs in endpoint validation for every endpoint, separately.featcommit messages say "Q1" and call the endpoint table red; the PR body is what lands on squash merge, and it describes both correctly.Questions pending with the maintainers (#12641)
credentialon the Service form with a Kubernetes or OpenShift gateway? HCL already allows it, and managed Docker vLLM already sends its key over private HTTP. If not, drop the second commit and the key parts of the docs and the vLLM example; the routing half needs no decision, and commit 4 stands on its own.<service>.<namespace>.svc.cluster.localform. OpenShell's ownis_kubernetes_service_host(profiles.rs,5a7728c) also accepts<service>.<namespace>.svc, any letter case, and a trailing dot. Should NemoClaw accept those, or a custom cluster domain?openshell.ai/boundary-role=supervisor(withopenshell.ai/managed-by=openshell), OpenShell's own labels at5a7728c. Anyone who can create a Pod in the sandbox namespace can set them. Is that stable enough to document, or should we ask OpenShell for a supported selector?🤖 Generated with Claude Code
Update (maintainer)
Merged
v1and reworked, following the principle settled in #13131: NemoClaw does what it owns, and leaves destination policy to OpenShell (#13232).is_cluster_service_endpoint,CLUSTER_SERVICE_ENDPOINT, the cluster-only credential exception, and the rule rejecting a cluster address with a key on Docker or Podman. Instead, the general provider rule forbidding acredentialonhttp:endpoints is gone. OpenShell decides where a sandbox's key may go, as it already decides where its traffic goes.kubernetes_inference.rsnow checks that any HTTP or HTTPS endpoint takes a key on any gateway, wherever the provider is declared.inference.mdandsecurity.mdsay to prefer HTTPS for credentialed endpoints, because over plain HTTP the key travels unencrypted.limits.mdkeeps the two model-server rows and drops the resolved Authenticate a managed Kubernetes gateway through an existing OIDC issuer #12692 and Pull images from private registries #12709 rows.cargo cipasses locally: 1,565 unit tests and 153 lifecycle tests.fern checkreports 0 errors.