Commit Graph
8 Commits
Author SHA1 Message Date
Jonathan Meier bc75b98193 docs(cli): generate the nvkectl command reference from the command tree (#1773)
The repository has a hand-maintained quick reference and workflow guides, but
no complete reference. An operator cannot browse the whole public CLI without
a built binary, and nothing ties the prose to the commands, so the two drift
apart silently.

Add cli/docs/reference: an index and one page per public command, generated
from the cobra tree nvkectl itself runs. Each page carries the command's
purpose, invocation and positional arguments, aliases, examples, local and
inherited options with types and defaults, the required and mutually exclusive
option groups, and a deprecation notice when it has one.

cobra's doc package writes the body of each page. It does not emit aliases,
deprecation notices, flag-group constraints or an index, and it never removes
the page of a deleted command, so internal/clidocs adds those around it. All
of it is read from the command, so there is no second catalogue to maintain.

Deterministic, so repeated generation from unchanged source produces identical
files:

  - cobra's generated-on timestamp is switched off on every command.
  - The NVKECTL_ and NKECTL_ variables are cleared before the tree is built.
    Two of `bootstrap site`'s flag defaults -- --diagnostics-dir and --timeout
    -- are read from the environment by the command constructor, through
    internal/envalias, which still honours the old prefix. Without this the
    pages would record whatever the generating shell happened to have set.
  - HOME and the XDG config directory are pinned, and the build metadata is a
    fixed placeholder.

Generation runs no command and contacts nothing: it builds the tree and reads
its metadata, so it needs no credential, kubeconfig, configured site or
cluster. newRootCmd is exported for it, which is what the move to an
importable package was for.

`make -C cli docs` regenerates and `make -C cli docs-check` verifies, failing
on output that is stale, missing, obsolete, or newly generated and never
committed. The check joins the generated-artefact gate, which already covers
the provisioned-provider manifest and the generated API code, and joins
`make gate` and `make preflight` locally.

Two commands lazily added by cobra needed initialising before the traversal,
or the root page would link to pages that were never written: `help` and
`completion`. cobra's doc package also calls InitDefaultHelpCmd on every
command it renders, not just the root, which invented a `help` subcommand
under each group command -- `nvkectl bootstrap help` is not a command -- so
each one is given a hidden help command first to decide what cobra adds.

Hidden commands and help topics are excluded, which is why `render` and
`inspect` do not appear; a deprecated command keeps its page for as long as it
still runs.

Constraints enforced inside RunE are invisible to cobra. Those on `config
set-site` and the two patch commands are now stated in the flag usage strings
and Long text, so --help and the reference agree. No behaviour changes: the
checks still run where they did, with the messages they had.

cobra/doc brings go-md2man and blackfriday into cli/go.mod. Neither is
reachable from ./cmd/nvkectl, so the shipped binary is unaffected and
THIRD_PARTY_NOTICES.md is unchanged.

Signed-off-by: Jonathan Meier <jomeier@nvidia.com>
2026-10-19 14:27:19 -04: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
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
Davanum SrinivasandClaude Fable 5.1 4409efc29b build: move the Go module paths and repository URLs to dsx-ai-factory/nvke (#1449)
The repository was renamed from dsx-ai-factory/nke to dsx-ai-factory/nvke
on 2026-10-10. Its id is unchanged, so guards, rulesets, environments and
the OIDC subject carried over, and GitHub redirects the old URLs. The
tree still named the old repository where the name is a contract rather
than a URL: the module lines of the 12 Go modules and about 1,700 import
lines, the proto go_package (embedded in node_agent.pb.go, regenerated
here), both THIRD_PARTY_NOTICES.md files (regenerated), the lint
local-prefix and depguard entries, ldflags, the go-licenses ignore lists,
the documented repository URLs and gh commands, and the
ghcr.io/dsx-ai-factory/nke image paths in workflows, the chart default
and the e2e defaults.

Only the organisation and repository segments change. Directories,
identifiers, binary, image, chart, package, label, namespace and
environment variable names, the CODEOWNERS team slugs and CHANGELOG.md
stay as they are.

Closes #1448

Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 16:03:26 -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
Aaron Patten 7899f40eb4 refactor(nkectl): name the bootstrap deploy package and API client after the controller (#1327)
Rename cli/internal/bootstrap/cwedeploy to controllerdeploy, cli/internal/cwe
to cli/internal/controller, clients.CWEClient and CWEClientFn to
ControllerClient and ControllerClientFn, and the bundled cwe-values.yaml and
cwe-nodeport.yaml to controller-values.yaml and controller-nodeport.yaml.

Update every path-bound reference: the cli/Makefile ldflag that stamps
capiVersion, the CAPD e2e path filters, the root Makefile's provider manifest
change detection, the regenerated provider manifest header, README links and
path comments. No behaviour change.

Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-08 09:14:02 -06:00