Skip to content

feat(provider): type managed Kubernetes resource settings - #12855

Merged
cv merged 2 commits into
v1from
feat/typed-kubernetes-resources
Oct 8, 2026
Merged

cv merged 2 commits into
v1from
feat/typed-kubernetes-resources

Conversation

@cv

@cv cv commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #12785. Part of #12782.

Failure

nemoclaw_kubernetes_storage, nemoclaw_kubernetes_auth and nemoclaw_kubernetes_gateway were the last nemoclaw types that took one SDK-compiled spec string. An HCL author could not declare a managed Kubernetes or OpenShift gateway without reproducing the SDK's internal JSON.

Decision

  • Attributes: the three resources take the cluster target and identity as attributes: name, compute_driver (kubernetes or openshift), endpoint, kubeconfig_env, context, namespace, authentication_profile and an optional environment list.
  • Identity: owner and generation are optional and computed, generated on create. Generated graphs keep supplying the SDK's values.
  • Typed list: environment is a list(string) carried through the existing structured adapter. The nemoclaw provider now serves types with structured inputs through that adapter.
  • Validation: invalid values are reported at their attribute without echoing them. The backend rebuilds the same internal specification from the attributes, so cluster objects and receipts are unchanged. A changed target or identity still fails planning and retains the resources.
  • SDK, compiling and reading state: the SDK compiles the attributes and reads them back from OpenTofu state, including the environment list.
  • SDK, comparing intent: teardown and runtime binding checks compare the typed attributes, and plan identity checks cover the new ones. Export now checks every typed resource against intent, not only those with a spec. Since feat(provider): type gateway resources and service observation inputs #12831, managed gateways and their storage had dropped out of that export check; this restores it.
  • Docs: the provider guide lists the attributes. It says the three resources must share one owner, because their receipt is keyed by owner and name. docs/limits.md and the provider guide no longer list compiled-spec types; no nemoclaw type takes one now.

Validation

  • New tests:
    • A provider schema test checks the typed attributes, generated identity and the environment list on all three resources.
    • An SDK test round-trips each compiled Kubernetes and OpenShift resource through its attributes and rejects invalid driver, namespace, kubeconfig variable, endpoint, profile and reserved environment values.
    • An end-to-end test writes nemoclaw_kubernetes_storage in HCL and plans it through pinned OpenTofu without a cluster. It also rejects an invalid namespace at its attribute.
  • Updated tests: the existing Kubernetes compile, runtime binding, teardown and refresh tests now use the attributes.
  • Suites:
    • nemoclaw-sdk, nemoclaw-provider and nemoclaw-build tests pass.
    • The standalone and production-provider OpenTofu tests pass.
    • Workspace clippy at -D warnings, fmt and the schema check are clean.
  • Not done: I did not run the live cluster tests.

The draft #12736 already conflicts with v1. It also edits nemoclaw-provider/src/provider.rs, services/validation.rs and docs/provider.md, so it will need to follow these attributes.

Follow-up

The first CI run failed five Helm recovery lifecycle tests with "observation is incomplete". The resource adapter requires every attribute in an observation, and a Kubernetes row without an environment list left out environment_json. Observations now report it as empty. A new unit test checks that each Kubernetes observation reports every attribute; it failed before the fix. The 14 Helm recovery tests and the SDK's Kubernetes and export tests pass against a rebuilt bundle.

nemoclaw_kubernetes_storage, nemoclaw_kubernetes_auth, and
nemoclaw_kubernetes_gateway took one SDK-compiled spec string, so an HCL
author could not declare a Kubernetes or OpenShift gateway without
reproducing the SDK's internal JSON.

The three resources take the cluster target and identity as attributes:
name, compute_driver, endpoint, kubeconfig_env, context, namespace,
authentication_profile, and an optional environment list, with owner and
generation optional and generated on create. The SDK compiles the
attributes, reads them back from state for bound resources, and compares
them during teardown, plan, and export checks.

Closes #12785.
@cv cv added area: architecture Architecture, design debt, major refactors, or maintainability v1 NemoClaw v1 branch labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The resource adapter requires every attribute in an observation. With no
environment list the Kubernetes row omitted environment_json, so apply
failed with an incomplete observation in the Helm recovery lifecycle
tests.
@cv
cv enabled auto-merge (squash) October 8, 2026 19:55
@cv
cv merged commit 2ab1c6a into v1 Oct 8, 2026
17 checks passed
@cv
cv deleted the feat/typed-kubernetes-resources branch October 8, 2026 20:12
cv added a commit that referenced this pull request Oct 8, 2026
…12860)

## Failure

Two live workflows on `v1` turned red after my PRs. Both run only on
pushes to `v1`, so neither PR ran them:

- **[Live /
Docker](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713421)**,
red since #12831.
`managed_gateway_plan_apply_noop_destroy_and_recovery_use_real_opentofu`
failed with "Apply incomplete: observation is incomplete". The resource
adapter requires an observation to report every attribute, empty or not.
Docker gateway storage omits `endpoint`, because its data does not
depend on the listen port, so its observation left the attribute out.
- **[Live /
Kind](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713424)**,
red since #12855.
`kubernetes_live::the_gateway_installs_authenticates_and_is_removed_keeping_storage`
still read the removed `spec` attribute of the compiled gateway target.

## Decision

- Managed gateway observations report an omitted `endpoint` as empty, as
Kubernetes observations already do for an omitted `environment`.
- The Kubernetes live test builds the specification from the typed
attributes with `Spec::from_row`.

## Validation

- A new unit test checks that gateway and storage observations report
every configured attribute for Docker and Podman. It failed on Docker
gateway storage before the fix.
- Run locally against a rebuilt bundle:
- `cargo ci live-docker` passes, including the managed gateway lifecycle
test.
  - `cargo ci live-kind` passes, including the gateway install test.
- Workspace clippy at `-D warnings` and fmt are clean.
cv added a commit that referenced this pull request Oct 9, 2026
Part of #12782.

## Failure

#12782 is done only when every type is exercised by an authored
configuration through pinned OpenTofu. Four `nemoclaw` types had no such
configuration:

- `nemoclaw_kubernetes_auth`
- `nemoclaw_kubernetes_gateway`
- `nemoclaw_ollama_external_model`
- `nemoclaw_runtime_image`

`kubernetes_hcl`, added in #12855, was also missing from the lifecycle
profile, so CI never ran it.

## Decision

- **Kubernetes:** `kubernetes_hcl` plans storage, authentication and the
gateway together without a cluster. The authentication and gateway
resources take the storage's generated `owner`, as the provider guide
requires. An invalid namespace is rejected at the attribute on every
resource. In that check each resource names its own owner, because
OpenTofu skips resources whose dependencies fail validation.
- **External Ollama model:** `service_storage` applies proxy storage
with generated identity and an external model that shares it, against
Docker and Ollama fixtures. Changing the upstream digest then stops
planning and names `services.local.upstream`.
- **Runtime image:** `runtime_image` reads an image's labels through a
read-only Docker fixture and reports `available`. An image without a
required label fails the check.
- **CI:** `kubernetes_hcl` and `runtime_image` join the lifecycle
profile.

`fabric_sandbox_readiness` stays with the remaining #12788 work, which
changes its inputs.

## Validation

The lifecycle profile ran these three groups locally through pinned
OpenTofu: 7 tests, all passing. Clippy at `-D warnings` and fmt are
clean. This PR adds tests only; production code is unchanged.
cv added a commit that referenced this pull request Oct 9, 2026
Closes #12883. Part of #12876.

## Failure

`Live / Docker` and `Live / Kind` ran only on `v1` pushes. #12831 and
#12855 merged with passing pull request checks and turned `v1` red
([Docker](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713421),
[Kind](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713424)).

## Decision

- **Pull request trigger:** both workflows now run on pull requests to
`v1`. Pushes, `run-live-*` branches, and manual runs are unchanged.
- **Change check:** on a pull request, each job first runs
`nemoclaw-build changes live` and skips its remaining steps when the
change cannot affect the suite.
- The check uses the same determinator and guppy analysis as `changes
images`.
- It analyzes a live build: the packages whose tests run live
(`nemoclaw-build`, `-e2e`, `-provider`, `-runtime`, `-sdk`) and the CLI
and providers the bundle ships, with their dependencies and tests.
- **Path rules:** `.config/determinator-live.toml` classifies files
outside crates.
- Changes under these paths run the suite: `examples/`, `image/`,
`runtimes/`, `schemas/`, `versions.json`, the toolchain,
`.config/nextest.toml`, `.github/actions/`, and the live workflows.
  - Documentation, other workflows, and repository tooling skip it.
- Unclassified files, dependency or feature changes in the live build,
and failed analyses run it.
- **Concurrency:** a newer pull request run cancels a superseded one.
Push runs still finish.
- **Docs:** `docs/contributing/testing.md` describes the trigger and how
to check the decision locally.

Neither live workflow is a required check, so a skipped run doesn't
block merging.

## Validation

- **New tests:** `nemoclaw-build` tests decide on a committed temporary
workspace, as the image tests do.
- Documentation, another workflow, and a package outside the live build
skip the suite.
- Each live package and each live input path runs it, as does an
unclassified file.
- The tests failed before `changes live` existed, and the image tests
still pass.
- **This branch:** `changes live --base origin/v1` reports `live=true`,
because `nemoclaw-build` changed.
- **Checks:** the `nemoclaw-build` integration tests pass (77). clippy
at `-D warnings` passes with and without default features, and fmt is
clean.
- **Workflow:** this pull request runs both live workflows for the first
time.
@wscurran wscurran added feature PR adds or expands user-visible functionality platform: k8s Affects Kubernetes deployments security area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Architecture, design debt, major refactors, or maintainability area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants