Commit Graph
48 Commits
Author SHA1 Message Date
Abhay Krishna ba862e2f62 test(e2e): move CI and dev defaults to 1.36 (#2132)
Moves CI and local development off Kubernetes 1.34, which reached end
of life on 2026-10-27.

The CAPD node image's kindest/node base, which supplies the kubelet
and kubeadm of every container node, moves from v1.34.8 to v1.36.4.
kubeadm deploys a control plane at most one minor version older than
itself, so every cluster version on that base moves with it: tenant
defaults to 1.36.3, and site clusters and the control-plane roll
target to the base's 1.36.4.

The other 1.34.2 defaults move to 1.36.3: the nico-vms entries, the
sample scripts and Tilt buttons, the nvkectl smoke suite and the kind
smoke lane's site spec. The upgrade test starts at 1.35.3 and upgrades
to 1.36.3, and the no-VIP spec, which took its target from that chain,
asks for the roll target instead. The e2e kubectl image moves to
alpine/k8s 1.36.4. The local development channel keys its release
under "1.36".

Implements part of #2041.

Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com>
2026-11-05 12:47:55 -07:00
Miancheng Lin cb27604ad8 chore: disable SSH password login by default in the example releases and fixtures (#2010)
- Example release templates (cli/examples) set ssh allow-pw to false.
- The nvke-nico-vms-24.04-{amd64,arm64}-fde ClusterRelease and NodePoolRelease
  fixtures set ssh_pwauth to false, matching the nvke-* releases in
  nke-site-deploy. nico-vms still enables it for its nico-diag user when
  NICO_VMS_DIAG_SSH_ENABLED is on, so guest diagnostics keep working.
- The dev scripts default to nvke-260625-24.04-x86-fde instead of the
  deprecated nke-260611-24.04-amd64-fde.
- The nico-sim "Create instance" button passes RELEASE, the variable
  capnico-create-instance.sh reads. It passed NODEPOOL_RELEASE, so the
  release typed in the button was ignored.
- capnico-create-instance.sh points at cwe-profiles/releases-nvke when the
  release is not installed.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-11-03 12:31:13 -08:00
Eric ChapmanandClaude Opus 5.5 f0a043d73e docs: call NVKE's cluster the management cluster, not the site controller (#1744)
Replace "site controller" with "management cluster" (the cluster) or
"management plane" (the NVKE API and controllers) in docs, CLI docs and
help text, examples, and deploy-path comments. Identifiers such as
nke.site-controller.internal, the site-controller e2e lane and the
dashboard UID are unchanged.

Supersedes #1737, which was closed so the launch batch had no ordering
dependency on #1733.

Signed-off-by: echapman13 <echapman@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:37:06 -04:00
Aaron Patten c60009c73a docs: fix operator-guide paths and versions (#1712)
* docs: fix operator-guide paths and versions found after #1391

The OIDC kubeconfig steps read the admin kubeconfig from the directory
above the checkout and register an absolute path. The SPIRE CA variables
are absolute paths, because the bootstrap and the install run from
different directories. Supported platforms lists the three Kubernetes
versions the node image stages, troubleshoot gives NVKR's current Go pin,
the write-docs-page template fence no longer closes early, and the mock
cluster example says why it asks for 1.34.8.

Signed-off-by: Aaron Patten <apatten@nvidia.com>

* docs: note release qualification targets 1.36, explain the template fence

Supported platforms keeps the three staged Kubernetes versions and says that release qualification targets 1.36. The write-docs-page template says why its fence is four backticks, and the mock cluster example's comment no longer names the real-site version.

Signed-off-by: Aaron Patten <apatten@nvidia.com>

---------

Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-16 14:25:48 -06:00
Terry Howe dc6de14c28 feat(cli): default the generated site spec to Kubernetes 1.36.3 (#1702)
`nvkectl generate sitespec` wrote k8sVersion "1.34.2", the oldest of the
three Kubernetes versions the node image stages
(os-image/packages/kubeadm-distro/Makefile sets
K8S_VERSIONS ?= v1.36.3 v1.35.3 v1.34.2). A management cluster is set once
at bootstrap and does not upgrade itself, so the default decides what a new
site runs for its whole life. 1.36.3 is the newest staged version and the
minor every stream in release/policy.yaml targets.

Move the default, the two bundled site-spec examples and the docs that
state it. The NICo release examples move with it: a ClusterRelease or
NodePoolRelease annotated machine-init-kubernetes-version "1.34.2" with
-injected "false" is only a candidate for a 1.34.2 cluster
(controller/internal/machinerelease/upgrade.go rejects a mismatch), so
leaving them behind would have made the bundled NICo example set
inconsistent with the site spec beside it.

cli/examples/capd-cluster.yaml stays on 1.34.2 deliberately. CAPD runs on
kindest/node, pinned to v1.34.8 by
controller/hack/capd-kindest-node/build-image.sh, so that example has to
track the 1.34 line rather than the node image.

Verified: gmake -C cli test, gmake -C cli lint, gmake docs-check.

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-16 13:28:34 -06:00
Pat Christopher 0c48b2612e feat: bootstrap site can use capnico for initial node creation (#1356)
* fix: rebase

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: rebase repair

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* feat: make bootstrap nico follow patterns of tenant nico registry

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* feat: dry-run catches mTLS mismatches

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: code review updates

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: linter fixes

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: code review comments

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: refactor, comment update

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: review changes, use approved schema

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: nico bootstrap troubleshooting

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: capnico manifest

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: review comments

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: more review comments

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: review comments

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: local agent reviews

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: local agent review

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* feat: move credentials from sitespec to env vars

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: more agent fixes

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: more agent review

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: more agent reviews

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

* fix: more agent review

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>

---------

Signed-off-by: Patrick Christopher <pchristopher@nvidia.com>
2026-10-16 03:35:53 -07:00
LiaandClaude Fable 5.1 8bcb48d4f9 feat(cli): the stack install reads a stack config file (#1682)
* feat(cli): the stack install reads a stack config file

The controller stack install takes its site-specific input from a JSON
file of its own, the stack config, loaded by the new
cli/internal/deploypath/stackconfig package: the NICo API and the optional
image overrides and mirror. The file is decoded strictly through
sigs.k8s.io/json, so an unknown, duplicate or differently cased key is
refused, as are a REPLACE_* placeholder, an empty required value, a null
object, an endpoint without a scheme or with a user and password, and a
mirror with a scheme. Every problem is reported at once as
"<json path>: <problem>", a stray key beside the value problems.

The credentials stay in the environment and move to the same package:
NVKECTL_NICO_TOKEN, NVKECTL_NODE_USER, NVKECTL_NODE_PASSWORD and
NVKECTL_DATABASE_PASSWORD are the stack install's input, not the site
spec's.

The site spec carries the bootstrap's fields only: the site name, the
control-plane VIP, the SPIRE trust domain and CA. The render reads both
files, --sitespec with --stack-config and neither without the other, and
takes the nodes' architecture from --arch, validated, for both the release
artifacts and the SPIRE TPM attestor checksum; without the flag the host's
architecture is used with a warning.

nvkectl inspect stack-config, a hidden reader like inspect sitespec,
validates the file and the credentials and prints STACK_CONFIG,
STACK_NICO_ENDPOINT and STACK_NICO_ORG_ID for the install scripts.
validate sitespec checks the site spec and prints "valid"; inspect
sitespec prints the three site facts. deploy/examples/stack-config.json is
the operator's starting point.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): the scripts take --stack-config and read the node architecture

check-site.sh and nvke-deploy.sh take the stack config beside the site
spec and refuse one without the other. Both start with an inputs line
that names the two files, the site and the NICo endpoint. The check
validates the stack config and the NVKECTL_* credentials through
nvkectl inspect stack-config and fails on nodes that report two
architectures or none. The executor reads the architecture from the
cluster and passes it to the render as --arch; --arch on the executor
stands in for the read, and a dry run with an unreachable API renders
for the host. The kind lane fills a stack config template next to the
site spec template. The deploy READMEs and the cli docs describe the
file.

Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(operate): the install reads a stack config file

The install page gets a "Write the stack config" section with the
credentials step, the example file and every key. The inputs table,
the artifact-source table, the check and install commands, the
troubleshooting entries and the pages that link to the section follow.
The node architecture is read from the cluster, so no page asks for it.

Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 17:54:58 -07:00
Abhinav Pandey 1ededf3bce refactor(cli)!: read site credentials from the environment and drop unused site spec fields (#1644)
The site spec describes the site, so it can be committed and used unchanged
on any machine. Credentials and machine-local file paths now come from the
environment of the command that needs them, and fields nothing consumed are
removed. A spec that still sets a removed field fails to load, and
generate sitespec --set refuses it, naming the replacement.

- spire.caCertFile/caKeyFile -> NVKECTL_SPIRE_CA_CERT_FILE/_KEY_FILE, with
  spire.upstreamCA: true recording that the site uses the CA; with it every
  run requires the variables, so none falls back to a self-signed root
- SPIRE_CA_CERT_FILE/SPIRE_CA_KEY_FILE are refused, naming their replacements
- controllerStack.nico.tokenFile -> NVKECTL_NICO_TOKEN
- controllerStack.tenant -> NVKECTL_NODE_USER, NVKECTL_NODE_PASSWORD
- controllerStack.database.passwordFile -> NVKECTL_DATABASE_PASSWORD; the
  render no longer generates and writes a password file, and the
  removed-field error names the old file whose contents to use
- controllerStack.nktpValuesFile -> nvke-deploy.sh --values-for nktp=<file>
- registry block, --registry-api-key and REGISTRY_* overrides removed: no
  code read them; private image pulls use nerdctl login
- validate sitespec checks the environment; bootstrap site logs the CA paths
- CI harnesses and docs follow the same inputs; the bootstrap e2e asserts a
  supplied CA is the root SPIRE publishes

Signed-off-by: Abhinav Pandey <abhinavmpandey08@gmail.com>
2026-10-15 16:07:51 -07:00
Miancheng Lin 3317737e1e refactor(api): rename the OS profile surface to releases (#1612)
* refactor(api): rename the OS profile surface to releases

/osProfiles becomes /releases and nico.osProfile becomes nico.release, so
the REST API uses the release vocabulary the rest of the management plane
already does. Internal db and workflow structs keep their field names.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* refactor(controller): rename the OS profile to the release

Nico payloads gain a release key. os_profile is still written alongside
it and still read as a fallback, so a CWE predating the rename keeps
reading and writing the value through a rolling upgrade or a rollback.
No stored data changes. A later release backfills release from
os_profile, then drops the mirror and the fallback.

The os_profile Prometheus label is deliberately unchanged.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* docs: follow the OS profile rename

The request YAML in the workload-cluster guides named a field the API no
longer accepts, and two troubleshooting entries quoted error text that no
longer appears. The dashboard panel descriptions in operate/observe.md
keep the old wording: the panels and the os_profile metric label they
read are unchanged.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* fix(scripts): read cluster NICo fields from .nico and allow an absent configProfile

The cluster-level orgID, siteID and vpcID live under .nico in the API
response, as the node pool fields already corrected do, so the script
exited before generating anything. configProfile is optional in the same
schema, and requiring it skipped a valid node pool.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

---------

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-15 11:56:35 -07:00
Lia 5038f6faaf feat(deploy): check-site.sh, and the site controller install as a list of commands (#1586)
* feat(cli): inspect sitespec prints the site values the shell reads

A hidden command: the site name, the management VIP, the trust domain
and the node architecture of a site spec, as shell assignments.
deploy/check-site.sh reads the architecture through it.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): the stack install needs no registry pull secret

CAPNICo's GHCR package is public, and with a release its image comes by
digest from the release's registry or the local layouts. The site spec
loses controllerStack.pullSecret, the deploy path renders no
ghcr-imagepull Secret, CAPNICo's manifest names none, and the e2e suite
and the kind lane take no GHCR credential. A site spec that still
carries the block no longer loads.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): check-site.sh reports what the site needs before the stack installs

One line per finding and the fix with it: the tools and the helm pin,
the checkout, the site spec, the release description and its declared
qualification, the run directory, the cluster API, an odd node count,
the node architecture against controllerStack.arch, the control-plane
taint the bootstrap removes, exactly one default StorageClass, the
Cluster API version, egress and disk. It changes nothing and exits
non-zero on a FAIL; when ready it prints the executor command.
--diagnostics writes nodes, pods, events, helm releases and the
controller logs under the state directory after a failed step.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane runs the site runbook in order

check-site.sh, clusterctl init, the executor, then the SPIRE exec-auth
patch, the order the install guide gives. apply-capi-spiffe-exec-auth.sh
takes --kubeconfig so every kubectl call is pinned to the site cluster.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(deploy): check-site.sh treats a failed cluster read as a finding; the e2e suite expects the executor's subcommand

A denied, timed-out or flaky kubectl read used to come back empty and
pass, so a Cluster API that could not be read was reported as not
installed yet. Reads now fail the finding with kubectl's error, and
only NotFound means Cluster API is absent. The wrong-version finding
names the clusterctl upgrade command instead of a page that has none.
The ready line prints the init command only when one was emitted and
the executor by its resolved path. The suite covers denied reads, an
installed Cluster API and the NotFound case. The e2e dry-run test
expects nvke-deploy.sh install, which is what the stack driver builds.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(deploy): check-site.sh findings hold under more clusters; the executor refuses an unknown item type

The taint finding matches NoSchedule only, not PreferNoSchedule. The
Cluster API finding compares the image tag with a digest suffix stripped,
and a core at the pin without the kubeadm providers is a finding. A
missing nvkectl is a finding that skips the site spec and release
checks rather than an exit. Printed commands are shell-quoted. The
verdict and the diagnostics line carry the script's own name. inspect
prints no trace ID, so every line of the check is a finding. The
executor's item parser accepts only the item types the deploy path
format defines, so an unrendered path with an unknown type is refused
before anything is applied. The e2e driver writes placeholder registry
values for controller releases whose base-config template still reads
them. The exec-auth script refuses an empty --kubeconfig. The kind lane
workflow runs on changes to the files the lane now executes. The suite
covers an even node count, an architecture mismatch, two default
classes, an unreachable API, a core-only Cluster API, a missing
nvkectl, the unknown item type, and asserts the check makes no mutating
kubectl call. lib/common.sh holds only what the check uses.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* test(deploy): fix a quoting slip in the suite

An apostrophe escape meant for a single-quoted string sat inside a
double-quoted one and turned the rest of the file into a string.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* chore(deploy): the check and the lane name the operator guide that lists the install steps

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(deploy): the check reports what it cannot read; the e2e placeholder registry is one no image uses

A denied read of a kubeadm provider is a finding and no longer followed
by an 'already installed' pass. A Cluster API image pinned by digest
alone is reported as such rather than by its repository name. The
commands inside findings quote their paths. A site spec that nvkectl
cannot read is a finding, not an exit. The e2e driver's placeholder
pull-secret names a server no image uses, so older controller releases
that render it pull the public CAPNICo image anonymously.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-10-14 11:48:12 -07:00
Alexander Greene 3038cf917c feat(controller): gate new Calico clusters (#1599) 2026-10-14 07:19:24 -07:00
Eric ChapmanandClaude Opus 5.5 0a40b93c30 docs: add the initial documentation set (#1391)
* docs: add the minimal launch documentation set

Add the sixteen pages an operator needs to evaluate NVKE, install it on
NICo, create workload clusters and operate them: an overview, preview
status and known limitations, supported platforms and versions, a local
quickstart, the install path (plan, build node images with NVKR, prepare
nodes, bootstrap, install management-plane services, configure NICo,
secure the API), workload cluster tasks (create, access, manage node
pools), observe and troubleshoot.

Each page was checked against the code at the current commit. The
navigation in docs/index.yml now presents the set as one path; older
pages stay in the repository but leave the navigation. Two links in kept
pages are repointed to the new pages.

Add .claude/skills/write-docs-page, the authoring conventions the pages
follow, so later edits keep the same structure, voice and terminology.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: echapman13 <echapman@nvidia.com>

* docs: say NVKE and nvkectl in the launch pages, and index them

Rebased onto main after the product rename. The launch pages now use
nvkectl, the nvke-* package, script, metric and dashboard names, and the
NVKR names (nvkr, definitions/nvke-*, .nvkr/). Persisted names that have
not moved keep their spelling: nke-controller, nke-system, nkeOIDCAuth and
the nke.nvidia.com node conditions.

docs/README.md gains an Operator guide section with a row per new page,
and the write-docs-page skill's example links no longer resolve outside
docs/, so docs-check passes. The skill's checklist now asks for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: echapman13 <echapman@nvidia.com>

* docs: follow the release-based install and address review comments

Install management-plane services follows the install in #1586 and #1616:
the site spec's controllerStack section, a release description or local
NVKR Run (or neither, with controllerStack.images), check-site.sh,
clusterctl init at v1.13.6, nvke-deploy.sh install --sitespec, the OS
release resources, the exec-auth patch, a NetworkPolicy for API clients
and set-site. Plan, troubleshoot, provider-nico, api-authentication,
observe and supported-platforms follow it.

Build node images with NVKR becomes Get NVKE artifacts and OS profiles
built with NVKR: a
handoff to NVKR's own documentation (what the install takes from a
release, verify then export, what each evidence lane proves) and OS
release resources written from cli/examples, since #1590 removed
osprofiles-to-crs.

Review comments:
- quickstart: Kubernetes 1.34.8, the node image's version (the mock
  example now requests it); the inotify instance limit; an explicit
  management kubeconfig; cleanup removes only what the page created
- bootstrap: keep the kubeconfig for the pages that use it; it is now a
  break-glass client certificate
- access: the kubeconfig pipeline cannot truncate an existing file
- node-pools: the first pool's prefix or subnet IDs
- api-authentication: bearer tokens only over TLS or a trusted network;
  settings applied by re-running the install with --values-for
- observe, provider-nico, node-pools: the kubectl alternative when API
  authentication is on
- overview: evidence lanes instead of a general signing claim, node pool
  labels and taints are stored but not applied, AICR is not covered,
  the evaluator needs a Linux host, not a laptop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: echapman13 <echapman@nvidia.com>

* docs: link the AICR docs and list Kubernetes 1.36.3 as supported

The overview's Day 2 row and its component table link to the AI Cluster
Runtime documentation for installing the accelerated runtime, rather than
saying these pages do not cover it.

Supported platforms lists the one Kubernetes version the docs support,
1.36.3, for the management and workload clusters, and notes that
generate sitespec writes an older default unless k8sVersion is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: echapman13 <echapman@nvidia.com>

---------

Signed-off-by: echapman13 <echapman@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:04:47 -04:00
Miancheng Lin 9dcdcbc45b refactor(controller): drop the filesystem OS profile path (#1590)
* refactor(controller): reduce the kubernetes_version migration to its schema change

The backfill populated existing node pools and node sets from OS profile
metadata on disk. It is no longer needed: every database with rows to populate
applied this migration long ago, and the only database that still runs it is a
new one, which has no node pools or node sets.

Dropping it removes the last production caller of internal/utils/osprofiles.go.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

* refactor(controller): drop the filesystem OS profile path

OS images and releases are resolved from MachineImage, ClusterRelease and
NodePoolRelease custom resources. The filesystem tree they replaced had no
reader left, so it goes along with the tool that converted it:

- hack/osprofiles-to-crs and its make target, fixture-releases
- internal/utils/osprofiles.go
- the osProfiles trees under test/fixtures/profiles and profiles/example

PROFILES_DIR stays. It still carries config profiles and the runbooks their
hooks reference, which have no custom-resource equivalent.

test/fixtures/releases is now maintained by hand. The converter's --check test
was what held it to the profile tree; with no tree to compare against, the
remaining cover is go test ./internal/clients/nico, which renders bootstrap
user-data from the nodepoolrelease manifests.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>

---------

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-13 16:48:08 -06:00
Lia eac79fa4c1 ci: bring the controller stack up on kind from a release, rendering inside the executor (#1583)
* ci: bring the controller stack up on kind from a release description

The lane builds the controller and the profiles fixture into OCI layouts,
copies the CAPNICo image, fills a nvkr.dev/release/v4 file from their
digests, renders deploy/nico against it with --nvkr-run-dir, installs the
result on a kind node and checks the pods run the release's digests.
Advisory; not a merge-gate member.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): close the deferred findings of the site render

spire.trustDomain is required and never derived. The controller reads its
connection string from the chart's Secret, URL-escaped. A deploy path
missing a site-values item is refused. A malformed release.yaml is
reported once. Notes reach the log only when the render succeeds.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* chore(deploy): build the test nvkectl with the cli target and resolve Makefile paths from the file

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(deploy): say which per-site values the render supplies and from where

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: give the kind lane the nktp values the other kind lanes use

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): render for the site and the release inside nvke-deploy.sh

install --sitespec … --release … [--nvkr-run-dir …] renders the deploy
path through nvkectl into a private scratch directory, installs it and
removes it, so no rendered credential is left behind. nvkectl render
deploy-path is hidden: the script is its caller.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane renders and installs through nvke-deploy.sh

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: free the runner's disk before the kind lane and record disk usage on failure

The stack's images filled the root volume; the postgres layer could not
be extracted.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>
(cherry picked from commit 2dda40b10fc3cac98edcb136c97f70a9ac748f72)

* ci: the kind lane checks the stack's own workloads, not every pod

An nktp gateway autoscaler may add a replica the runner cannot schedule;
kubectl wait --all then reports every later pod as timed out unchecked.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane caps nktp's autoscaled collectors at one replica and asserts every stack pod

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane takes the nktp kind values as they are once they carry a ceiling

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane checks the clusterctl digest, names pod-list errors and asserts the spire namespaces

The pod sweep covers nke-system and spire-system, where the agent and
the CSI driver run, instead of a namespace no deploy path creates. A
failed pod list stops the lane with its namespace. The nktp guards match
a whole maxReplicas: 1 line. clusterctl is checked against the pinned
sha256, and the lane runs on every input it reads.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): validate sitespec requires the trust domain the render requires

validate sitespec reports a missing spire.trustDomain, so its exit code
means the file is ready for the controller stack install. The render
checks the trust domain and the TPM checksum before it generates the
database password, so a refused spec leaves no file behind. The template
and the docs say the field is required for the stack install.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(deploy): --release needs --sitespec, which names the architecture

Without the site spec the render would pick artifacts for the host
architecture. The usage says --dry-run still renders and may create the
database password file. The docs describe the rendered tree as the
scratch tree the install removes.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* chore: drop an orphan comment from .gitignore

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane's release carries the release-description/v1 schema

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(cli): the bootstrap and the stack install share a default trust domain

Both default to nvkectl-bootstrap.nke.local, the domain of a bootstrap with
the default cluster name, so a site spec that sets spire.trustDomain to
nothing joins them to one domain. The render warns when it uses the
default; the bootstrap tells the operator to set the field when it ran
under another cluster name. validate sitespec no longer requires the
field, and says the bootstrap can run with the file while the
controllerStack section is still to fill in.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): the render scratch lives under a private state directory and the kind lane proves it is removed

The render goes under NVKE_STATE_DIR (default $XDG_STATE_HOME/nvke),
created 0700, and is removed however the script ends. The suite checks
the directory mode and that a failed render leaves nothing. The kind lane
runs an install whose render fails and the real install under its own
state directory, and dies if either leaves a scratch tree or any rendered
file behind.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(cli): spire.trustDomain is set once before the bootstrap, or never

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* ci: the kind lane works in a per-run directory it never empties, and runs on site-spec changes

The telemetry docs name the site spec's clusterName and nktpValuesFile as
the inputs of a site install, and --config and --values-for for an
install without one.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): the bootstrap says when it defaults the trust domain; the kind lane owns its cluster and waits for Ready

The bootstrap logs the defaulted trust domain as soon as it takes it, and
warns when a custom bootstrap cluster name makes it differ from the
install's default; validate sitespec qualifies the shared default the
same way. The kind lane refuses a kind cluster of its name that was there
first and deletes only one it created, and a pod counts as ready only
when its Ready condition is True.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(deploy): the usage says where the render lives once, and what --nvkr-run-dir is for

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix: the review round on the kind lane and the trust-domain docs

The bootstrap says it defaulted the trust domain before a dry run returns.
The docs qualify the shared default for a renamed bootstrap cluster, and
the troubleshooting entry names an install the script accepts. The
password file note is said at once. The executor renders with --ephemeral,
so the summary does not ask the operator to delete a directory the script
removes. The kind lane runs on the mirror branch only, on every input it
reads, and its cleanup probe has to fail in the render itself.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-10-13 14:31:52 -07:00
Terry Howe 92d0f1541b refactor: rename CRD group to internal.nvke.nvidia.com and NKECluster to NVKECluster (#1585)
* refactor: rename CRD group to internal.nvke.nvidia.com and NKECluster to NVKECluster

Moves the management-engine's internal API group from internal.nke.nvidia.com
to internal.nvke.nvidia.com and renames the NKECluster kind to NVKECluster,
with its plural, controllers, finalizers and generated artifacts.

A group change is a new CRD: there is no conversion webhook and no automatic
migration, so existing sites copy their CRs across by hand. The procedure is
documented in docs/operations/crd-group-migration.md.

Regenerated with `make generate manifests` in management-engine and
`make chart-crds` from the root.

Two names the issue listed stay as they are, and the allowlist entry is
re-scoped rather than removed:

- NKENodePool and nkeClusterRef belong to the DGXC platform API
  (compute.private.x-dgxc.nvidia.com), which this repository emits CRs for in
  controller/scripts/cwe-to-platform-crs.sh but does not own.
- NKECluster also appears there, and in hack/test_name_check.py, where it is
  the fixture that proves the name-check detector still catches the shape.

Refs #1551

Signed-off-by: Terry Howe <thowe@nvidia.com>

* fix: add the migration page to docs/README.md and reformat after the rename

docs-check requires every page under docs/ to have a row in docs/README.md,
not only an entry in docs/index.yml.

The longer group name pushed a map literal out of gofmt alignment in
cli/internal/operator/dynamic_test.go, which golangci-lint reports as gci.

Refs #1551

Signed-off-by: Terry Howe <thowe@nvidia.com>

* docs: rewrite annotation keys and order CWE in the CRD group migration

The release CRs carry machine-init-kubernetes-version annotations under the old group prefix; copying them verbatim would hide them from the controller. Rewrite the keys, drop last-applied-configuration, verify in step 5, and document the CWE ordering and why status must be restored while the engine is stopped.

Signed-off-by: Terry Howe <thowe@nvidia.com>

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-13 14:59:44 -06:00
Lia ac96cd13f0 feat(cli): render a deploy path for the site the site spec describes (#1567)
* feat(cli): render a deploy path for the site the site spec describes

nvkectl render deploy-path copies a deploy path and resolves it for the
site: the controller, SPIRE, PostgreSQL and Temporal items get a
site-values.yaml built from the site spec's controllerStack section (the
database password, the OIDC discovery URL, the SPIRE server address and
identity, the controller's admin ID, the TPM attestor checksum, the
bootstrap CA, a registry mirror), template items are rendered with Go
text/template and become manifest items, and site.env names the site.
Secrets are read from the files the spec names and written into the
result, so it is created 0700 and is for one install. The executor
installs the result with no --config. deploy-test joins the merge gate
with the executor's dry-run suite; the executor stops on a parser
failure instead of installing nothing.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(cli): name the item list file by its current name

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): review fixes for the site render

A rendered tree installs from anywhere: a committed chart.path is written
absolute, and the executor takes an absolute chart.path as is. Secrets
holding a quote, a backslash or a control character are refused by
field, since the templates carry no escaping. spire.ca*File resolve from
the working directory, as bootstrap site reads them. The OIDC domains are
read from the overlay as YAML, so a comment inside the list no longer
truncates it. --out is created first with Mkdir, so an existing directory
is left alone, and --out inside the deploy path is refused. A manifest
item's image: rejects a digest. nktpValuesFile without an nktp item is a
problem. The bootstrap's TPM checksum lookup calls the exported one. The
test suite's mode check is portable and its order check can fail.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): refuse a checkout path with whitespace in the render

The rendered chart.path is one unquoted token for the deploy path reader,
so a checkout under a directory with a space rendered and then failed at
install time. The render now reports it. The --out guard resolves symlinks
before comparing with the deploy path.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* refactor(cli): export the TPM attestor checksum lookup as is

Rename tpmPluginChecksum instead of wrapping it; the render tests for an
empty checksum like the bootstrap does.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): refuse unknown item types and whitespace in absolute chart paths

Items accepts only the four types the executor dispatches. The whitespace
check covers an absolute committed chart.path too. The nested --out test
runs on a copy of the deploy path.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(cli): keep the database password in the operator's file only

controllerStack.database.passwordFile is required. A missing file is
created with a generated password, 0600. The rendered tree holds no
db-password copy.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(deploy): reference the SPIRE CA with chart.setFile instead of copying it

A helm item's release.yaml takes chart.setFile: <helm key>=<absolute path>
entries the executor passes as --set-file. The render points the spire
item at the operator's CA files; spire/site-values.yaml holds no PEM.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(cli): name the credential files of a rendered deploy path

The render lists the files under --out that hold a credential and writes
a .gitignore that ignores the tree, so the operator knows what to delete
and a repository does not pick it up by accident.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(cli): refuse a rendered deploy path under a shared temp directory

--out under /tmp, /var/tmp, their /private forms or the process temp
directory is refused before anything is written. Tests opt out through
RenderOptions.AllowTempOut; the deploy suite through
NVKECTL_RENDER_ALLOW_TEMP_OUT=1.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(cli): keep temporal's passwords under a mirror and refuse incomplete site values

A mirror merges into temporal's server values instead of replacing them.
The render refuses a missing profiles image when the deploy path enables
profiles.image, an empty secret file, a template value the templates
cannot carry, an image override with no tag or digest, a template item
with no template, and an item named . or ... A symlinked deploy path is
resolved; copied files keep their owner exec bit.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-10-12 16:41:34 -07:00
John Griffith 7c7c02949e chore: Rename nke to nvnke for images segment of codebase https://github.com/dsx-ai-factory/nvke/issues/1498 (#1548)
* chore: Rename nke to nvnke for images segment of codebase #1498

This is a "brute force" grep/replace approach to the image related
occurences of the nke name.  The goal is basically just a s/nke/nvnke/g
for everything in the repo that is associated with os-images.

This replacement bleeds into some other components (controller and agent)
that includes references to os-image names.

Closes #1498

* Keep existing image names valid

* Chore: Fix/Add DCO

Signed-off-by: jgriffith <jgriffith@nvidia.com>

---------

Signed-off-by: jgriffith <jgriffith@nvidia.com>
2026-10-12 17:08:48 -06:00
Chao 6bc0e1c9e8 fix(agent): rename node agent package and contracts to nvke (#1565)
* fix(agent): rename node agent package and contracts to nvke

Signed-off-by: Chao Chen <chaoch@nvidia.com>
2026-10-12 14:14:32 -07:00
LiaandClaude Fable 5.1 6334975cdf feat(cli): the site spec carries the controller stack install input (#1429)
The site spec gains an optional controllerStack section: node
architecture, the NICo API, the registry pull secret, the tenant login
and paths to the files that hold tokens and passwords. generate sitespec
writes it with REPLACE_* placeholders, bootstrap site lists the ones still
in the file, and nvkectl validate sitespec checks the whole file by
section, so the install refuses a placeholder.

Co-developed-by: Claude <noreply@anthropic.com>

Signed-off-by: Lia Campbell <liac@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:26:02 -07:00
Davanum SrinivasandClaude Fable 5.1 3baba6d1b4 ci: give the name check its launch allowlist, and move the stragglers to the new name (#1484)
* chore: move test doubles, examples and stale references to the new name

What the name check still reported outside the Tier 2 identifiers:
synthetic names in tests (nke-site, nke-old, nke-injected, nke-role,
nke-key-1 and friends), registry and path examples in documents and
flag help (registry.example.com/nke, ghcr.io/my-org/nke, ~/dev/nke),
development defaults (DEV_NAME, kind contexts, the promtail job, the
mutagen example), stale references to packages renamed earlier
(internal/nke, nke.NewClient, nkecli, nkeutils), the `nke#1399` issue
shorthand, the CI image tag nke/capd-reboot-controller, the prune
script's package names, and a few comments and messages. The
UpdateNKERBAC rpc's errors now start with the rpc name, which no caller
parses.

Kept: the two synthetic fixture profiles' image URLs, because
osprofiles-to-crs refuses to change a published MachineImage spec; the
salt of the bring-up VMs' default password hash; the legacy installer
path the kubeadm-distro test asserts is absent; the fleet names existing
sites carry. The postgresql chart's description changes with a patch
bump.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* ci: give the name check its launch allowlist

hack/name-check-allowlist.txt grows from two entries to 48, each with
its reason: the Tier 2 identifiers that stay until the post-launch
release (PR4 Kubernetes, PR5 node, PR6 OS image and packages), the
permanent keeps (migration names and texts, the NKEAuth magic and its
package, fleet release and profile names, the identity of existing
sites), the settings-coupled names (the old NGC token secret, the
CODEOWNERS team slugs, the S3 and apt names, the old CLI name), and the
files that keep the bare word (the agent version line the updater
parses, the OIDC upstream CA subject, the Keycloak lab, the two NVCR
workflows whose NGC organisation is named NKE).

With it, NAME_CHECK_MODE=fail make name-check passes on this tree:
5,908 hits, all allowed, every entry in use. The make target keeps
report mode until the launch flips it (W4).

Closes #1483

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 19:24:52 -04:00
Davanum SrinivasandClaude Fable 5.1 668bc38a9b feat(cli)!: rename nkectl to nvkectl, keeping the old names for one release (#1456)
The binary, its directory, its config directory and its environment
variables take the new name. For one release the previous names still
work: every NVKECTL_* setting is also read under its NKECTL_* name with a
deprecation warning (the NKECTL_CWE_* names of the generation before are
no longer read), a config file left under nkectl/ is read and copied to
nvkectl/ once, and releases publish both nvkectl-<os>-<arch> and
nkectl-<os>-<arch>, to GitHub and to S3 under the existing prefix.

The e2e helper package, the e2e test, the smoke and fetch scripts and
the bootstrap e2e workflow follow the binary; the fetch script accepts a
release that carries only the old asset name. The CLI's own documents
and the two installation documents that print the download URLs change
with it.

Kept on purpose: the NVCR repository name until an nvkectl repository
exists in the NGC org, the S3 prefix the publishing role's policy names,
and the prose in the other documents.

BREAKING CHANGE: the CLI is installed and invoked as nvkectl. The
previous binary name, environment variable names and config directory
are honoured for one release, as described above.

Closes #1455

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 17:04:03 -04:00
Anisha Gupta USandClaude Sonnet 5.5 d0325ccf8a test(cli): cover node labels and taints on create (#1404)
* docs(cli): document and test node labels and taints on create

The controller now takes nodeLabels as a map and nodeTaints as a list on
create nodepool and create cluster. nkectl passes the spec through the
generated types, so no command code changes; this documents the fields, adds
tests for them, and has the e2e CLI node pool spec read them back.

Labels and taints are create-only, so patch nodepool and patch cluster keep
rejecting them. Tests pin that, and that controller validation errors reach
the user unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): trim review follow-ups to the create-path coverage

Drop the help and user-flow prose, which repeats the schema served at
/api/docs, and the patch rejection tests, which duplicate the existing
unknown-field cases. Fold the cluster create assertions into the existing
create test and inline the node pool fake's label and taint defaults.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): show nodeLabels in the cluster examples

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): leave the real-site cluster example unchanged

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): drop the lifecycle spec doc-comment addition

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): check stored labels and taints in the create-from-file test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* test(cli): remove an unused import from the create test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

---------

Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-09 16:42:58 -04:00
Aaron Patten 9b87e9b636 chore(nkectl): say controller, not CWE, in output, comments and tests (#1386)
Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-09 11:07:29 -04:00
pbikki 97c6dee071 feat(controller)!: add node labels and taints to the API schema (#1306)
Support adding nodelabels and taints in API. This change covers the OpenAPI schema, the generated API types, the database schema and migration, and the create and read handlers that store and return the values. Stored labels and taints are not applied to Kubernetes nodes, which matches current behavior. A follow-up MR will apply them. Shipping the schema now lets API consumers, including nkectl, adopt the new fields.

BREAKING CHANGE:

- nodeLabels changes from a list of key=value strings to an object of keys and values on control-plane and node-pool create and read.
- nodeLabels is removed from PATCH UpdateClusterControlPlaneConfig rejects unknown fields, so a patch that still sends controlPlaneConfig.nodeLabels returns 400. The same applies to a node-pool patch that sends nodeLabels or nodeTaints.
2026-10-08 17:00:49 -05:00
Alexander Greene 92a3039bae feat: default CNI to ovn-kubernetes (#1303)
* feat: default omitted CNI to ovn-kubernetes

Empty cniPlugin and cniName now select ovn-kubernetes, and local images, examples, and create scripts follow that default. calico remains an explicit override.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: build OVN packages outside the gitignored bin directory

crane was installed into the package tree's bin directory, which a checkout sync can delete while the download is still running. Stage the tool in the build scratch directory and create its destination immediately before moving it.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): complete pod checksums on the userspace datapath

veth pods send partial checksums, and the netdev datapath forwarded them unfinished, so receivers dropped pod traffic to services and the node. Enable userspace TSO and restart ovs-vswitchd only when the setting changes.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(tilt): label the local NICo cluster button inputs

The create dialog showed the defaults with no captions because text_input was called without label.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* feat(controller): ensure host vTPM proxy for nico-containers on Linux

Share ensure-vtpm-proxy.sh between Colima and bare Linux hosts, fail fast
from Tilt and nico-sim when /dev/vtpmx is missing, and document the one-time
host prep so remote Tilt targets do not hang waiting for kubeconfig secrets.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: load the vTPM proxy on the kernel that runs Docker

Container nodes need /dev/vtpmx. Without it, swtpm never starts and nke-agent blocks while setting up SPIFFE, so provisioning looks stuck. Colima already loaded the module inside its VM, but a Linux host never did. One script now does that load, and make host-up runs it on either machine.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): keep an explicit OVN version when the plugin name is omitted

Kubeadm init with no plugin name defaults to OVN, but a version sent with that request was discarded and 1.4.0 was installed instead. The requested version is used, and 1.4.0 is applied only when none was given.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): retry userspace TSO after a failed ovs-vswitchd restart

ovs-vswitchd reads userspace-tso-enable only at startup. A failed restart left the setting enabled, so the next attempt treated it as already applied and never restarted the daemon. The previous value is restored on failure so the restart is tried again.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): install the CNI image package selected for a Forge sample cluster

The Forge sample accepts CNI_PLUGIN=calico, but both node pools always installed the OVN image package. The pre-kubeadm commands now install the Calico images for Calico and the OVN images for OVN.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild CAPD OVN assets when any package is missing

capd-image skipped preparing OVN assets when the charts package was present and newer than the script, even if the images or Helm package was gone. It now rebuilds when any of those packages is missing, and still rebuilds when the prepare script is newer than the charts package.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): fail the nico-vms sample create on HTTP errors

The create request returned success on a 400 or 401 because curl exits 0 unless --fail is set, and --fail hides the body. The response stays visible, and the script now exits from the HTTP status.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): check the vTPM device in the configured Colima profile

The macOS check ran colima ssh without a profile, so a non-default COLIMA_PROFILE could be reported missing or present against the wrong VM. The device checks now use the same profile colima-start.sh prepares.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: default each CAPD OVN package path on its own

Setting CAPD_CNI_CHARTS_DEB_PATH skipped the images and Helm packages, so the node image was built without them. Each path is filled in when it is unset, and each one is checked before the image build.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): run container nodes on the kernel Open vSwitch datapath

Userspace Open vSwitch encapsulates Geneve but has no port that can emit it, so traffic between container nodes is dropped. Container nodes now load the host kernel module and keep the dummy gateway bridge.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: drop the duplicate /lib/modules mount from CAPD nodes

Kind already bind-mounts the host module tree read-only, so listing it again in extraMounts makes Docker reject the node container.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(cli): load the vTPM proxy without sudo when already root

The arm64 bootstrap runner executes the job as root, and its sudoers file rejects sudo from root, so the e2e died after the fake nodes were ready.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild the CAPD Helm package when the OVN asset script changes

The Helm freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale nke-e2e-helm.deb in place.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): create the sample CAPD cluster through controlPlaneConfig

The local controller rejects control-plane node pools, so the sample script's node pool was rejected before a cluster was stored.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: build the CAPD bundle mirror for the Docker daemon's architecture

The legacy bundle path defaulted to amd64 OVN packages, so an arm64 daemon was served image debs it cannot install.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(agent): reject an unknown CNI plugin instead of installing OVN

The empty-plugin default already lives in the kubeadm init helper. The installer was also rewriting a typo to ovn and mutating the request.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix: rebuild the CAPD OVN images package when the asset script changes

The images freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale images deb in place.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(api): waive omitting cniPlugin on cluster create

An omitted plugin selects ovn-kubernetes. Clients built against the published spec were required to send the field, so the compatibility gate needs a named waiver.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* fix(hack): target the configured Colima profile for VM setup

SSH, stop, and the failure hints used Colima's default VM, so a non-default profile never received the vTPM module or the Docker limits.

Signed-off-by: Alex Greene <algreene@nvidia.com>

* docs(agent): note that bare metal also uses the kernel datapath

The container check keys off NKE_OVS_DATAPATH_TYPE. An unset variable keeps bare metal and VM nodes off the dummy-bridge path even though they run the kernel datapath.

Signed-off-by: Alex Greene <algreene@nvidia.com>

---------

Signed-off-by: Alex Greene <algreene@nvidia.com>
2026-10-08 16:45:49 -04:00
Miancheng Lin b61f3fe75e feat(cli): manage machine images and releases with nkectl (#1305)
Add nkectl create, get, delete and deprecate for machine images, cluster releases and node pool releases on a site's management cluster.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-07 15:40:35 -07:00
Jun Shun Zhang 582740ef7e feat(controller): require kube-vip for control-plane changes (#1149)
* feat(controller): require kube-vip for control-plane changes

Signed-off-by: Steven Zhang <stevenzhang@nvidia.com>

* fix(controller): block control-plane NodeSet replacement without VIP

Allow CLI control-plane VIPs to match declared node IPs. Keep IPv4,
routable-unicast, pod CIDR, and service CIDR validation. Cover the first
and another declared node IP in validation, generated site specs, and
controller request forwarding tests.

Update documentation with the remaining kube-vip address cleanup and
bootstrap routing constraints. Configuration acceptance does not prove
bootstrap or networking works.

Validation: CLI fmt, lint, and test; CLI preflight with race tests and
license header checks.

Signed-off-by: Steven Zhang <stevenzhang@nvidia.com>

---------

Signed-off-by: Steven Zhang <stevenzhang@nvidia.com>
2026-10-07 15:18:31 +00:00
Lia 7f3f41daa3 docs(nkectl): say where the bootstrap artifacts come from; drop the calico example (#1123)
* docs(nkectl): say where the bootstrap artifacts come from; drop the calico example

user-flow.md and first-cluster.md say what the Kind cluster runs, that
`nkectl get bootstrap-manifest` lists the charts and images the
bootstrap fetches, which NKECTL_* variables change where they come from,
and that Cluster API and cert-manager still come from github.com.
first-cluster.md also points at hack/mirror-bootstrap-images.sh.

The `--set cluster.cniName=calico` example is gone from the docs, the
site spec template and example, and `generate sitespec --help`. calico
is the development CNI; customers run ovn-kubernetes. Every place that
listed the two CNIs now says "calico is accepted for development". The
first-cluster.md Path C cloud-init installs the OVN packages, matching
the CNI its example selects, and its --set example uses cluster.podCidr,
which needs no BGP peering.

Also: the TestHasRegistryHost comment names the upper-case rule.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(nkectl): keep the lab example valid and state what the manifest leaves out

The --set examples used podCidr 10.100.0.0/16, which sits inside the
default serviceCidr 10.96.0.0/12; they now use 10.244.0.0/16. The
first-cluster.md lab example sets controlPlaneVIP again, with the note
that a VIP is advertised over BGP, and the VIP value matches the other
examples.

first-cluster.md and user-flow.md say the manifest leaves out the kind
node image and what clusterctl init installs, and that images from
ghcr.io, registry.k8s.io and cgr.dev come from those registries. The
remaining places that listed both CNIs now say calico is accepted for
development, and the second cloud-init installs the OVN packages. The
end-to-end claim names the CNI it ran with.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-10-01 12:55:13 -04:00
Anisha Gupta USandClaude Opus 5.5 1e3531e247 docs: move the cluster examples to controlPlaneConfig and document it (#796)
* docs(cli): move the example cluster specs to controlPlaneConfig

CWE expresses a cluster's control plane as a cluster-level
controlPlaneConfig once control-plane controller provisioning is enabled,
and rejects a node pool flagged controlPlane. The three example specs
carried the node pool, so an operator copying one against such a
deployment gets a 400 naming the shape it wanted instead.

Each example now carries the control plane as controlPlaneConfig, keeping
the same cluster: one control-plane node per the previous pool's count,
the same reserved memory, machine template and attestation method, and
the same worker pools under nodePools.

The two shapes are mutually exclusive, so these files are for a
deployment with the flag on. They replace the node-pool versions rather
than sitting beside them: one example per provider is what the docs and
`create cluster --help` already point at, and a reader choosing between
two files would have to know which mode their site controller is in
before they could start.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(cli): assert the examples' control-plane shape and correct two comments

TestExampleClusterSpecsDecode now fails if an example lacks a
controlPlaneConfig or declares a control-plane node pool, so a regression to
the node-pool shape fails CI instead of the first create against a site
controller.

In nico-cluster.yaml, state that the control plane and every node pool must
carry the provider payload the cluster's top-level nico or infra sets, and
that a control-plane node stays on the instance type it provisioned with
rather than moving back up the preference list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* docs: document the cluster-level control plane

Add a control-plane section to the first-cluster guide: what
controlPlaneConfig holds, the provider rule, that a control-plane node
cannot be deleted while fewer than three joined ones would remain, and that
a version upgrade waits for enableCPNodeRecycling. Correct the guide and the
nkectl command reference where they still described the control plane as a
node pool or stated the provider rule as "never both".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

* docs: show a controlPlaneConfig example instead of a field table

Replace the field table and the delete/upgrade notes in the control-plane
section with an annotated controlPlaneConfig snippet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>

---------

Signed-off-by: Anisha Gupta <anisgupta@nvidia.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-30 08:20:14 -07:00
vwilson-nvidia 8e8023f5af feat(controller)!: configure SPIRE attestation at deployment (#850)
- remove SPIRE attestation selection from cluster and node-pool APIs
- add deployment-wide Helm configuration with TPM as the default
- use controller configuration for CAPI bootstrap and join-token creation
- add chart assertions for the deployment contract

BREAKING CHANGE: Cluster and node-pool API requests no longer accept
spireAttestationMethod. Configure nodeAgent.spireAttestationMethod in
controller Helm values instead.

Signed-off-by: Vivin Wilson <vwilson@nvidia.com>
2026-09-21 13:28:29 -04:00
Jun Shun Zhang 80ba0c4ab9 feat(cli): support control-plane VIPs in site bootstrap (#820)
Add cluster.controlPlaneVIP to site specs, generation, and environment
  overrides, and forward it to CWE. Reject invalid IPv4 addresses and
  overlaps with node IPs, pod networks, or service networks.

  Extend bootstrap E2E coverage with an FRR BGP fixture, kubeconfig endpoint
  checks, and API readiness through the VIP. Install jq in CI and document
  the BGP requirements and endpoint behavior when no VIP is configured.

  Refs: #567

Signed-off-by: Steven Zhang <stevenzhang@nvidia.com>
2026-09-18 11:50:40 -04:00
Lia 4abbf7f340 feat(nkectl)!: encrypt site cluster etcd data at rest by default (#754)
* feat(nkectl)!: encrypt site cluster etcd data at rest by default

Add cluster.etcdEncryption to the site spec, defaulting to true, and carry
it into the CWE create request. The first control-plane node then starts
with the encryption provider configuration in place, and every node that
joins receives the same key.

Encryption can only be chosen at bootstrap: it is configured during
kubeadm init, and there is no controller on the finished cluster to turn
it on later. An explicit false is therefore permanent, and the field is a
pointer so that "unset" and "false" stay distinguishable.

The field is a YAML bool, so --set and the render path emit it unquoted; a
quoted "false" does not decode into the struct and the generated file would
not load. It is settable through CLUSTER_ETCD_ENCRYPTION like every other
cluster field.

BREAKING CHANGE: nkectl bootstrap site now builds encrypted clusters unless
the site spec sets cluster.etcdEncryption: false.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* feat(nkectl): save the site cluster's etcd encryption key before teardown

CWE keeps a cluster's etcd encryption key in a Secret on the cluster it runs
on. During a bootstrap that is the ephemeral Kind cluster, which the command
deletes on success. The nodes keep the key on disk, but nothing that could
later join a control-plane node or rotate the key does.

Once every control-plane node has joined, read that Secret and write it out
as a manifest beside the kubeconfig: CWE's own name for it, no namespace, and
the cluster name in an annotation. A controller installed afterwards is given
the file with -n for whatever namespace it lands in.

The write never overwrites, links a synced temporary file into place so a
planted symlink is not followed, syncs the directory, and reads the file back
before the copy in the bootstrap cluster is allowed to go. A run whose output
path already exists is refused before anything is built.

A capture failure is its own error: the cluster is up and encrypted, the
bootstrap cluster is kept because it holds the key, and the message gives the
command that saves it. It does not end, as the generic recovery message does,
by telling the operator to delete that cluster. Neither the key nor any
command output that could carry it appears in an error or a log line.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* test(e2e): assert the site cluster's etcd data is encrypted at rest

After every node is Ready, create a Secret and read it straight out of etcd
through the etcd pod: the value carries the secretbox envelope and not the
plaintext, checked only after confirming the read returned something at all.
Then compare, by digest, the key `bootstrap site` saved with the key in each
control-plane node's encryption configuration. Neither check prints key
material or ciphertext.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(nkectl): reject an empty etcdEncryption value

The decoder reads "" as false for a bool field. For cluster.etcdEncryption
that is a silent, permanent opt-out, and "" is exactly what an unset
template variable or a stray substitution produces. Refuse it before
decoding, naming the field.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(nkectl): make the key recovery path write what the tool writes

The command a failed key capture prints now saves to the path the operator
chose, owner-readable only, and is built in cwedeploy from the same names
the real read uses, so it cannot drift from it. The kubeconfig is written
before the capture, so a capture failure leaves the operator holding the
admin credential, and the error says where it is.

requireNoKeyFile treats only a missing path as free; a path that cannot be
checked fails the run at the start rather than at the end.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* refactor(nkectl): build the key manifest as a corev1.Secret

k8s.io/api is already a direct dependency, and the type carries the
omitempty/omitzero tags that keep creationTimestamp and status out of the
file. The constants comment now names the controller file they must match
and the e2e that catches drift.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* chore: ignore etcd encryption key files from any working directory

The key is written relative to the working directory, so the rule has to
live at the root. Cover the temporary file it is assembled in as well; an
interrupted run can leave one behind.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(bootstrap): correct the etcd key recovery and restore procedures

Name the bootstrap Kind cluster correctly, state that the restore needs the
saved key base64-decoded once, describe the recovered file's shape, give the
cloud-init example a key output path with the instruction to move the file
off the host, and list the key file wherever the kubeconfig output is.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(bootstrap): state what the saved etcd key file is for

Every control-plane node holds the key in its kube-apiserver configuration,
and the cluster runs on that. The saved file is a convenience for installing
a controller later, and the disaster-recovery copy for a restore onto hosts
where no node survives. Say so where the file is described, instead of
calling it the only copy.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-09-17 09:50:57 -07:00
Abhinav Pandey 0d485f8548 feat(nkectl): add create nodepool (#791)
Adds `nkectl create nodepool -f <spec>`, reading a YAML or JSON
CreateNodePoolRequest from a file or stdin. The spec carries clusterID, so
there is no --cluster flag. A multi-document file is rejected rather than
silently creating the first pool, and a 409 is reported as the parent cluster
being deleted.
2026-09-16 13:23:46 -07:00
Jonathan MeierandOpenAI Codex d1e00b257b feat(cli): spire trust domain main (#783)
* Configure SPIRE trust domain

Add the SPIFFE trust domain to the site inventory and pass it to the bootstrap SPIRE deployment.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* Exercise inventory SPIRE trust domain in E2E

Configure the fake host agents and generated site inventory with the same explicit non-default trust domain.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* Document site SPIFFE trust domain

Require the site specification to match the trust domain provisioned on host agents and used by the permanent SPIRE server.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* Clarify conditional SPIFFE requirement

State that an explicit trust domain is required only when the site bootstrap enables SPIRE and SPIFFE.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: OpenAI Codex <noreply@openai.com>

---------

Co-authored-by: OpenAI Codex <noreply@openai.com>
2026-09-16 13:41:46 -04:00
Vignesh Goutham Ganesh f5373f358b docs: explain how nkectl authenticates to the CWE API (#600)
Replace the stale NKECTL_DEV_TOKEN path with TokenRequest minting from the
site kubeconfig, and document the RBAC nkectl needs on a real site.
2026-09-09 21:02:06 -07:00
Davanum Srinivas 2d3323e417 feat(cli): add NICo example cluster specs (#529)
examples/ had one spec, for CAPD, whose node pools use the infra payload.
Anyone creating a NICo cluster had to read the OpenAPI schema instead.

nico-mock-cluster.yaml runs as-is against the local mock: its UUIDs are
the mock's seeded identifiers. nico-cluster.yaml is the real-site shape,
with every UUID a placeholder.

The two are not interchangeable, which is the part worth seeing side by
side: the mock path supplies NicoCluster and NicoMachineTemplate manifests
through infra, and a real site uses the nico payload, from which CWE
builds those manifests.

The test decodes every examples/*-cluster.yaml through the loader the CLI
uses, which disallows unknown fields, so a field renamed in openapi.yaml
fails here rather than in a user's first create. It covers the CAPD spec
too.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
2026-09-06 14:24:35 -04:00
Aaron PattenandClaude Sonnet 5 5bcba41cb3 docs: point bootstrap site-spec examples at the controller chart (#493)
* docs: point bootstrap example registry at the controller chart

* docs: update BootstrapRepo doc comment example to controller

* docs: update site-bootstrap configuration guide to controller chart

* docs: update custom-base-os example to controller chart

* fix: correct controller chart example path to include charts/ segment

The bootstrap sitespec examples resolved to nvcr.io/org/controller/controller
by combining bootstrapRepo and bootstrapChart, which doesn't exist. The real
publish workflows put the chart under a charts/ segment (distinct from the
controller image path), so bootstrapRepo now reads nvcr.io/org/charts. Also
fixes RELEASE.md, which still described the NVCR chart target as the stale
cloud-workflow-engine path instead of charts/controller.

* docs: describe bootstrapRepo as the chart repo, not image and chart

The charts/ path segment deliberately splits the chart from the image it
deploys, so no single OCI repository holds both: the chart publishes to
<registry>/<org>/charts/controller and the image to <registry>/<org>/controller.
Six sites still described bootstrapRepo as holding "the bootstrap engine image
and chart", which contradicted the corrected example value pointing at a
charts-only repository.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: repoint bootstrap sitespec examples at controller-chart

#503 fixed the NVCR chart-publish outage: NGC rejects a nested
"charts/" path segment at token exchange, so the chart now publishes
as nvcr.io/<org>/controller-chart instead of nvcr.io/<org>/charts/controller.
These sitespec examples still named the retired charts/controller path,
which was never actually publishable on NVCR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 16:20:54 -04:00
Miancheng Lin b6a25000fa refactor(restapi)!: nest provider fields under nico and infra payload (#246) 2026-09-04 12:28:43 -06:00
Lia d4da32a6b5 refactor(nkectl)!: rename the inventory file to the site spec (#468)
The file nkectl reads is not an inventory. Alongside the node list it
carries k8sVersion, cniName, the pod and service CIDRs, kubelet
reservations, the registry block and the SPIRE CA. Only cluster.nodes is an
inventory in the sense the rest of this repository uses the word — CWE's
internal/rollout loads "a cluster and its node inventory from postgres", and
the provider's validateInventory operates on a bare spec.hosts list.

The name predates the design it would have to be justified by. It landed
with the first bootstrap site command, before the decision that bootstrap
would be orchestrated through CWE's POST /clusters API, so it was never
chosen to line up with CWE's node inventory.

"Spec" rather than "config" because config is already taken, twice. nkectl
config manages the CLI's own settings — set-site, use-site, view — and
internal/config already declares a SiteConfig type for a site controller's
connection details. Naming this file a site config would put one name on two
unrelated things, which is worse than the two names on one thing this change
removes.

The repository had already chosen the word: nkectl config validate is
stubbed as "Validate a bootstrap spec file", waiting on the config package
in C2. This makes generate and validate agree instead of contradict.

The flag changes outright rather than gaining an alias. nkectl is not
functional yet, so there is no deployment to keep working.

BREAKING CHANGE: nkectl bootstrap site now takes -f/--sitespec instead of
-i/--inventory. cli/examples/inventory.yaml is cli/examples/sitespec.yaml
and cli/docs/inventory-spec.md is cli/docs/sitespec.md.

The word inventory is kept where it is still accurate: CWE's node inventory
in controller/, the provider's validateInventory over spec.hosts, and the
two comments in this package that describe cluster.nodes itself.

Co-developed-by: Claude <noreply@anthropic.com>

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-09-03 13:20:31 -07:00
Jonathan MeierandCodex 330b2a164a feat(nkectl)!: flatten site inventory nodes (#463)
* feat(nkectl)!: flatten site inventory nodes

Replace the distinct init and join node fields with one control-plane node list. Add NKECTL_CLUSTER_NODES as the bulk environment input.

BREAKING CHANGE: cluster.initNode, cluster.joinNodes, INIT_NODE_IP, INIT_NODE_NAME, and JOIN_NODES are no longer supported. Use cluster.nodes or NKECTL_CLUSTER_NODES.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: Codex <codex@openai.com>

* fix(nkectl): require an odd site node count

Reject empty and even-sized flat node lists during inventory validation.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>

Co-Authored-By: Codex <codex@openai.com>

---------

Co-authored-by: Codex <codex@openai.com>
2026-09-02 14:44:07 -07:00
Davanum Srinivas 2b5b33f91d fix(cli): default nodeAgentPort to the port nke-agent listens on (#450)
nkectl defaulted cluster.nodeAgentPort to 50051. The agent listens on
15005 unless given --secure-server-port, the controller's NODE_AGENT_PORT
defaults to 15005, and the .deb postinst writes an empty AGENT_ARGS so a
packaged node uses the binary default. nkectl was the only outlier.

docs/site-bootstrap/pre-provisioned-nodes.md installs the agent with no
port and then tells the operator the default is 50051, so the documented
install could not reach its join nodes. Its own troubleshooting section
already said 15005.

Nothing reads the value yet, so this is a constant change today and a
behaviour change once dispatch dials nodes. Three places worked around
it instead: the CI fixture, configuration.md, and custom-base-os.md.

The new test spells the port out. Every existing assertion compares
DefaultNodeAgentPort with itself, which cannot catch a wrong value.

Fixes #329

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
2026-09-02 07:36:31 -04:00
Lia 56cb879d07 chore(inventory): align example defaults with tier0-bootstrap (#443)
The nkectl example inventory and the tier0-bootstrap template disagreed on
every value an operator does not have to supply per site:

  field          nkectl           tier0-bootstrap
  k8sVersion     1.32.0           1.34.2
  cniName        calico           ovn-kubernetes
  podCidr        10.100.0.0/16    192.168.0.0/16
  serviceCidr    10.200.0.0/16    10.96.0.0/12

Both produce a working cluster in isolation, so the divergence is invisible
until an operator moves between the two tools and gets a silently different
cluster — or until the ranges they picked from one collide with a site
network that was sized against the other. tier0-bootstrap is what sites run
today, and its pod and service ranges are the conventional kubeadm values,
so it is the side worth converging on.

cniVersion is commented out rather than translated. It held "3.31.4", a
Calico release; there is no ovn-kubernetes equivalent to substitute, and the
field is optional — an empty value lets the node-agent use its built-in
default.

The e2e fixture (cli/e2e/bootstrap/inventory.ci.yaml) is deliberately left
alone. It pins calico and overrides nodeAgentPort and systemReservedMemory
for the fake-node substrate, so it is not an operator-facing default.

Co-developed-by: Claude <noreply@anthropic.com>
2026-09-01 22:21:01 +00:00
Anisha Gupta USandClaude Sonnet 4.6 d992af97cf feat(cli): NKX-15308/NKX-15057: cluster UX improvements and unit tests (#381)
* NKX-15308/NKX-15057: cluster UX improvements and unit tests

NKX-15308 — three UX improvements to cluster commands:
- create cluster: replace positional spec-file arg with required -f/--filename
  flag; remove --name/--orgID/--controlPlaneKubernetesVersion override flags
- delete cluster: remove interactive confirmation prompt and --yes flag
- get clusters: add optional --cluster/-c flag to filter by name

NKX-15057 — unit tests for three packages:
- internal/util: ParseFormat, Print (JSON/YAML/table-error), PrintFields
  (flat, nested, nil, array), FormatAge (all buckets + future), YAMLToRequest
  (valid round-trip, invalid YAML, unknown field, empty document)
- internal/cwe/clusters: --cluster flag present, -f required, -f/-filename
  both accepted, stdin read, invalid/unknown-field spec rejected before API
  call, delete requires name arg, delete reaches client

Also: fix capd-cluster.yaml example Usage comment to use -f flag; update
FIXME in cwe-client.go to reference NKX-15055 with correct auth description.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: fix FIXME comment for auth — NKX-15055 is --kubeconfig in set-site

NKX-15055 adds kubeconfig storage to SiteConfig; a separate epic will
use it for JWT bearer token auth. Correct the comment accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: improve unit tests — internal packages, clusterStatus coverage, empty spec validation

- Switch all test files to internal package declarations (package clusters,
  package util) to match repo convention and allow testing unexported functions
- Add TestClusterStatus: 11 table-driven cases covering each condition and
  priority ordering (Deleting > UpdateFailed > Updating > Upgrading >
  Recycling > Provisioning > Provisioned > Unknown)
- Add TestCreateCmdEmptySpecRejected: verifies empty spec fails before the API
- Add empty-spec validation to YAMLToRequest: return "spec file is empty"
  instead of passing a zero-value request to the API
- Update TestYAMLToRequest_EmptyDocument to expect an error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: add cluster/clusters aliases, alias tests, and clean up FIXME comment

Add Aliases so cluster and clusters are interchangeable on all four
subcommands (get, describe, create, delete).

Add TestCmdAliases: 6 subtests that dispatch through a parent command
to confirm cobra resolves both names correctly for get, create, and delete.

Remove Jira ticket reference from FIXME comment in cwe-client per
updated convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: fix gci import ordering in clusters_test.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-31 17:47:24 -04:00
Jonathan MeierandClaude Opus 5 04d317acb9 feat(nkectl): deploy SPIRE onto the bootstrap cluster (#351)
A bare-metal node with a hardware identity has nothing to attest to during a
bootstrap, and CWE runs without a workload identity of its own. Install a
SPIRE server on the ephemeral cluster, between Temporal and CWE, and turn
CWE's SPIFFE integration back on.

The CWE chart cannot do this itself: spiffe.enabled makes CWE a SPIRE client,
mounting the workload API through the csi.spiffe.io driver and taking RBAC
over clusterstaticentries. Both need a server, a CSI driver and the CRDs to
already exist, so with nothing installed the pod never leaves
ContainerCreating. That is why cwe-values.yaml pinned it to false.

The charts are the SPIFFE project's hardened ones, pinned as constants beside
the existing Postgres and Temporal pins and installed with `helm --repo` for
the same reason Temporal is: this package does not mutate the caller's global
Helm repository list. Everything they name is public, so a bootstrap and CI
need no registry credential. The CRDs are their own release because a chart
cannot depend on its own CRDs being applied first.

Two inputs come from the inventory rather than the environment, because they
describe the site: the TPM EK thumbprints of the hosts allowed to attest, and
a CA for SPIRE to chain its own to. No thumbprints means no TPM attestor —
a bootstrap that was not told which hardware it may admit must admit none.

When the inventory does name hosts that attest, spire-server-nodeport.yaml is
applied beside the chart's own Service. The nodes were configured with an
address and a port when they were provisioned, long before this cluster
existed, so the port has to be decided in advance and the chart's Service
template has no nodePort field. A second Service selecting the same pods
keeps that a declaration rather than surgery on someone else's release. We
will ask the SPIRE chart's owners for a configurable NodePort.

deployAndWaitForCWE now takes a cwedeploy.Config instead of assembling one
itself. What the operator asked for is settled by cweDeployConfig before the
cluster is built, so an image that was never named costs a message rather
than a Kind cluster stood up only to be torn down.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 15:12:03 -07:00
Jonathan Meier 93c31fffee feat(nkectl): add SPIRE trust inputs to the bootstrap inventory (#334)
https://jirasw.nvidia.com/browse/NKX-14771
2026-08-26 15:33:58 -07:00
Anisha Gupta USandClaude Sonnet 4.6 b2ff99b27e chore: NKX-14307: Improve nkectl cluster commands (#218)
* feat(cli): improve nkectl cluster commands

- Add cliutil package (output.go, convert.go) replacing ad-hoc helpers
- Add AGE column and priority-ordered status to get clusters table
- Support stdin ('-') for create cluster spec input
- Add --name, --controlPlaneKubernetesVersion, --orgID flag overrides for create cluster
- Add -o json/yaml output flag to get clusters and describe cluster
- Surface CWE API error messages (GenericError.Message) instead of raw JSON bytes
- Clarify FindClusterByName comment: DB enforces global unique cluster name index

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(cli): fix gci/gofumpt formatting and license header in cliutil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(cli): use GET /clusters?name= filter in FindClusterByName

Avoids fetching all clusters just to find one by name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(cli): use slices.Sort and fix ambiguous cluster error message

- Replace manual insertion sort in printMap with slices.Sort
- Drop misleading 'use the cluster ID instead' hint from FindClusterByName
  (cluster ID is not yet a supported argument to describe/delete)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: add confirmation prompt to delete cluster

Adds a [y/N] confirmation prompt before calling the CWE delete API so
operators cannot accidentally drop a cluster. The --yes / -y flag skips
the prompt for scripted use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cli: update FIXME reference from NKX-14307 to NKX-15055

NKX-15055 is the dedicated task for adding mTLS auth to nkectl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* address PR review feedback: rename packages, fix stdin and FormatAge

- rename cli/internal/cliutil → cli/internal/util, output.go → printer.go
- rename cli/internal/client → cli/internal/clients, client.go → cwe-client.go
- delete cluster: use cmd.InOrStdin()/cmd.OutOrStdout() instead of os.Stdin/os.Stdout; check scanner.Scan() return value
- FormatAge: clamp negative durations to 0 using max(..., 0)
- create cluster Use string: remove duplicate |-> typo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-24 21:05:08 -07:00
Davanum Srinivas a3c868615c fix(license): normalise SPDX headers to Apache-2.0, and assert it (#197)
* chore(license): normalise SPDX headers to Apache-2.0 [machine generated]

MACHINE GENERATED. Every added line in this commit is
`SPDX-License-Identifier: Apache-2.0` and nothing else; every removed line is
the identifier it replaces, or the notice paragraph that followed it. Verified:
0 added lines are anything other than that SPDX line.

829 files. The repository ships Apache-2.0 -- LICENSE says so and GitHub
reports it -- while 676 Go files and 153 others declared a different
identifier, followed by a notice that contradicted it.

The copyright line, the comment style and the indentation are left alone. Files
carrying the short form, two SPDX lines with no notice paragraph, have the
identifier swapped and nothing else.

Markdown is excluded: there the identifier appears in prose describing the
mismatch rather than in a header, so rewriting it would turn the sentence into
a tautology. That file is handled in the next commit.

Three shapes needed care, and each is worth knowing about if this is ever
repeated. controller/api/prepend-license.go carries the block inside a Go raw
string, so the paragraph's last line ends with a backtick; the closing
delimiter is carried back onto the SPDX line rather than dropped, or the string
would be left unterminated. Two shell scripts under controller/hack/ word the
final sentence differently, so matching on the common ending alone misses them.
And controller/.golangci.yml prefixes each line with "# //", which has to be
stripped before the paragraph text can be recognised.

The templates that produce these headers are rewritten here too, so this commit
is self-consistent: the five addlicense boilerplates, the five goheader
templates in .golangci.yml, and the block in prepend-license.go. Every header
in the tree now names the same identifier.

Review the next commit. This one is a substitution.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* fix(license): one header template, and a check that reads it

The previous commit fixed the headers. This one stops them drifting again, and
is the part worth reviewing.

Nothing here could catch a header that named the wrong licence. addlicense only
ADDS a header to a file that has none; it never rewrites one already present.
So `make file-license-check` runs addlicense, finds every file already stamped,
produces no diff, and passes -- whatever the header says. agent/ is the proof:
its template and its check have both been correct all along, and six of its
files disagreed with them.

Three mechanisms defined the header and could disagree with each other: an
addlicense boilerplate per module, a goheader template in five .golangci.yml
files, and a hardcoded block in controller/api/prepend-license.go that stamps
generated API code. They are now one file, hack/license-header.tmpl, and every
module reads it.

make license-header-check replaces the per-module matrix and asserts two things
rather than one: that a header exists, and that it names Apache-2.0. The second
assertion is what this repository never had. Verified by planting a different
identifier in a file and confirming the check fails and names it.

Modules resolve the template through `git rev-parse --show-toplevel`, not a
relative path. A relative ../hack path silently changes meaning when a module
moves, which is how cli/ broke when it moved out of controller/.

The file set is the union of what the per-module targets already ignored, so
this covers exactly the files stamped today. 120 files carry no header at all
-- generated output, testdata, fixtures, build tooling, three .github files --
and widening the set to reach them is a separate change. Mixing headers that
are WRONG with headers that are MISSING would hide both.

Dockerfiles stay out: addlicense keys off the file extension and gives
Dockerfile.proto C-style // comments, which Docker cannot parse.

AGENTS.md's licence-header rule now describes the current state: one identifier,
added by `make license` rather than copied from a neighbouring file. The ban on
relicensing as a side effect of unrelated work stays.

The header-check job is renamed from "License headers (<module>)" to "License
headers". The merge gate calls this workflow whole rather than naming its jobs,
and the branch ruleset requires only `gate` and `DCO`, so no required check
changes name.

Verified: GOPROXY=off make build links all five binaries with no credentials;
golangci-lint goheader reports 0 issues on cli and controller; `make license`
is a no-op in all five modules; make license-header-check passes over 828 files
and fails on a planted mismatched header.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

stderr is not captured when reading addlicense's output. addlicense prints the
offending paths to stdout, while `go run` writes "go: downloading ..." on a
cold module cache and "exit status 1" on failure -- both to stderr. Folding the
two together reports a module download as a file with no header, which is how
the first CI run of this check failed while passing on a machine whose cache
was already warm. Reproduced locally against an empty GOMODCACHE.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
2026-08-18 20:42:45 -04:00
Davanum SrinivasandTerry Howe 144cc6c612 refactor: move nkectl to cli/, and ship it from per-component tags (#168)
* refactor: move nkectl from controller/nkectl to cli

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* build: release per-component tags, and ship nkectl binaries

Both existing tags, agent/v0.2.0 and controller/v0.1.0, ran this workflow green
on 2026-08-14 and produced nothing: the release job skipped itself on
`!contains(ref_name, '/')` and the publish job is an echo. So the repository has
two tags and no releases, and nkectl -- a cobra CLI whose own Makefile calls it
"a redistributed binary" -- reaches nobody.

A tag here is <module-directory>/vX.Y.Z because Go requires it: the module
github.com/NVIDIA/nke/controller/nkectl can only be resolved by a tag named
controller/nkectl/vX.Y.Z. That makes the tag self-describing, so the component
is read back off it and no step names nkectl. Move the module and its tag prefix
moves with it, since Go keeps them the same string; go.work is then the check
that the directory exists, and an unknown one fails loudly rather than releasing
an empty tag.

Splitting on the last "/v" handles the two-level prefix, which a single-slash
assumption would have broken on the first controller/nkectl tag.

nkectl ships as four static binaries -- darwin and linux, amd64 and arm64 --
with checksums.txt and its own THIRD_PARTY_NOTICES.md, which exists precisely
because the binary is redistributed. Roughly 8 MB each. Other components release
notes only until they declare artifacts; the case statement is explicit because
components genuinely differ and guessing would be worse.

Two bugs found while doing it. The version match in controller/nkectl/Makefile
was 'nkectl/v[0-9]*', a prefix no correctly-formed tag can carry, so it could
never fire and every build fell through to the commit SHA. The changelog step
stripped only a leading "v", so a prefixed tag looked for a heading that cannot
exist and silently shipped a one-line body.

Cross-built binaries cannot be executed to prove their -X symbols, so the
host-matching output is run instead: all platforms share one ldflags string, so
one stamped binary proves the rest.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* build: point the release tooling at cli/ after the move

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* docs: reorder the module table for cli/

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* ci: rename the nkectl lint job for cli/

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* fix(cli): repoint the notices paths at controller/ after the move

The module was a child of controller/, so '..' reached the controller
Makefile and hack/ directory. From cli/ it reaches the repository root,
which has neither. Same class of break as the relative replace in go.mod.

Also reorder two import blocks: cli/ sorts before controller/, so gci
wants the local import first.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* fix(notices): ignore controller/api, a first-party module with no LICENSE

nkectl began importing it in the CWE sync, so go-licenses classified it
as unknown and the check failed. It is our own code, which is what the
ignore list is for.

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>

* Update .github/workflows/release.yml

Co-authored-by: Terry Howe <terrylhowe@gmail.com>

---------

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Terry Howe <terrylhowe@gmail.com>
2026-08-17 17:46:38 -04:00