mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2595
22
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3ed03c7530 |
docs: document controller API authorization (#2174)
* docs: document controller API authorization Add an operator guide for API authorization: the admin and viewer roles, granting them by claim and by service account, turning authorization on in permissive mode, finding the callers enforcing mode would refuse, switching to enforcing, and the metrics to watch. Link it from the docs index, the controller README and docs, and the observability page. Pages that said NVKE does no authorization now say every admitted caller can call every endpoint until authorization is on. Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): name the Teleport app settings the roles claim needs The token carries roles only when rewrite.jwt_claims includes them, and the header rewrite is written differently in teleport.yaml and in a dynamic app resource. Signed-off-by: dbudris <dbudris@nvidia.com> * docs: use the apiAuthz.authorizer.localBundle values paths The chart now holds the authorization bundle under apiAuthz.authorizer.localBundle, beside apiAuthz.authorizer.backend. Update the operator guide, the controller README and the troubleshooting table to match. Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): say the chart refuses permissive authorization while it is off Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): restructure the API authorization page after review Explain grants and the shipped roles up front, and show the apiAuth admit change a viewer grant needs. Restart NVKE when switching to enforcing mode, since only nvke-controller-config changes, and add a rollback. Name the failed-to-authorize log line, act on each outcome, and give success signals for grant changes. Split steps to one command each, move Teleport and role customization to the end, drop the metrics table that observe.md already covers, and add next steps. Signed-off-by: dbudris <dbudris@nvidia.com> --------- Signed-off-by: dbudris <dbudris@nvidia.com> |
||
|
|
51dc0c4dae |
feat!: make apiAuth the only API authentication source (#1938)
apiAuth in nvke-controller-config becomes the only place the controller reads its API authentication configuration from. This is the breaking second step of phase 2. - The controller refuses to start when AUTH_CONFIG_PATH is set, naming apiAuth as the replacement, and passes authn.Setup only the apiAuth section. authn.Load and Options.ConfigPath stay for management-engine's --auth-config. - The chart no longer renders or mounts nvke-auth-config. It refuses apiAuth.configMap and an AUTH_CONFIG_PATH env entry by name, and a caBundlePath into the old mount, pointing at jwks.caBundle. - apiAuth.permissive requires apiAuth.enabled, in the chart and at startup. Tilt passes it only with authentication on. - controllerconfig, which decodes the apiAuth section, gets the decoder-strictness tests. - nvkectl and the token scripts keep their fallback to the authentication ConfigMap for controllers from before this change. - The e2e suite reads the enforcement mode from apiAuth alone. - The pod template carries a checksum of nvke-controller-config, so an upgrade that changes apiAuth rolls the controller without Reloader, which the NVKE stack does not install. - API authorization (#2125) counts authentication as on exactly when apiAuth.enabled is. BREAKING CHANGE: AUTH_CONFIG_PATH and apiAuth.configMap are removed. A site that managed its own authentication ConfigMap moves audiences and issuers into apiAuth.config, CA bundles into jwks.caBundle, and sets apiAuth.enabled. apiAuth.permissive without apiAuth.enabled is refused. nvkectl older than the previous step gets 401. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
6451d897f4 |
feat(auth): admit API callers by a claim value (#2141)
* feat(auth): admit API callers by a claim value
An issuer's admit rules gain claims: a list of {name, value}. A token
is admitted when one rule's top-level claim is the value, or a string
array holding it. This admits tokens with no groups claim, such as
Teleport application-access JWTs (roles), Entra app-only tokens (roles)
and CI OIDC tokens.
Claims that describe the token rather than the caller (iss, aud, nonce,
jti, exp, nbf, iat, typ) are refused. LocalBundle role mappings use the
same rule, matcher and validation.
Signed-off-by: dbudris <dbudris@nvidia.com>
* docs(auth): Teleport needs an Authorization rewrite and either algorithm
Teleport sends its app JWT in Teleport-Jwt-Assertion, and NVKE reads only
Authorization, so the Teleport app needs a header rewrite. Teleport signs
with RS256 under the legacy signature_algorithm_suite and ES256 under the
others, so the example accepts both.
Signed-off-by: dbudris <dbudris@nvidia.com>
* docs(auth): spell out the Teleport app settings NVKE needs
The roles claim needs rewrite.jwt_claims to include roles. The header
rewrite has a different form in teleport.yaml and in a dynamic app
resource, so show both. Name the application access JWKS path, which is
not Teleport's OIDC discovery key set.
Signed-off-by: dbudris <dbudris@nvidia.com>
---------
Signed-off-by: dbudris <dbudris@nvidia.com>
|
||
|
|
cc474ce481 |
fix(auth): refuse a null service account name in authN admission (#2036)
In YAML, name: with no value, name: ~ and name: null decoded the same as leaving name out, which matches every service account in the namespace. An operator who meant to narrow a rule could admit the whole namespace without an error. The chart passes such a value through as name: null. ServiceAccountRule.Name is now a ServiceAccountName that records an explicit null, and Validate refuses it: issuers[0] (k8s): admit: serviceAccounts[1]: name is null; remove the key to match any service account in namespace "nke-clients", or set a name Both loaders call Validate, so the authentication config file and the apiAuth section of the controller config refuse it. An absent name keeps matching every service account. A null rule that skipped Validate matches nobody. Strict decoding keeps reporting unknown and case-mismatched keys with their full path. LocalBundle uses the same type and reports the same message. Signed-off-by: dbudris <dbudris@nvidia.com> |
||
|
|
8eed5173c8 |
feat(deploy)!: move the greenfield overlays and the release namespace to nvke-controller (#1889)
* feat(deploy)!: move the greenfield overlays and the release namespace to nvke-controller This moves them, and with them the persisted identifiers a site carries: the Helm release and its namespace, the database, and the Temporal namespace and task queue. In the three greenfield stacks: nameOverride, fullnameOverride, namespaceOverride, serviceAccount.name, serviceMonitor.name, appDb.dbName, the Temporal namespace and queue, the field managers and the managed-by values, tracing.serviceName, and the objects the stacks render around them -- the Namespace manifest, the Postgres CREATE DATABASE, the SPIRE admin ID and ClusterSPIFFEID namespace selectors, the auth-dev ConfigMap's namespace, the CAPD RBAC ClusterRole and its subject, and the spire-client probe URL. Consumers that move with it: controller/Tiltfile (release name, namespace, SPIRE admin path and the string-matched resource names), deploy/check-site.sh, the e2e site helpers and their collect script, cli/internal/bootstrap/controllerdeploy (including the NodePort Service nvke-controller-external), cli/internal/deploypath's admin path, management-engine/hack/nvke-controller.sh, and the CI lane scripts. The discovery paths search the new name first and keep the old one: nvkectl's authConfigNamespaces, nvke-token.sh, nvke-auth-demo.sh and dev-env-spire.sh now try nvke-controller, then nke-controller, then cloud-workflow-engine. The reference health dashboard matches all three workload names, and Tilt's preflight refuses to take over a cluster that still runs the nke-controller release rather than failing later. The published image keeps its name per #1554 decision 2, as do the nke-controller-config ConfigMap and the nke-controller-chart release artifact; hack/name-check-allowlist.txt now carries one entry per reason rather than one blanket token. Refs #1861, #1554, #1496, #1818 Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Name nke-controller as the intermediate namespace in the authentication docs, matching authConfigNamespaces, and restore the legacy node-agent audience in the exchange mock's test. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(e2e): point the nico bootstrap lane at the nvke-controller namespace The nico lane still asserted the tenant credentials Secret landed in nke-controller, so both e2e (nico) jobs failed after the rename. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(deploy): carry the nvke-controller rename into the rebased files The rebase onto main replayed the rename over two files that gained nke-controller references after the branch was cut: the management-engine dev overlay, which succeeds the hack script this branch had edited and was removed in #1918, and an API-authentication example added in #1935. Refs #1861 Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Continue namespace discovery past a Forbidden lookup in nvke-token.sh and nvke-auth-demo.sh. --ignore-not-found suppresses absence, not denial, so a kubeconfig scoped to nke-controller alone died on the nvke-controller probe before reaching the namespace it can read -- the migration case this branch adds. Keep the first denial, try the remaining candidates, and fail with it only when none was readable, since falling back to cloud-workflow-engine needs a confirmed absence. Refs #1861 Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
ddab4187b5 |
feat: read API authentication from apiAuth first (#1935)
Prepare for apiAuth in nvke-controller-config to be the only source of the NVKE API authentication configuration. Nothing here is breaking; retiring AUTH_CONFIG_PATH and the external-ConfigMap mode follows once an nvkectl with this change is released. - nvkectl, the e2e token helper and hack/nvke-token.sh read apiAuth from nvke-controller-config first and fall back to the authentication ConfigMap when the section is off or absent. - permissiveMode moves to apiAuth.permissive, beside the rest of the section and matching the Helm value. A config.yaml that still sets the top-level key is refused with an error naming the new one. - Issuers take an inline jwks.caBundle as an alternative to caBundlePath, so a private CA no longer needs a file mounted from nvke-auth-config. - Tilt and the CAPNICo e2e path render the configuration from chart values, as CAPD already does, and their nvke-auth-dev manifests drop the ConfigMap. Nothing in the repository uses apiAuth.configMap.create=false any more. - The design document replaces its phase 2 outline with the design. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
e7ebbc4b1b |
feat(controller): read chart-rendered API authentication from nvke-controller-config (#1812)
When the chart renders the API authentication configuration (apiAuth.configMap.create), the controller now reads it from an apiAuth section of nvke-controller-config instead of the file at AUTH_CONFIG_PATH. auth/authn stays the only owner of the schema: the section reuses authn.Issuer and is validated with the new Config.ValidateStartup, which authn.Load also uses. The section is required and carries an explicit enabled switch, so a missing section is a startup failure rather than "off". A section filled in but switched off is refused, and enabling it while AUTH_CONFIG_PATH is set is a startup failure. A ConfigMap managed elsewhere keeps the AUTH_CONFIG_PATH path, and the chart still renders the authentication ConfigMap for nvkectl and extraFiles. The CAPD e2e lane moves to the chart-rendered configuration; Tilt and capnico-e2e keep the external ConfigMap, so CI covers both. The e2e suite and the token and demo scripts treat either source as authentication being on, whichever name the settings ConfigMap has. The auth-mode gauge now follows whether authn.Setup built an authenticator. Also renames the remaining references to the settings ConfigMap, nke-controller-config, to nvke-controller-config, the chart's default since #1769, in docs, comments, test messages and help text. Kept: the legacy pins and fallbacks for installs that predate the rename, and the "Loaded nke-controller-config" startup log line, which the e2e OIDC site helper matches and released images still print. Includes the design doc, controller/docs/api-auth-in-controller-config-design.md. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
0e41205a98 |
feat(controller): build the image on distroless static (#1883)
The runtime stage was Alpine plus bash, curl, util-linux and nine more packages kept for in-container debugging. Build it on gcr.io/distroless/static-debian12:debug-nonroot instead: the controller and the SPIFFE exec-auth plugin are static binaries, and the debug variant still gives `kubectl exec` a busybox shell with wget, grep, sed and find. It has no bash, no curl and no package database. The image drops about 39 MB uncompressed on arm64, the OS packages go from 77 to none, and the curl High finding goes with them. The base's entrypoint is /busybox/sh, so the image clears it and keeps CMD ["controller"], which starts exactly as before. The empty /profiles mount point is made in the builder, since the runtime stage has no shell to run mkdir. The metrics examples in the API authentication docs use wget instead of curl. The troubleshooting page gains a section on what an exec session in the pod has, and on attaching a debug container with kubectl debug --profile=restricted for the tools it does not. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
6f84d0e01b |
feat(chart)!: move the remaining chart names, mount paths and filenames to nvke (#1818)
* refactor(controller): move the controller pod's mount paths to /etc/nvke The controller pod mounts its authentication ConfigMap, its controller-config ConfigMap and its node-agent client identity under /etc/nke. Nothing outside the pod observes any of them: the chart owns both the mount and the path it joins into AUTH_CONFIG_PATH and CONTROLLER_CONFIG_PATH, and the client identity paths are compiled constants the chart's volumeMounts match. So the three move together with no values key and nothing for an existing site to pin -- an upgraded pod simply mounts them one directory over. Moved: /etc/nvke/auth, /etc/nvke/controller-config, /etc/nvke/node-agent-client-tls and the e2e mock's /etc/nvke/dsx-identity. Not moved: the node-side paths (/etc/nke/spire.env, /etc/nke/trust-bundle.pem, /etc/nke/controller-ca.crt, /etc/default/nke-agent). Those are the node contract, they are chosen per node from the agent's version, and they belong to #1497. While here, chart-node-agent-auth-assertions.sh asserted the absence of `mountPath: /etc/nke/node-agent-tls`, a path the chart never rendered under either name, so the check could not fail. It now names the real mount. Related: #1554, #1496 Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(chart)!: default the authentication ConfigMap to nvke-auth-config apiAuth.configMap.name was already a value an install can pin, so this moves only the default. A new install mounts nvke-auth-config; an install that predates the rename keeps nke-auth-config by pinning the key, which chart-legacy-pinned-values.yaml now carries and chart-auth-assertions.sh now proves. The consumer moved first. nvkectl discovers the API audience by reading this ConfigMap, and the name was a compiled constant, so flipping the default alone would have left one nvkectl unable to talk to the other kind of site. cli/internal/auth now searches both names in every controller namespace -- greenfield name first, pinned legacy name second -- in the same shape it already searched the two namespaces, because a site that pinned one of the two need not have pinned the other. Also moved with it, all of them internally consistent and none observable outside this repository: the e2e authtoken constant and the nvke-auth-dev scaffolding that creates the ConfigMap the suite reads, the two e2e copies of it, and the pod-internal volume names (nke-auth-config, nke-controller-config) in deployment.yaml. nvke-token.sh and nvke-auth-demo.sh take NKE_AUTH_CONFIGMAP, defaulting to the new name, alongside the NKE_CONTROLLER_CONFIGMAP that #1769 added. The chart's two env-refusal messages named nke-controller-config literally and so went stale whenever the value moved. They now interpolate controller.controllerConfig.name and say whatever the install configured. Related: #1554, #1496 Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(chart)!: name the chart nvke-controller Chart.yaml's name is the last path segment of the OCI repository helm pushes to, so this moves the published GHCR chart from ghcr.io/dsx-ai-factory/nvke/charts/nke-controller to .../charts/nvke-controller and the packaged tarball with it. It is an artifact-location change: what an install renders comes from nameOverride, not from here. chart-publish-nvcr.yml rewrites this line with an anchored sed before pushing, so its anchor moves too -- left behind, the rename would silently not apply and the chart would push to NVCR under whatever name Chart.yaml happened to carry. NVCR already publishes as nvke-controller-chart and is otherwise unaffected. malware-backfill.yml pulls the chart by path to scan published tags, including tags that predate this rename. It already chained fallbacks for the two earlier chart renames; the new name goes at the front of that chain. Not moved, deliberately: - image.repository. #1554 decision 2 settled that the chart moves and the image does not, so ghcr.io/dsx-ai-factory/nvke/nke-controller and the sed in chart-publish.yml that pins it stay as they are. - `component: nke-controller-chart` in the record-digest step. That is a key in the release manifest, read outside this repository, and nothing in #1554 calls for moving it. Related: #1554, #1496 Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(deploy)!: rename the OIDC upstream CA Issuer to nvke-oidc-upstream-ca The cert-manager Issuer that signs the OIDC discovery provider's leaf serving certificate. #1554 lists it as a Secret; it is an Issuer -- the Secret it reads is oidc-provider-upstream-ca and carries no nke. Renaming the Issuer is safe: spec.ca.secretName is unchanged, so the renamed Issuer signs with the same CA key, and nothing a tenant holds is derived from the Issuer's name. All ten references move together (deploy/nico, both e2e stacks, helm-values/spire.yaml, deploy/k8s, the Tiltfile and the identity exchange mock), so the issuerRef never dangles. NOT changed, and it needs a decision before anyone does: the CA subject (commonName "NKE OIDC Upstream CA", OU "NKE") on the Certificate in the same file. #1554 wants it moved "for new sites only", but these items are what `nvkectl ... install` applies, and the file's own comment says any subject change forces a re-issue with a new private key, which invalidates every tenant's embedded trust anchor. Nothing here distinguishes a new site from an existing one re-running install, so moving the subject would re-key the CA under an existing site. That gate has to exist first. Related: #1554, #1496 Signed-off-by: Terry Howe <thowe@nvidia.com> * refactor: rename the nke-prefixed chart templates and deploy manifests Filenames only. Nothing these files render changes: Helm takes no object name from a template's filename, and the two renamed Go files keep package nvkerbac and every identifier in it. templates/nke-rbac.yaml -> templates/nvke-rbac.yaml templates/rbac-nke-system.yaml -> templates/rbac-nvke-system.yaml deploy/k8s/nke-auth-dev.yaml -> deploy/k8s/nvke-auth-dev.yaml deploy/k8s/nke-spire-client.yaml -> deploy/k8s/nvke-spire-client.yaml deploy/k8s/spire-nke-services-spiffe-id.yaml -> spire-nvke-services-spiffe-id.yaml internal/nvkerbac/nkerbac{,_test}.go -> internal/nvkerbac/nvkerbac{,_test}.go and the e2e stacks' copies of the first three, whose directories were already named nvke-*. rbac-nke-system.yaml was named for the management namespace, which moved to nvke-system in #1698, so its filename was already one rename behind. Every reference moves with them, including the two Tilt resource names derived from the filenames (nke-auth-dev and spire-nke-services-spiffe-id), the _controller_resource_deps list that names both, and the resource_deps of two opt-in providers -- the dsx-identity-exchange mock and dsx-imds-attestation -- that wait on nvke-auth-dev. Those two matter more than they look. Tilt matches resource_deps by string and SILENTLY DROPS a name it does not know: with the stale name, the Tiltfile still loads and `tilt alpha tiltfile-result` still reports no error, but dsx-identity-exchange-ca comes out depending on ["oidc-upstream-ca-ready"] alone, having lost its wait on the scaffolding that creates the namespace it writes a ConfigMap into. That is a race, not a failure, and no lane would have caught it -- both providers are off by default. Verified by loading the Tiltfile against a kind cluster with the provider enabled, before and after. The allowlist entry for this group loses its `nkerbac` alternative, which now matches nothing, and its comment says why `nke-rbac` is still there: the ConfigMap's name is a compiled constant in that package, so it needs to become a chart value before the name itself can move. Related: #1554, #1496 Signed-off-by: Terry Howe <thowe@nvidia.com> * docs(chart): document the pins an existing site needs before upgrading Addresses both CodeRabbit findings on #1769, which are the same finding twice: the legacy pins existed in the test fixture and in the pull request body, but not where an operator planning an upgrade would read them. - nameOverride's doc comment was a plain `#` comment, so helm-docs never rendered it and the README's row for the one value that FAILS an upgrade was empty. It is now a `# --` comment and reaches the README. - controllerConfig.name said an install that predates nvke-controller-config pins "nvke-controller-config". It pins "nke-controller-config"; a rename in #1769 caught the legacy value too. This is the key sentence on the key the finding is about, and it was telling operators to pin the new name. - apiAuth.configMap.name, whose default moved earlier in this branch, gains the same note. - A new "Upgrading an existing site: names and identity" section collects every pin in one block, beside the management-namespace section that already existed, and says which failure mode each one has: nameOverride is rejected by the API server, the rest succeed and quietly leave something behind. - The README title was still nke-controller after this branch renamed the chart. The section states what the second finding asks for and what the fixture cannot: chart-identity-assertions.py proves the chart still honours the pins, not that any site supplies them, so the deployed values of all 41 sites have to be checked before a chart carrying these defaults is published. teleport.* is deliberately excluded from the pin block. Those defaults moved to nvke-* in #1563, in a chart every existing site already runs, and no site ever pinned them -- so pinning them now would be a behaviour change rather than a preservation, whatever their own value descriptions say. The section says so. Related: #1554, #1496, #1769, #1563 Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Three findings on the authentication ConfigMap search, all of them consequences of this branch adding a second name to look for. A denied read of the greenfield name no longer ends the search. RBAC scoped to resourceNames denies every name it does not grant, so a site pinned to nke-auth-config can deny nvke-auth-config while permitting the name it actually runs -- and with one name that denial was correctly terminal, while with two it stopped nvkectl before the readable one. Forbidden is now kept and the search continues; it is returned only if nothing turns out to be readable, so a denied read still never degrades into "authentication is off" and a bare request the controller rejects with a confusing 401. Any other error stays terminal. The regression test reproduces the reviewer's case and fails without the fix. A second test covers the other half: when no candidate is readable, the Forbidden is surfaced rather than reported as authentication being off. The e2e helper searched one name too. On a pinned site RawConfig found nothing, which does not fail a run -- it quietly turns the authn specs into assertions about an unauthenticated NVKE and skips the SPIRE one. It now searches both names, and ConfigMapName stays the name the suite's diagnostics quote. cli/README.md and cli/docs/user-flow.md named only nvke-auth-config. Both now name each ConfigMap the CLI looks for and state the narrower condition for sending no token: neither name found in either namespace. Both also say that an unreadable ConfigMap is not that condition. Signed-off-by: Terry Howe <thowe@nvidia.com> * style(cli): gofumpt the forbidden-reactor helper golangci-lint's gofumpt wants the closing paren of a split call on its own line. I checked the new test with gofmt, which accepts it; the gate is golangci-lint fmt (gci + gofumpt), which does not. Kept as its own commit rather than squashed into fd51855ea: the review replies on this pull request cite that SHA, and rewriting it would strand them. Signed-off-by: Terry Howe <thowe@nvidia.com> * docs: name the chart nvke-controller in the publication reference Two rows in artifact-publication.md still said the controller's chart is nke-controller. This branch moved the published chart to charts/nvke-controller while deliberately leaving the image at nke-controller, so a row naming both artifacts with one name is now wrong about the chart. - the NVKE_GITHUB_PUBLISH table listed "`nke-controller` image and chart" - the SBOM section listed the chart among "`nke-controller` and `nktp`" Every other nke-controller in the file is the image and stays. Reported on the chart-publish row; the SBOM row is the same defect one section further down. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(e2e): make the legacy auth ConfigMap name a constant gochecknoglobals is on in controller/test/e2e and rejected the package-level slice the two-name search was reading: internal/authtoken/token.go:41:5: ConfigMapNames is a global variable LegacyConfigMapName joins ConfigMapName as a const and RawConfig ranges over an array literal of the two, so there is no package-level variable. Nothing else referenced the slice. I had run `make lint` for cli and not for controller/test/e2e, which is a separate module with its own lint job. Both now pass, as does controller -- the three modules this branch touches Go files in. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback Keeps the authentication mount at /etc/nke/auth, and fixes the same Forbidden-stops-the-search bug in the e2e helper that was already fixed in the CLI. The mount path move was wrong, and my own commit message argued it was safe on a premise that does not hold. It claimed "nothing outside the pod observes either" path. An operator's auth.yaml does: jwks.caBundlePath is an absolute path into that mount, written by whoever configured the issuer, and it lives in their values or in a ConfigMap they supply. Pinning apiAuth.configMap.name preserves the ConfigMap's name but not where it is mounted. Confirmed by rendering the chart with a pre-rename configuration (caBundlePath: /etc/nke/auth/spire-ca.crt plus the matching extraFiles): the render SUCCEEDS and emits auth.yaml naming /etc/nke/auth/spire-ca.crt while mounting the file at /etc/nvke/auth/spire-ca.crt. The guard does not catch it either -- it only rejects an unlisted file under the current mount, so a legacy path reads as "a CA outside the mount" and is left alone. An enforcing controller then cannot load that issuer's CA, which is an authentication outage on upgrade, arriving silently. So /etc/nke/auth stays. The other three mounts this branch moved are kept at /etc/nvke: controller-config, node-agent-client-tls and the e2e mock's dsx-identity. Those are chart-owned or compiled constants -- checked that nothing outside the chart names them, and that the only values an operator can point into a mount are caBundlePath, which names the auth mount, and profilesDir/runbooksPath, which name a different one this branch never touched. authtoken.RawConfig had the same defect as cli/internal/auth did: it returned on a Forbidden read of the greenfield name and never tried the pinned one. It now keeps the denial, continues, and returns it only when no candidate is readable -- so a denied read is never reported as authentication being absent. Docs, all four of them saying something that is no longer true: - cli/docs/user-flow.md and cli/README.md said the first name that *exists* is used; it is the first *readable* one, and they now say why that differs. - controller/docs/configuring-api-authentication.md said nvke-auth-config is the single name fixed in the CLI, and that any read error stops the command. - controller/test/e2e/README.md said the suite sends no token when nvke-auth-config is missing; it sends none only when neither name exists. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
647fcdf595 |
docs: fix what an end-user walk of the published site found (#1747)
* docs: repair links and anchors that break on the published site Seventeen relative links pointed at repository files outside docs/index.yml, which the site does not serve, and two anchors named a heading that does not exist. Point them at navigation pages or at the files on GitHub. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(install): say when to install without --release The artifacts page says a Release from NVKR's maintained Definition is refused, but the install commands pass --release by default. Name that case where the commands are. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: correct statements that contradict the code The OIDC verify step read a label the controller deletes. Five other pages described the sitespec default, scale-down, config restarts, an error prefix and a reserved prefix differently from the code. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(nktp): fix the verification steps and the host-process guide The management-cluster verification queried the old trace service name and expected ten certificates where the chart default makes 21. The host-process guide named the wrong Collector, one page kept a site-controller phrase, and a design page misspelled pseudocommand. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: use the repository callout syntax and unbreak the sitespec table GitHub alert markers render as literal text on the site, and a paragraph with no blank line before it landed inside the schema table. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(nktp): add the registry login and say where the chart versions are The install command named no version and fails with unauthorized when the registry wants a login. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: drop the unused catalog entry from the API layout Both Catalog operations are x-fern-ignore, so Fern logs the identifier as unknown. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: say in one sentence that a config change needs a restart Wording from the review of #1747: the file is read once at startup, so restart NVKE after you change it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
d48c98372f |
docs: describe multiple API issuers and headless oidc-kubeconfig (#1676)
* docs: describe multiple API issuers and headless oidc-kubeconfig Callers need the groups issuer and a second issuer written down, and a machine with no browser needs --headless on the generated kubeconfig. Signed-off-by: Vignesh Goutham Ganesh <viganesh@nvidia.com> * docs: require audiences on the issuer recipe and drop --headless The issuer example is not a complete configuration, and generate oidc-kubeconfig has no --headless flag. Signed-off-by: Vignesh Goutham Ganesh <viganesh@nvidia.com> --------- Signed-off-by: Vignesh Goutham Ganesh <viganesh@nvidia.com> |
||
|
|
cacd6476f8 |
feat(nkx-17929): hide x-fern-ignore fields in Swagger UI
Swagger UI showed the full API specification, including Teleport and other fields that the public docs leave out. It now shows a filtered copy. The server still validates requests against the full specification. When a field is removed, it is also removed from the required list, so the public schema can still be satisfied. Signed-off-by: Alex Greene <algreene@nvidia.com> |
||
|
|
17a88127b8 |
docs: say NVKE and nvkectl where the documents still said NKE and nkectl (#1462)
The mechanical half of the documentation change. The word NKE becomes NVKE in prose across the Markdown documents, the docs navigation, the Fern header text, NOTICE, the chart description and the OpenAPI description text; nkectl becomes nvkectl wherever a document names the CLI; a lowercase nke that is the product name becomes NVKE, the clone directory in cd lines becomes nvke, and an identifier in a code span, such as the dashboards' tag, becomes nvke. Identifiers stay: NKE_* and NKECluster-style names, every nke-*, nke.*, nke: and /.../nke persisted name, the "NKE Agent Version" output line, the Keycloak realm and tenant names in examples, and the Fern instance URL and /nke paths until the Fern instance is renamed. The embedded OpenAPI spec is regenerated with the pinned toolchain. The placeholder server URL in the spec counts as a removed object for the compatibility gate, so the waiver file records that decision. Not here: the editorial pass (first-use "NVIDIA Kubernetes Engine (NVKE)", the glossary, the release-note paragraph listing the persisted identifiers), which belongs with the new documentation set in #1391; CHANGELOG.md, which is generated; the CLI's own documents, written with intent in #1456; release/README.md and the issue templates, from #1460. Closes #1461 Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
eacf8e6df7 |
feat(controller): rename the metrics, dashboards and telemetry labels that carried the old product name (#1458)
The 35 metric base names, nke_controller_* and nke_auth_*, become
nvke_controller_* and nvke_auth_* in their registrations, tests, e2e
assertions and documents. A controller emits one family; there is no
dual emission.
The three reference dashboards move to nvke-*-reference.json with uid
equal to the file stem, "Reference - NVKE ..." titles and the nvke tag.
The two that read controller metrics query both families for one
release, {__name__=~"nke_x|nvke_x", ...}, so a panel stays continuous
across the controller upgrade, and their Requirements panel says so.
The health dashboard's namespace regex accepts nvke-controller beside
nke-controller, the namespace a new site gets post-launch.
The benchmark dashboards' uids and tags, the chart's project and team
pod labels and the deploy overlay's tracing service.name take the new
name. Nothing in the NKTP chart reads these series.
Closes #1457
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|
|
3e8ca2590f |
refactor: rename the Go identifiers, packages and fixture paths that carried the old product name (#1453)
After the repository rename and the module-path change (#1449) the tree still carried the old name where it is ours alone: Go identifiers, two internal package names, import aliases, fixture and test-data directories, the e2e deploy overlays and a few deploy and hack scripts. None of these is a wire protocol, a persisted name or a user-typed value, so they change now, before the repository goes public, without a migration. Identifiers change as tokens, through a go/scanner pass, and in comments only on word boundaries, so every string value stays: NamespaceNVKESystem is still "nke-system" and the env and json struct tags keep their keys. Generated files are untouched and regenerate identically. The packages controller/internal/nkerbac and controller/test/e2e/internal/nke move with their import paths; the e2e deploy overlays, the nke-deploy.yaml files, deploy/nke-deploy.sh, deploy/lib/nke-deploy-items.py and the two hack scripts move with every reference; the twelve management-engine test-data directories move with the test prefixes that select them. Kept on purpose: the NKECluster types and their schema tests (the CRD kind), the UpdateNKERBAC rpc names and their tests (from the proto), the SubjectNKE release subject, agent/pkg/nkeauth and its record magic, and every nkectl name, which moves with the binary. Closes #1452 Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
84245d2cca |
docs: give operator commands the nke-controller names new sites use (#1385)
The API authentication and infrastructure provider pages now quote the namespace, Deployment and label a new site installs with. The restart command on the infrastructure provider page selected app.kubernetes.io/name=cloud-workflow-engine, which matches nothing on a new site, so it restarted nothing without an error. Each of the three pages, including site telemetry verification, has one note that tells operators on an existing site to use cloud-workflow-engine. The authentication page now says where nkectl looks for the nke-auth-config ConfigMap: nke-controller first, then cloud-workflow-engine. Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
45fc961c56 |
docs(controller): tighten prose style in API auth docs (#1255)
Cut em-dash asides, bold/italics used for emphasis, a self-count, and a wind-up across the API Authentication section of README.md and the two linked how-tos. Restructured the AUTH_CONFIG_PATH ConfigMap paragraph in README.md, which buried its two valid options inside a sentence fragment describing only the invalid combinations. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
eb08697a3c |
feat: admit OIDC groups on the CWE API (#1140)
Allow a third admission rule beside service accounts and SPIFFE, and accept HTTP JWKS so a lab issuer without TLS can be configured. |
||
|
|
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. |
||
|
|
2e9ee38998 |
docs: say how to create the identity callers authenticate as (#355)
* docs: use extraFiles for the SPIRE CA bundle #333 added apiAuth.configMap.extraFiles hours after #328 merged, so the guide still tells a SPIRE adopter that the chart cannot deliver a CA: This means you cannot use configMap.create: true with SPIRE. A ConfigMap the chart builds holds the config file and nothing else, so there is nowhere to put the certificate. That is no longer true, and controller/README.md at the same commit documents extraFiles -- so the two shipped documents disagreed on the one question a SPIRE adopter is asking. The CA section now leads with the values form, which keeps the whole SPIRE setup inside the apiAuth block, and keeps the kubectl form for anyone managing the ConfigMap themselves. The chart-values table gains extraFiles, the caBundlePath row says where the file usually comes from, and the startup-failure entry in troubleshooting names the actual cause: a path under /etc/nke/auth has to be listed in extraFiles. Verified by rendering the guide's own SPIRE example through the chart: both files land in the ConfigMap and caBundlePath resolves to the one that is there. 15 bash blocks and 4 YAML blocks parse; chart auth assertions pass. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs: say how to create the identity callers authenticate as The Kubernetes recipe named nke-clients/nke-client in its admit rule and then told the reader to run kubectl create token nke-client -n nke-clients without ever creating either. Followed literally, the recipe fails on its last command, which is also the first point at which the reader finds out. Adds a step covering the namespace and service account, and the RBAC needed when something other than a cluster administrator mints the token -- a CI job, or an application renewing its own. That Role carries resourceNames so the grant is to the one account rather than to every service account in the namespace. The remaining steps in that recipe shift by one. The SPIRE recipe is untouched: its subjects are SPIFFE IDs and come from SPIRE registration entries. Verified against a live kind cluster rather than written from memory: - The Role's rules are byte-identical to the one in deploy/k8s/nke-auth-dev.yaml, compared by parsing both rather than by eye. - kubectl apply accepts it, and minting for that account returns a JWT whose sub is system:serviceaccount:nke-clients:nke-client and whose aud is the requested audience -- so it satisfies the admit rule the recipe writes two steps earlier. - The cluster's iss is https://kubernetes.default.svc.cluster.local, which is what the recipe's example configures. - That cluster advertises jwks_uri as https://172.18.0.4:6443/openid/v1/jwks, a node IP. The recipe's warning not to copy that value is correct, and now has a case behind it. 16 bash blocks and 5 YAML blocks parse. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dbudris <dbudris@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
604c8abad1 |
docs: use extraFiles for the SPIRE CA bundle (#352)
#333 added apiAuth.configMap.extraFiles hours after #328 merged, so the guide still tells a SPIRE adopter that the chart cannot deliver a CA: This means you cannot use configMap.create: true with SPIRE. A ConfigMap the chart builds holds the config file and nothing else, so there is nowhere to put the certificate. That is no longer true, and controller/README.md at the same commit documents extraFiles -- so the two shipped documents disagreed on the one question a SPIRE adopter is asking. The CA section now leads with the values form, which keeps the whole SPIRE setup inside the apiAuth block, and keeps the kubectl form for anyone managing the ConfigMap themselves. The chart-values table gains extraFiles, the caBundlePath row says where the file usually comes from, and the startup-failure entry in troubleshooting names the actual cause: a path under /etc/nke/auth has to be listed in extraFiles. Verified by rendering the guide's own SPIRE example through the chart: both files land in the ConfigMap and caBundlePath resolves to the one that is there. 15 bash blocks and 4 YAML blocks parse; chart auth assertions pass. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
6d16f63929 |
docs: a configuration guide for API authentication (#328)
* docs: a configuration guide for API authentication The client side was documented and the operator side was not. Someone with their own cluster had no instructions for authoring an auth config: choosing an audience, finding their issuer, delivering a CA, writing admission rules, or moving a running deployment to enforcing without breaking its callers. The only worked example, deploy/k8s/nke-auth-dev.yaml, is development-only and shaped for Tilt. Twelve numbered sections, so it can be referenced by number rather than read front to back. Two recipes: the cluster's own API server, and SPIRE. Several rules are documented here for the first time, all taken from the validation code rather than recalled: - An issuer may set serviceAccounts or spiffe, never both. Either kind admits on a match, so setting both restricts nothing, and the config is rejected. - An audience may not contain a wildcard, may not equal a configured issuer, and may not be a kubernetes.default.svc form. Each would make the audience check a cluster-wide no-op. - pathPrefixes is required, and "/" is rejected, because a trust domain alone admits every workload in it. - No field may carry leading or trailing whitespace; padded values are rejected rather than trimmed. The recurring trap gets said twice, once per recipe: do not copy jwks_uri out of a discovery document. On a kubeadm cluster it is a node IP and on a site controller it is a VIP. Use a stable address, and for SPIRE check it appears in the serving certificate's SANs first. Section 10 covers permissive to enforcing, and says to read nke_auth_requests_total rather than the request log — successful GETs are logged at debug level, so the log undercounts reads. All 12 bash blocks parse under bash -n, all 8 YAML blocks parse, links resolve. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> * docs: reconcile the configuration guide with the shipped chart The guide was written against the chart as it stood before #322, and four of its statements did not match the code even before that. #322 landed twenty-eight minutes after this branch was first pushed and moved the central mechanic. Section 9.1 said "the chart mounts this ConfigMap but does not create it", which controller/README.md now directly contradicts, and 9.2's values block had no `create` or `config` -- so an operator who read the README, set apiAuth.config, then followed 9.2 would hit the hard render failure that #322 added. Both paths are now documented as the alternatives they are, with the GitOps case stated, and 9.4 covers Reloader and the restart that a configuration change needs. The SPIRE recipe and a chart-rendered ConfigMap turn out to be mutually exclusive, which nothing said. configmap-auth.yaml renders exactly one key, auth.yaml, and has no extension point, so the second-key trick in 8.2 works only for a ConfigMap you manage yourself. Documented rather than fixed here: carrying extra keys is a chart change and belongs in its own PR. Four corrections against the code, none of them caused by #322: - clusterIssuerDiscovery defaults to true (values.yaml). The guide framed it as something to switch on if your cluster narrowed the default, which inverts it -- the chart always binds the role unless you turn it off. - METRICS_LISTEN_ADDRESS defaults to 127.0.0.1:9090 in the binary (internal/config/config.go). 0.0.0.0:9090 is the chart's value, not the default, and the table said otherwise for anyone running outside the chart. - The anonymous surface omitted /api/docs without the trailing slash. routes.go gives it its own entry because the mux redirect happens downstream of the check. README.md had the same omission; both fixed, so the two lists agree. - 11.1 now says the chart renders the ConfigMap too, not just the two environment variables. Verified rather than recalled: every example in 9.1, 9.2 and the negative case in 12 was rendered through the real chart with helm template. 9.1 produces a valid document with exactly one apiVersion, 9.2 emits no ConfigMap and still carries the Reloader annotation, and config-without-create fails with the message the troubleshooting section quotes. 13 bash blocks parse under bash -n, 9 YAML blocks parse, both relative links resolve, and hack/chart-auth- assertions.sh passes. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs: rewrite the configuration guide around the task The guide was 591 lines and 30 headings to describe a job that is: write a config, get it into a ConfigMap, set three chart values, watch a counter, flip a boolean. It opened with roughly 200 lines of field-by-field schema before the first working example, so anyone with a cluster read four sections of reference before seeing anything they could copy. Now 382 lines, recipe first. The two recipes -- the cluster's own API server, and SPIRE -- each run end to end, from reading your issuer through to the command a caller runs. Reference moved behind them. Someone who wants the common case can stop after the first recipe. Dropped the 1-12 section numbering. It was justified as making the guide citable by number, which is an author's convenience rather than a reader's: nobody says "see 6.2". It also made a how-to read like a specification and turned every future insertion into a renumbering. Cut, as material that cost a reader more than it gave them: - the mux-redirect explanation for why /api/docs is exempt separately from /api/docs/, and the same distinction in README.md. Both added yesterday. "The Swagger UI" is how a reader thinks about it. - METRICS_LISTEN_ADDRESS having one default in the binary and another in the chart. Also added yesterday. The guide is for people deploying the chart. - a helm-render-failure troubleshooting entry, when the failure already prints the reason. - the three-row table of rejected audience values, and the kubeadm --api-audiences reasoning behind it, for one sentence saying pick something unique to this deployment. - all ten signing algorithms, for the two that cover most issuers. - segment-wise prefix matching with a counter-example, when the example above it already shows the behaviour. - Reloader, its annotation, and the override precedence, for one line saying the chart restarts NKE and here is how to do it yourself. - a warning that Kubernetes has a same-named kind in another API group. Removed the internal vocabulary: hack/ script paths, deploy/k8s/nke-auth-dev.yaml, internal/auth source references, and the note about GitOps having nowhere to put a loose manifest, which was our reason for building the feature rather than anything an operator needs. Namespace is now a variable set once instead of cloud-workflow-engine repeated through fifteen commands -- it is the release namespace, not a fixed name. Two things said plainly that were buried in mechanism. Admission rules exist because anyone who can create a pod can mint a token for their own service account, so a valid signature is not sufficient on its own. And a ConfigMap the chart builds carries the config file and nothing else, so SPIRE -- or any issuer behind a private CA -- cannot use configMap.create and needs the certificate delivered another way. 15 bash blocks parse under bash -n, 3 YAML blocks parse, the one relative link resolves. The chart values table was checked against values.yaml rather than recalled. Fixed a snippet that never parsed: `helm show values <chart>` reads the angle bracket as a redirect. Part of NKX-15206. Signed-off-by: dbudris <dbudris@nvidia.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dbudris <dbudris@nvidia.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |