181 Commits
Author SHA1 Message Date
Nathan Hensley 1a46559dd6 docs: say which published NVKE artifacts are private (#2531)
Signed-off-by: Nathan Hensley <nhensley@nvidia.com>
2026-12-01 13:25:20 -08:00
Eric Staples d61d8a3c92 feat(controller): move a pending control-plane node out of a full failure domain (#2280)
* feat(controller): move a pending control-plane node out of a full failure domain

When CAPNICo reports FailureDomainUnavailable for a control-plane node's
requested domain past a grace period, patch the Machine's failure domain to
the least-used eligible domain the node has not tried, cycling once every
domain has been tried. Gated by controlPlaneFailureDomainFallback in
nvke-controller-config, off by default.

Failure-domain discovery and the allocator move to internal/failuredomains so
the provisioning activity can reuse them. nico-sim gains a configurable
failure-domain layout, and a nico-containers e2e spec covers the move.

Signed-off-by: Eric Staples <estaples@nvidia.com>

* feat(controller): keep the failure-domain fallback and stuck-pending re-placement from overlapping

With the fallback enabled, the stuck-pending reconciler leaves domain-pinned
pending control-plane nodes to the provisioning activity, which moves them in
place. Both acted on the same FailureDomainUnavailable signal on different
clocks, so a moved node could be deleted after one CAPNICo retry.

The rotation now stamps the domain it leaves in the cluster's
UnplaceableFailureDomains, so scale-up, remediation, rollout and rebalance
stop choosing the emptied, still-full domain for the next 3 hours. When
picking the next domain it tries marked domains only after every unmarked
one.

The rotation skips rebalance surges. A surge is placed in the domain of the
node it replaces; moving it can leave two members in one domain after the
shed, and rebalance already abandons a surge that cannot get capacity.

The unplaceable-domain helpers move to the failuredomains package so the
reconciler and the activity share them.

Signed-off-by: Eric Staples <estaples@nvidia.com>

* feat(controller): replace stuck-pending delete with the failure-domain move

Moving a pending control-plane node to another failure domain is now the
only way the controller handles a domain CAPNICo reports out of capacity.
The stuck-pending reconciler, which deleted such a node after 15 minutes
and recreated it elsewhere, is removed along with the
controlPlaneFailureDomainFallback.enabled setting that chose between them.

The move now also leaves a node with a delete in flight alone.
controlPlaneFailureDomainFallback.gracePeriod stays; unset, it defaults to
10 minutes, and a non-positive value is refused at startup and by the chart.

FailureDomainUnavailable leaves the MachineMaterialization interface, since
only the stuck-pending path called it.

The e2e spec gains a scale-up case: with every domain but one out of
capacity, scaling the control plane to three moves the stuck Machine in
place and fails if any control-plane Machine is deleted.

Signed-off-by: Eric Staples <estaples@nvidia.com>

* feat(controller): Surge releases the domain of the first rollout target without a delete in flight

Signed-off-by: Eric Staples <estaples@nvidia.com>

* feat(controller): mark the domain unavailable and update the node in the same transaction

Signed-off-by: Eric Staples <estaples@nvidia.com>

* feat(controller): make the failure domain check more readable

Signed-off-by: Eric Staples <estaples@nvidia.com>

* fix(controller): retry a failure-domain move on Machine patch conflict

A conflict on the optimistic-lock Machine patch now waits for the next
poll instead of failing the activity. Cover the surge-domain release by
driving reconcileNodesNeedingRollout, and document the gracePeriod
positivity constraint in the chart README.

Signed-off-by: Eric Staples <estaples@nvidia.com>

* fix(controller): finish an interrupted failure-domain move once the node has an IP

When the Machine patch of a failure-domain move succeeds and the row
update fails, the next poll records the move. That repair ran only from
the rotation path, which waitForCAPIMachineReady reaches only while the
Machine has no IP, so a node that got an address in the new domain kept
the old domain in its row. The repair now runs on every poll, before the
IP check.

A repaired wrap-around move rebuilt the tried list by appending the
departed domain to the old history instead of restarting it. When the
Machine's domain is already in the tried list the move was a restart,
so only the departed domain is kept.

Signed-off-by: Eric Staples <estaples@nvidia.com>

---------

Signed-off-by: Eric Staples <estaples@nvidia.com>
2026-12-01 09:43:04 -05:00
Abhinav Pandey 407218a442 feat(controller): adopt the cluster the NVKE controller runs (#2415)
* feat(controller): adopt the cluster the controller runs on behind a flag

Add POST /clusters/self-adopt, which records the cluster the controller runs
on as a cluster NVKE manages, without running kubeadm init. The endpoint is
served only when clusterSelfAdoptionEnabled is set in nvke-controller-config
(chart value clusterSelfAdoptionEnabled, default false). Otherwise it answers
400.

The controller reads the cluster with its own service account: the
control-plane Nodes, each with an InternalIP, and the Kubernetes version and
pod and service CIDRs from kube-system/kubeadm-config. The request carries
only what NVKE cannot read: name, NICo site and VPC (orgID optional), CNI
plugin and version, and etcdEncrypted. While the flag is on, the chart grants
that service account list on Nodes and get on kube-system/kubeadm-config.
Self-adopt returns 400 for no control-plane node, a node without an
InternalIP, a kubelet that differs from kubeadm-config, a version that is not
X.Y.Z, no or unsupported pod or service CIDRs, a second adoption, or an
existing Cluster API Cluster of the same name.

The adopted control plane stays with its operator, outside NVKE. Adoption
marks the cluster and its control-plane nodes as adopted, records desiredCount
as their number with no control-plane machine settings, and turns off
recycling, automatic scale-down and rebalancing:

- PATCH /clusters/{id} refuses turning those back on, controlPlaneConfig.nico,
  controlPlaneKubernetesVersion, any desiredCount change and any control-plane
  rollout field.
- DELETE /nodes/{id} on an adopted node returns 409, refused in the handler.
- The node-status sync never marks an adopted node for recycling, so
  control-plane remediation never replaces it.

DELETE /clusters/{id} on an adopted cluster removes only NVKE's records and
leaves the cluster running. It returns 409 while the cluster has node pools,
so their workers are drained and released through the node pool delete first.
TeardownCluster then deletes the Cluster API Cluster and NicoCluster and the
adopted node and cluster rows, and never tears down a node.

An adopted cluster gets OIDCAuthEnabled false, since NVKE cannot configure its
API servers. Its provisioning workflow applies only the Cluster API scaffold:
node-local DNS and the Pod Security namespace labels stay with the operator.

Signed-off-by: Abhinav Pandey <abhinavmpandey08@gmail.com>

* fix(controller): keep maintenance off an adopted cluster and serialize self-adopt

Address review on the self-adopt change.

Keep NVKE from changing an adopted control plane in place:
- PATCH /clusters/{id} refuses turning on enableEtcdEncryption or enableOidc
  for an adopted cluster, alongside the existing control-plane refusals.
- Scheduled certificate renewal skips an adopted cluster.
- stableControlPlane refuses an adopted control plane, which keeps on-demand
  certificate renewal and etcd key rotation off it.

Make "adopts at most one cluster" hold across concurrent requests:
SelfAdoptCluster takes a transaction-scoped advisory lock (LockSelfAdoption)
and checks for an adopted cluster again inside the transaction that records
it, so a second adoption gets a 400. Also fix a stale comment that said an
adopted record cannot be deleted.

Signed-off-by: Abhinav Pandey <abhinavmpandey08@gmail.com>

---------

Signed-off-by: Abhinav Pandey <abhinavmpandey08@gmail.com>
2026-11-30 15:32:32 -08:00
Ryan Bever 60d9c235b3 feat(controller): record events for kubelet client CSR approval (#2462)
Emit an event as each client CSR is approved, and emit the Machine condition event from the shared condition update when that condition changes.

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-30 11:46:48 -05:00
Terry Howe 47c3dc894c docs: stop scheduling compat-window removal for v0.25.0 (#2452)
* docs: stop scheduling compat-window removal for v0.25.0

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

* fix: address review feedback

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-11-24 09:30:51 -05:00
dependabot[bot] 55f98ca375 build: bump the docker-images group across 2 directories with 1 update (#2290)
Bumps the docker-images group with 1 update in the /controller/deploy/k8s/capi-spiffe-exec-auth directory: alpine.
Bumps the docker-images group with 1 update in the /deploy/launchlayer/capll directory: alpine.


Updates `alpine` from 3.24.3 to 3.24.4

Updates `alpine` from 3.24.3 to 3.24.4

Updates `alpine` from 3.24.3 to 3.24.4

Updates `alpine` from 3.24.3 to 3.24.4

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: 3.24.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: alpine
  dependency-version: 3.24.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-23 22:58:43 +00:00
nhammernik cbc5b366c8 feat(controller): expose kube-vip ASN configuration (#2328)
* feat(controller): expose kube-vip ASN configuration

Signed-off-by: Nathan Hammernik <nhammernik@nvidia.com>

* fix(controller): handle null kube-vip chart values

Signed-off-by: Nathan Hammernik <nhammernik@nvidia.com>

---------

Signed-off-by: Nathan Hammernik <nhammernik@nvidia.com>
2026-11-19 10:25:54 -07:00
Miancheng Lin a83ace8713 refactor(controller): render the release CRDs from the controller chart (#2350)
* refactor(controller): render the release CRDs from the controller chart

The NVKE controller and management-engine no longer share CRDs, so the
nvke-crds subchart only added a helm dependency build step. Render the
three release CRDs from the controller chart's own files/crds and remove
the subchart, its Chart.lock and the build plumbing around it.

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

* fix(controller): address review of the chart-owned release CRDs

Embed the controller chart file by file, so a stale charts/nvke-crds-*.tgz in
an existing checkout is not embedded and rendered a second time. Point the
generated-CRD check at the generator's fixed output path instead of the
overridable CHART. Keep the .gitignore entries for built chart dependencies and
dist/, which existing checkouts and the CLI build still use.

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

---------

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-11-18 15:13:21 -05:00
Terry Howe 1b3c68adc6 fix(oidc): fail closed when the RBAC manifest is missing and a trust domain is set (#2003)
* fix(oidc): fail closed when the RBAC manifest is missing and a trust domain is set

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

* fix: address review feedback

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

* fix: address review feedback

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-11-18 10:43:01 -07:00
Abhay Krishna 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>
2026-11-17 13:25:25 -08:00
patelpayal a3a48718bb test(controller): refresh the CAPD e2e CAPNICo CRDs for v0.1.0 (#2364)
Signed-off-by: Payal Patel <payapatel@nvidia.com>
2026-11-17 14:13:36 -07:00
Ryan Bever c044392984 feat(controller): approve kubelet client CSRs for bootstrap identities (#2320)
* feat(controller): approve kubelet client CSRs for bootstrap identities

Add a management-cluster controller that approves the initial kubelet client
CSR for a Machine when the CSR matches the Machine's bootstrap identity and
expected node name. The controller reads tenant clusters through ClusterCache,
limited to Clusters NVKE manages, and reports the outcome in the
nvke.nvidia.com/KubeletClientCertificateIssued condition.

The controller runs only when controllers.bootstrap.enabled is set. The chart
grants approve on the kube-apiserver-client-kubelet signer inside that block.

Signed-off-by: Ryan Bever <rbever@nvidia.com>

* fix(controller): approve a kubelet client CSR retry after an earlier certificate is issued

Kubelet abandons a CSR after 15 minutes and creates a new one. Stopping approval once any certificate is issued leaves that retry unapproved until the ignored CSR is garbage collected.

Signed-off-by: Ryan Bever <rbever@nvidia.com>

---------

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-16 17:21:05 -07:00
Dan Budris df72e7d18e feat(chart): turn on API authorization from Helm values (#2173)
* feat(chart): turn on API authorization from Helm values

Expose apiAuthz in the controller chart. With apiAuthz.enabled, the
chart mounts the bundle ConfigMap at /etc/nvke/authz and points
authorizer.localBundle.dir at it. With apiAuthz.configMap.create, the
default, it also renders that ConfigMap from apiAuthz.policies,
apiAuthz.roles and apiAuthz.config.

- The default policies let admin call every API operation and viewer
  every get and list.
- The chart supplies the AuthorizationConfiguration's apiVersion and
  kind.
- Reloader does not watch the bundle: the controller reloads it itself,
  so a bundle change needs no restart.

The render fails on settings the controller would refuse at startup:
authorization without authentication, enforcing authorization behind
permissive authentication, and a config that would not be rendered or
carries apiVersion or kind.

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

* refactor(chart): nest apiAuthz bundle values under authorizer.localBundle

The values now follow the controller config: apiAuthz.authorizer.backend
picks the backend, and apiAuthz.authorizer.localBundle configures
LocalBundle, the only one. configMap, config, policies and roles move
under localBundle. The render fails on any backend but localBundle.

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

---------

Signed-off-by: dbudris <dbudris@nvidia.com>
2026-11-16 09:22:50 -07:00
Miancheng Lin d03bd02584 refactor(controller): own the release CRDs in controller/k8s-apis (#2305)
The NVKE controller and nvkectl no longer import MachineImage, ClusterRelease
and NodePoolRelease from management-engine. They are defined in a new module,
controller/k8s-apis/v1, which generates their CRDs, tests them, and ships them
through the nvke-crds chart, so the controller owns its release APIs end to
end and no longer depends on management-engine's Go types.

The API group is unchanged, so stored objects, RBAC and fixtures keep working.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-11-13 12:19:29 -08:00
Ryan Bever 24f9faf1c5 refactor(controller): read bootstrap RBAC through ClusterCache (#2295)
* refactor(controller): read bootstrap RBAC through ClusterCache

The bootstrap authorization controller now gets its tenant client from
ClusterCache instead of TenantClientProvider. ClusterCache connects to
the same <cluster>-kubeconfig Secret that Cluster API uses, so this
controller no longer depends on the controller's node-agent or
kubeconfig fallback path.

The cache is created only when bootstrap controllers are enabled. Its
ClusterFilter is IsNVKEManagedCluster, which moves from the capi
package's unexported helper to an exported function so both controllers
share it.

The controller watches the cache's cluster source, so it reconciles
when a workload connection opens or closes. The 30-second RequeueAfter
on a missing connection is removed. When the cache is not connected,
the controller still sets WaitingForTenantAccess on the selected
Machines and returns.

The NICo provider ID controller and the Temporal activities still use
TenantClientProvider.

Signed-off-by: Ryan Bever <rbever@nvidia.com>

* work-sync

Signed-off-by: Ryan Bever <rbever@nvidia.com>

---------

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-12 14:19:14 -07:00
Ilya Kislenko c8529fb630 build: upgrade the Go toolchain to 1.27.4 (#2284)
* build: upgrade the Go toolchain to 1.27.4

Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com>

* ci: pin internal-config tools outside Ubuntu mirrors

Ubuntu mirror DNS repeatedly prevented the required scanner from running. Extract checksum-pinned ripgrep and current PCRE2 packages from an immutable Debian snapshot, with the library path scoped to the checker step. Preserve the existing scan and merge-gate policy.

Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com>

* ci: restore the existing Ubuntu package setup

Remove the unnecessary custom ripgrep action and Debian snapshot package pins. Restore the original apt installation and keep this pull request focused on the Go 1.27.4 upgrade.

Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com>

---------

Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com>
2026-11-12 08:42:23 -08:00
Steph LiuandJay Cox 28b9e338c1 feat(cluster-service): tenant catalog view (#2256)
* test(management-engine): add operator API golden fixtures

Signed-off-by: Jay Cox <jcox@nvidia.com>
(cherry picked from commit 221b4918cc4e25cab13fe4d1c6f89d3a32e24bfc)

* feat(cluster-service): tenant catalog visibility

Signed-off-by: Stephanie Liu <stephaliu@nvidia.com>

---------

Signed-off-by: Jay Cox <jcox@nvidia.com>
Signed-off-by: Stephanie Liu <stephaliu@nvidia.com>
Co-authored-by: Jay Cox <jcox@nvidia.com>
2026-11-10 15:03:33 -08:00
Dan Budris 551e1cebbe feat(controller): authorize API requests by role (#2125)
Add an apiAuthz section to nvke-controller-config. When enabled, the
controller loads a LocalBundle from authorizer.localBundle.dir and asks
it whether the caller may call each API operation. The action is the
operation's operationId and the resource is the request path. The API
has no tenants, so the bundle is loaded with RoleOnly.

- Enforcing mode refuses with 403 before the handler runs. Permissive
  mode logs and counts the decision and serves the request.
- The controller reloads the bundle every 10 seconds. A failed reload
  keeps the live bundle and counts
  nvke_authz_bundle_reload_failures_total.
- nvke_authz_decisions_total counts decisions by outcome and action, and
  nvke_authz_enabled reports the mode.
- Startup refuses authorization with authentication off, and enforcing
  authorization behind permissive authentication.

The chart renders apiAuthz off: it mounts no bundle.

Signed-off-by: dbudris <dbudris@nvidia.com>
2026-11-10 17:36:53 +00:00
Mark Stillwell 08d0bcd575 refactor(helm): extract shared NVKE catalog CRDs (#2166)
Extract the shared MachineImage, ClusterRelease and NodePoolRelease definitions into a catalog chart, preserving the NVKE controller’s default installation and ownership. Reuse canonical definitions across Helm, Kustomize, generation and CLI packaging.

Closes #2165

Created with AI assistance

Signed-off-by: Mark Stillwell <mstillwell@nvidia.com>
2026-11-09 16:17:45 +00:00
Steph Liu 92c39b8ad5 feat(cluster-service): register controlplaneclass, clusterreleasechannel, and nodepoolrelease in operator apis (#2190)
Signed-off-by: Stephanie Liu <stephaliu@nvidia.com>
2026-11-06 16:45:06 -08:00
Meet Vadaria 16b0d139c6 fix(chart): refuse launchLayer with SPIFFE unless nodes attest with dsxImds (#2163)
The attestation method is deployment-wide, and a SPIFFE-enabled LaunchLayer node attests only through dsx_imds, so such a deployment configured with tpm or joinToken had every LaunchLayer node refused at creation. The chart now refuses it at render and the controller at startup, as for an unsupported provider. A controller.launchLayerEnabled helper replaces the provider loop nvke-rbac.yaml had.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>
2026-11-06 23:48:34 +05:30
Meet Vadaria 8cf1dd3faf feat(chart): grant CAPLL tenant Node access when launchLayer is enabled (#2139)
With the shared OIDC provider on, the management plane reaches tenant clusters through a SPIRE kubeconfig, and CAPLL reads that same kubeconfig to set each Node's providerID. The tenant RBAC manifest bound only the CAPI controllers, so CAPLL authenticated and was then denied. It now carries nvke:capll-manager (nodes get, list, patch) for spiffe.capllManagerSubject when supportedInfraProviders includes launchLayer.

With token exchange and no subject the binding is left out rather than failing the render, so a site that already grants CAPLL through tenantAccess.additionalRBAC keeps upgrading.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>
2026-11-06 09:16:04 +05:30
Ryan Bever ab0154a7bc feat(controller): authorize SPIFFE bootstrap identities (#2130)
Add a controller that grants labeled, joining Machines the tenant RBAC required by kubeadm. Reconcile six kubeadm bindings from resolved SPIFFE identities and remove subjects after each Machine receives a node reference.

Gate the controller's tenant permissions on the bootstrap controller setting, report synchronization through Machine conditions, and cover the behavior with unit and chart assertions. CSR approval remains separate.

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-05 07:23:44 -07:00
Ryan Bever 80d0daf05a feat(controller): add SPIRE NICo TPM bootstrap identity controller (#2108)
* feat(controller): add SPIRE NICo TPM bootstrap identity controller

Signed-off-by: Ryan Bever <rbever@nvidia.com>

* fix(controller): accept machine owners across CAPI versions

Parse controller owner API versions and match the Cluster API group instead of requiring the controller’s current version. Reject malformed or unrelated owner references.

Signed-off-by: Ryan Bever <rbever@nvidia.com>

* fix(controller): reconcile deleted NicoMachines

Signed-off-by: Ryan Bever <rbever@nvidia.com>

* fix(controller): clean up unresolved TPM identities

Signed-off-by: Ryan Bever <rbever@nvidia.com>

---------

Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-04 17:48:17 +00:00
Dan Budris 970e811036 feat(controller): count and alert on rejected tenant kubeconfigs (#2096)
Count every tenant kubeconfig the controller refuses to load in
nvke_controller_tenant_kubeconfig_rejected_total, by source: node_agent
for a control-plane node's admin.conf, secret for a published
kubeconfig Secret. Each rejection also logs the cluster, and the node
or Secret. Content rejections wrap kube.ErrInvalidKubeconfig, so other
failures are not counted.

Add NVKETenantKubeconfigRejected to the credential PrometheusRule. It
fires on any rejection in the last ten minutes.

Signed-off-by: dbudris <dbudris@nvidia.com>
2026-11-03 13:11:16 -05:00
Ryan Bever 0079021b6c feat(controller): add bootstrap controller configuration (#2086)
Signed-off-by: Ryan Bever <rbever@nvidia.com>
2026-11-03 10:14:23 -07:00
Terry Howe 3545d67a57 chore: name the release that removes the rename compat windows (#2034)
* chore: name the release that removes the rename compat windows

The launch rename said "for one release" three times and named no release,
so the four dual-accept windows had no removal date and were becoming
permanent by default.

All four windows landed on the v0.23.0 line, which is still in beta. None of
their fleet gates can be met yet: the release they provide compatibility for
has not shipped. So each window takes the comment path the issue allows,
naming v0.25.0 and the gate it waits on, rather than being removed now:

- node-agent JWT audience: gated on a fleet agent_version sweep
- reserved "nke:" OIDC prefix: gated on pruneLegacyRBAC across all 41 sites
- auth-config apiVersion: gated on an nke-auth-config ConfigMap sweep
- legacy metric series: gated on Mimir retention aging the series out

Only two allowlist entries die with their code, ^nke_controller_|^nke_auth_
and ^oidcPrefixNKE$; both now name v0.25.0. The audience and "nke:" entries
cover further live names (the NVKR artifact, the pruned nke:cwe objects) and
survive their windows, so their comments say which half is dated.

Also folds in the two cosmetic items from the close-out audit: a note on
NamespaceNVKESystem explaining why its value lags its name, and a separate
section for nke-stack and the Keycloak dev scaffolding, which are not names
an installed site persists and were never in the rename's scope.

No behaviour change.

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

* fix: address review feedback

Correct the stated reason the "nke:" reserved prefix waits on
pruneLegacyRBAC. ReservedIdentityPrefixes bounds OIDC usernamePrefix and
groupsPrefix and compiles into the tenant apiserver's CEL user-validation
rules; it does not reserve Role or ClusterRole names, so the claimed
ClusterRole collision with the pruned nke:cwe objects was not a real
mechanism. The two share a spelling, nothing more.

The gate itself stands, on the narrower ground that no platform-owned RBAC
should still carry the nke: name once a fleet-wide provider may mint nke:
usernames and groups. Also names the generated-config fixture that moves
with the removal.

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

* fix: address review feedback

The node-agent audience window was gated on the wrong thing. The agent picks
its audience with --controller-audience, which defaults to the legacy value
and falls back to it when empty, and nodeAgentBootstrapFiles never passes the
flag. Nothing else in the tree sets it. So every TLS/JWT agent requests the
legacy audience whatever version it reports, and agent_version does not gate
this window at all. Removing it in v0.25.0 on the old reading would have
failed every TLS/JWT node closed.

State the real precondition instead: something has to select the renamed
audience, by the controller passing the flag or by the default flipping,
before the fleet can roll onto it and the window can close.

Also drop the hardcoded site count from the "nke:" gate; it goes stale and
this repository is public.

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

* docs: point the audience gate at its tracking issue

The gate described a precondition with nothing tracking it. Name #2039, which
covers having the controller select the renamed audience per node, and record
why flipping the agent default is not the alternative.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-29 16:48:58 -06:00
Jay Madden 2be9f7321a feat(cluster-service): add support for cluster releases (#2001) 2026-10-29 17:48:15 -05:00
Meet Vadaria c829318291 feat(chart): refuse an unsupported supportedInfraProviders entry at render time (#1866)
The chart rendered any supportedInfraProviders value, and only the
controller refused an unknown or repeated provider, at startup. With one
replica and maxUnavailable 1, a config rollout could replace the running
controller with a pod that crash-loops, taking the API down until the
value was fixed.

The chart now fails the render on such an entry, with the controller's
own provider names, so helm and Argo CD report the error and nothing is
applied. The startup check stays for configs the chart does not render.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>
2026-10-29 09:24:04 -07:00
Terry Howe 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>
2026-10-29 08:17:40 -06:00
Terry Howe 589d922c83 feat(chart): make the tenant RBAC ConfigMap name a value and move it to nvke (#1891)
* feat(chart): make the tenant RBAC ConfigMap name a value and move it to nvke

The nke-rbac ConfigMap name was a literal in two templates and a compiled
constant in controller/internal/nvkerbac, so a site could not keep it while the
chart's defaults moved. rbacConfigMap.name now drives the ConfigMap, the Role
and RoleBinding that grant get on it, and that Role's resourceNames, and the
controller reads it from rbacConfigMapName in nvke-controller-config rather
than from the constant. The default is nvke-rbac; a site installed before the
value pins nke-rbac, which is also what the Go fallback resolves to, so a
binary upgrade alone never moves a site that has not pinned.

The Role's resourceNames is the entry that matters: a ConfigMap the Role does
not name renders clean, installs clean, and is then denied at reconcile time,
leaving tenant RBAC unapplied. check_pinnable_names now asserts all four
consumers plus the rendered config key follow the value together.

nvkerbac.Source carries the namespace and the name as one value, because a name
resolved against the wrong namespace silently reads nothing — and a missing
read degrades the reserved-subject control that stops a fleet-wide OIDC
provider claiming an NVKE identity.

Closes #1862

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

* fix(chart): follow rbacConfigMap.name in the RBAC and identity assertions

chart-rbac-check looked up a literal nke-rbac ConfigMap and failed once the
default moved. It asserts what the manifest grants, not what it is called, so
it now renders with rbacConfigMap.name set and resolves the ConfigMap by that;
moving the default again cannot break it.

chart-identity-assertions.py had the same literal in two scenario-scoped
places. Both passed only because the legacy scenario pins the old name and the
default scenario renders no RBAC ConfigMap at all, so the namespace and SPIFFE
subject checks silently skipped a default render. Both now read the scenario's
own name, and each scenario asserts rbacConfigMapName in its rendered config.

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

* fix(chart): quote the rendered RBAC ConfigMap name

rbacConfigMap.name is operator-supplied, and a DNS-1123-valid name YAML 1.1
reads as another scalar type (n, y, true, off) rendered as a bare scalar: the
ConfigMap metadata.name and the Role resourceNames entry both became booleans
and the install failed. Quote both. The Role and RoleBinding names interpolate
after controller.fullname and a dash, so they are already strings.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-28 16:54:03 -04:00
Terry Howe a5f919dbc8 feat(ci): publish the controller image to GHCR as nvke-controller (#1950)
* feat(ci): publish the controller image to GHCR as nvke-controller

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

* fix: address review feedback

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-28 15:34:20 -04:00
dependabot[bot] 28f9c31337 build: bump the docker-images group across 4 directories with 3 updates (#1985)
Bumps the docker-images group with 1 update in the /controller directory: [spiffe/k8s-spiffe-workload-jwt-exec-auth](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /controller/deploy/k8s/capi-spiffe-exec-auth directory: alpine.
Bumps the docker-images group with 1 update in the /controller/hack directory: [spiffe/k8s-spiffe-workload-jwt-exec-auth](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /management-engine directory: distroless/static.


Updates `spiffe/k8s-spiffe-workload-jwt-exec-auth` from 1.0.0 to 1.0.1
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `spiffe/k8s-spiffe-workload-jwt-exec-auth` from 1.0.0 to 1.0.1
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `alpine` from 3.24.2 to 3.24.3

Updates `spiffe/k8s-spiffe-workload-jwt-exec-auth` from 1.0.0 to 1.0.1
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `spiffe/k8s-spiffe-workload-jwt-exec-auth` from 1.0.0 to 1.0.1
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `distroless/static` from `e2e927e` to `18f4cc2`

---
updated-dependencies:
- dependency-name: spiffe/k8s-spiffe-workload-jwt-exec-auth
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: spiffe/k8s-spiffe-workload-jwt-exec-auth
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: alpine
  dependency-version: 3.24.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: spiffe/k8s-spiffe-workload-jwt-exec-auth
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: spiffe/k8s-spiffe-workload-jwt-exec-auth
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
- dependency-name: distroless/static
  dependency-version: nonroot
  dependency-type: direct:production
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-28 10:41:46 -06:00
Tjark Rasche adeb0c3e1e feat(controller): monitor credential expiry and lifecycle health (#1377)
* feat(controller): monitor credential expiry and lifecycle health

Port the reviewed NKX-15682 inspection RPC, persisted inventory/exporter, direct-API CSR observation and optional alert rules onto the completed rotation layer. Keep monitoring independent of renewal and preserve last-success freshness on failed probes.

Retain ParseConfigFromEnv startup and the unmounted current-main config map; render monitoring fields in both surfaces with parity regressions. Regenerate proto and chart documentation using exact pinned tools.

Sources: c903c3ca2b24b52d3e4dc563e6e6f81ce0e77af3, 12e425e01dcb7a229ab1bf7caf507fdb44e8ff18 and 00a82a9bb8b4d81e98332a2270f04f991cf20188. Inherit rotation safety and deterministic notices without duplicating their changes.

Closes #1345

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(controller): keep certificate observations available across a failed probe

certificate_observation_available used observation.Available, which
reflects only the latest attempt. A failed probe keeps the last good
ObservedAt and certificates, but every per-credential series dropped to
zero, so a firing NVKECertificateExpiring resolved on any transient
failure and agent rollouts made it flap fleet-wide.

Derive certificate_observation_available from the age of the last
successful observation (ObservedAt within observationMaxAge) and keep
certificate_inspection_available tied to the latest attempt. A collector
test covers a failed attempt within and after observationMaxAge, and a
promtool fixture shows the expiry alert staying firing while inspection
is unavailable. The monitoring guide describes both series.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(controller): inspect certificates with a bounded worker pool

The certificate-inspection controller registered with default options, so
it ran one reconcile at a time, each with a 30s probe deadline.
Unreachable agents are re-probed every 1-32 minutes and held the only
worker, so healthy nodes queued behind them and could age past
observationMaxAge.

Register through dbreconcile.AddController with eight workers, the
agent-readiness controller's default for the same probe pattern. A
manager-level test blocks one node's probe and requires another node to
be inspected meanwhile.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* ci(chart): assert the credential PrometheusRule is absent when disabled

The default-off and global.monitoring.enabled=false renders were asserted
only by a Go test that skips without helm, and the charts unit lane
installs no helm, so the gate never checked either contract. The
assertions script that chart-check runs with the pinned helm now renders
the whole chart in both cases and fails if a PrometheusRule appears. The
monitoring guide lists the new assertions.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* ci(chart): pin the PrometheusRule schema and trigger the chart job on its inputs

chart-check validated the rendered PrometheusRule against a schema fetched
from the mutable main branch of datreeio/CRDs-catalog with no digest, so
an upstream change could turn the gate red, or change its result, for an
unchanged commit. Fetch the schema from catalog commit 501527ab and verify
it against a sha256 committed in make/tool-versions.mk, as the promtool
download already is.

The script's pin() helper printed an empty string for a missing or
renamed name, which surfaced only after minutes of 404 retries. Read
promtool and schema pins through hack/read-tool-version.sh, which fails
at once on an unknown name.

The chart.yml push filter did not cover the inputs chart-check now reads,
so a main commit touching only them ran no Chart job. Add
controller/deploy/monitoring/**, make/tool-versions.mk,
hack/check-tool-version.sh and hack/read-tool-version.sh.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* test(controller): allow repeated certificate-inspection manager setup in tests

controller-runtime keeps a process-wide registry of controller names, so
the manager-level inspection test failed under go test -count=N with
"controller with name certificate-inspection already exists". Keep the
registered name in an unexported field, unchanged in production, and give
the test a unique one.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(controller): fire credential availability alerts only when monitoring is enabled

All credential rules ship as one PrometheusRule, so the availability rules
cannot be disabled individually. With credentialMonitoring.enabled=false
and alerts enabled, the collector still exports unavailable inspection and
CSR series while the inspector and observer are off, so
NVKECertificateInspectionUnavailable and
NVKEKubeletServingCSRObservationUnavailable fired for every node and
cluster.

Gate both rules on nvke_controller_credential_monitoring_enabled == 1.
Promtool fixtures cover the disabled case and keep the existing firing
cases enabled. The monitoring guide and the credentialMonitoring.enabled
value description state the coupling; the chart README row follows the
value comment.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(controller): correct credential monitoring schema, CA and threshold notes

- Every run of the alert assertions fetches the pinned PrometheusRule
  schema, so the check is never fully offline; the guide now says so.
- "use manual CA procedure for a CA" pointed nowhere. NVKE ships no CA
  rotation procedure and does not rotate CAs, so the response is to
  escalate, linking the renewal guide that says so.
- thresholdDays was documented as 7 through 90, but with monitoring
  enabled warningDays must exceed it by two renewal intervals, which
  limits it to 44 with the defaults. The values comment, the chart README
  row and the guide's table state the coupling.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* refactor(controller): append the credential observation fields to their structs

CertificateInspection was inserted before ID in db.Node, and
CredentialCSRs before the existing ClusterConditions fields. Contributor
guidance asks for new fields after existing ones, so move both to the end
of their structs. The JSON and bun column names are unchanged and the tree
has no positional literals of either struct.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* ci(chart): fail the credential alert absence check when helm fails

The disabled-rule check piped helm template into grep inside an if
condition. set -e does not apply there and pipefail turns a failed render
into a false condition, so a template error in either disabled render
read as "no PrometheusRule" and the check passed.

Render each case to a file under set -e first, then grep the file. With a
helm wrapper that fails only the global.monitoring.enabled=false render,
the script now exits 1; before this change it exited 0.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(controller): say expiry alerts stop only after observationMaxAge

With monitoring disabled the collector keeps exporting the last
successful observation until it is older than observationMaxAge, so the
expiry and missing-certificate alerts can keep firing for up to that age
(3h by default). The guide said no rule reports them once monitoring is
disabled.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* test(controller): require concurrent certificate probes regardless of node order

The worker-pool test blocked one named node and required the other to be
inspected meanwhile. With a single worker it failed only when the blocked
node was dequeued first, which depended on ListNodes returning rows in
insertion order, and ListNodes has no ORDER BY.

Block every probe instead and require two probes to be in flight at the
same time. That needs a second worker whichever node comes first. With
inspectionWorkers set to 1 the test fails after 10s.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(controller): gate stale and failed CSR alerts on credential monitoring

With credentialMonitoring.enabled=false the CSR observer is not registered,
but the collector keeps exporting the last stored CSR inventory and its
pending age keeps growing, so NVKEKubeletServingCSRStale and
NVKEKubeletServingCSRFailed kept firing on a frozen snapshot. Gate both on
nvke_controller_credential_monitoring_enabled like the availability alerts,
and cover the disabled case with a promtool test.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* build: run chart-check in preflight for credential alert fixtures

controller/deploy/monitoring/credential-alerts-test.yaml is only consumed by
promtool inside chart-check, but preflight did not route that directory to
chart-check, so a fixture-only change skipped it locally.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(controller): state renewal setting limits in the renewal guide

certRenewal.interval and thresholdDays now have enforced ranges, and with
credential monitoring enabled warningDays must exceed thresholdDays by two
renewal intervals, so installs with thresholdDays above 44 fail to upgrade.
Say so where operators configure renewal and link the monitoring rule.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(controller): mark the gated CSR alerts in the response table

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(controller): name the credential monitoring ConfigMap as main now does

Main renamed the chart's default controller ConfigMap to
nvke-controller-config, so the guide's lookup for these settings found
nothing on a default install. The guide now names controllerConfig.name
with its default, and the new comments use the current name.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(credential-monitoring): give kubelet certificates their own expiry alert

The kubelet rotates its client and serving certificates itself at 70-90%
of their lifetime, so NVKECertificateExpiring's warningDays window fired on
healthy rotations. NVKECertificateExpiring now excludes kubelet-client and
kubelet-serving, and the new NVKEKubeletCertificateExpiring rule warns when
either has fewer than a fixed seven days left, which only happens when
kubelet rotation has stopped working. Promtool fixtures cover 40 and 6 days
for both kubelet certificates and a kubeadm leaf inside warningDays.

The monitoring guide also names the metrics NetworkPolicy namespace
requirement and says inspection availability keeps its stored value until
observationMaxAge when monitoring is disabled.

Addresses review threads r4335329332 (seven-day kubelet threshold),
r4335329829 and r4335330237.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(credential-monitoring): match controller duration bounds and env inventory

Fixes PR #1377 review findings F1 and F2.

F1: the chart compared duration bounds in whole seconds, dropping any
fractional second, while the controller compares exact time.Duration values.
Compare in nanoseconds so the chart refuses exactly what Validate refuses,
and add the sub-second refusals and accept render to the assertions script.

F2: the CREDENTIAL_MONITORING_ENABLED, CERTIFICATE_INSPECTION_INTERVAL,
CERTIFICATE_OBSERVATION_MAX_AGE and CERTIFICATE_WARNING_DAYS variables never
existed, so drop them from controller-config-env.yaml and list their keys in
configMapOnly. The drift test now refuses a key in both. The guide limits the
"no longer reads" sentence to the former CERT_RENEWAL_* variables.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(credential-monitoring): escalate stuck accepted renewals from alerts

The renewal Stuck and Overdue alerts told operators to confirm termination
and then release ownership or retry. Certificate renewal now treats an
accepted cycle whose Temporal execution has closed as stop-and-escalate:
the lock must not be released, the cycle ID not restarted and no forced
cycle started.

The Stuck alert now asks whether the workflow is still running and, if it
has closed while the cycle is accepted, to stop maintenance and escalate.
The Overdue alert defers to that response when a cycle is still accepted.
The alert table matches, and the Failed row states the full automatic
retry condition. The promtool fixtures carry the new descriptions.

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* docs(credential-monitoring): correct renewal margin, retry and two-voter notes

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

* fix(credential-monitoring): write certificate inspection column-only and reject zero observed time

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>

---------

Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>
2026-10-26 17:08:13 +00:00
Aaron Patten fdf9371ba1 feat(agent): name the controller client CA bundle only --nvke-controller-client-ca-bundle (#1870)
The agent reads the controller client CA bundle only from
--nvke-controller-client-ca-bundle and NVKE_CONTROLLER_CLIENT_CA_BUNDLE.
--controller-client-ca-bundle is an unknown flag, and
NKE_CONTROLLER_CLIENT_CA_BUNDLE has no effect.

The controller writes --nvke-controller-client-ca-bundle for every
external-mTLS node, whatever the node's agent version. The CA file path
still follows the agent version. External node-agent mTLS requires node
agent 0.3.0 or later; the chart and controller docs say so.

Related to #1869

Signed-off-by: Aaron Patten <apatten@nvidia.com>
2026-10-26 11:31:24 -04:00
Abhay Krishna 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>
2026-10-25 13:24:07 -07:00
Abhay Krishna 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>
2026-10-23 16:33:27 -07:00
Terry Howe 789a42d745 feat(deploy): issue the OIDC upstream CA with the NVKE subject on new sites only (#1890)
* feat(deploy): issue the OIDC upstream CA with the NVKE subject on new sites only

The CA's subject still said NKE. Changing it re-issues the CA with a new
private key, which invalidates the trust anchor every tenant of an existing
site has embedded, and nothing distinguished a first install from a re-run
of `nvkectl ... install`.

Add a create-if-absent directive to the manifest-item contract: a .yaml file
naming `<kind>:<name>:<namespace>` is applied only when that object is not in
the cluster. The probe is a read, so it runs under --dry-run too and a dry run
still describes the install that would happen; a probe that fails for any
reason other than NotFound stops a real install rather than read an unanswered
API server as "absent", which is the direction that re-creates the object.

Split the Certificate out of oidc-upstream-ca.yaml so the two Issuers beside
it, which carry no key material, keep being applied every install, and gate
the Certificate on its CA Secret -- the Secret holds the key material tenants
trust. Then move the subject to NVKE.

Closes #1863

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

* fix: address review feedback

Name the CA certificate, not its private key, as the trust anchor tenants
embed, and say what the leaf losing its chain means.

Say that the gate belongs to the executor: a tool that does not read the
directive applies the Certificate and re-issues the CA. Add it as step 5 of
what another executor has to do, with the GitOps shape of it.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-23 14:33:41 -04:00
Dan Budris a3cabe2db2 refactor(auth): move the authN library to auth/authn (#1903)
Move controller/internal/auth to auth/authn as package authn, in a new
module, github.com/dsx-ai-factory/nvke/auth. This is a pure move with no
behavior change: only the package name, import paths, the qualifier and
path references change. The new module is wired the way controller/api
is: go.work use, a require and replace in controller/go.mod, a replace
to ../controller/api in auth/go.mod, the root Makefile module lists,
the lint and unit-test CI matrices, the e2e path filters, the coverage
registry, the notices and licence ignore lists, CODEOWNERS and the
labeler.

Signed-off-by: dbudris <dbudris@nvidia.com>
2026-10-23 11:40:55 -06:00
Giuseppe Laguteta 2b483215c9 fix(controller): restrict additional RBAC objects (#1915)
* fix(controller): restrict additional RBAC objects

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>

* fix(controller): require namespaces for tenant roles

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>

---------

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>
2026-10-22 14:49:24 -07:00
Giuseppe Laguteta c919cb7284 feat(controller): configure additional tenant RBAC (#1896)
* feat(controller): configure additional tenant RBAC

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>

* fix(controller): validate additional RBAC identities

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>

* fix(controller): distinguish tenant RBAC identity sources

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>

---------

Signed-off-by: Giuseppe Laguteta <glaguteta@nvidia.com>
2026-10-22 17:09:04 -04:00
Jun Shun Zhang 229df84386 feat(controller): allow dev control planes without a VIP (#1893)
* feat(controller): allow dev control planes without a VIP

Closes #1892

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

* docs: clarify no-VIP development guidance

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

* docs: document accepted no-VIP rollout behavior

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

* test(e2e): fit CAPD control planes to local memory

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

---------

Signed-off-by: Steven Zhang <stevenzhang@nvidia.com>
2026-10-22 18:52:16 +00:00
Abhay Krishna 48dc309320 fix(chart): run the controller as an unprivileged user (#1874)
The chart defaulted podSecurityContext.runAsNonRoot to true, but the
controller image had no USER and the chart set no runAsUser, so the
kubelet would refuse to start the pod. Every deploy path worked around
it by setting podSecurityContext to null and turning the read-only root
filesystem off, which ran the controller as root everywhere. That
contradicted controller/SECURITY.md, which assumes the chart's non-root
and read-only-root settings are enforced.

The image now declares USER 65532:65532. The chart sets the same uid
explicitly, with runAsGroup, fsGroup and the RuntimeDefault seccomp
profile, and the container drops every capability and disallows
privilege escalation. Setting the uid in the chart rather than relying
on the image covers the materialize-profiles init container too, whose
operator-built content image usually has no USER. That init container
now copies with cp -R, since an unprivileged cp -a fails to preserve
the image's root ownership on every file, and it takes the controller
container's securityContext, so it too drops every capability and runs
on a read-only root.

The overrides come out of the nvkectl bootstrap values and the
deploy/nico, capd-e2e and capnico-e2e overlays. Tilt keeps running as
root on a writable root filesystem: live_update syncs the binary into
/usr/local/bin in the running container, which uid 65532 on a read-only
root would refuse.

Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com>
2026-10-21 15:51:08 -07:00
Miancheng Lin 22f62b1356 refactor(controller): rename the os_profile metric label to release (#1841)
Follows the controller API rename; the Go side already read Release. Also
updates the reference dashboard that queries the label.

nvke_controller_node_info, nvke_controller_nodepool_info and
nvke_controller_nodeset_info now carry a release label in place of
os_profile. Queries that select or group by os_profile need updating, and
series scraped before this change keep the old label. A label name cannot
be matched by regex the way a metric name can, so there is no consumer-side
compatibility shim equivalent to the one #1458 used for the metric rename.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-10-20 15:09:40 -07:00
Terry Howe 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>
2026-10-20 11:46:56 -04:00
Dan Budris b38665858a build: bump Go to 1.27.3 (#1821)
Go 1.27.3 fixes CVE-2026-111943 (golang/go#82345). crypto/x509 stops
trusting a small set of intermediate CA certificates, and
Certificate.Verify drops chains that contain them. Every shipped
binary verifies TLS chains through crypto/x509.

go.work names 1.27.3 and make go-version-sync carries it to each
member go.mod. The golang base images move to 1.27.3 with their new
index digests.

Signed-off-by: dbudris <dbudris@nvidia.com>
2026-10-20 11:37:27 -04:00
Terry Howe 8db5721ae3 fix(teleport): own the managed-by values earlier releases wrote (#1792)
* fix(teleport): own the managed-by values earlier releases wrote

IsOwnedByController compared the "managed-by" label against the single
value the controller writes, so moving teleport.managedByLabelValue
disowned every token and node already carrying the previous one. A
Teleport token's labels are fixed at mint and a node's at join, and
neither is ever relabelled, so the move cannot bring them along: they
stop being listed, GetToken and DeleteToken refuse them with
ErrNotOwnedByController, and nothing reaps what nothing owns.

Take an accept list instead, from the new
teleport.acceptedManagedByLabelValues beside the written value. The
written value stays single -- a token is stamped with one -- and
OwnershipManagedByValues puts it first, then the accepted ones, blanks
and duplicates dropped.

ListNodes filtered server-side on the written value, which has the same
blind spot for the same reason, so it now issues one request per
accepted value and dedupes by name. That is the path anti-entropy uses
to find stale nodes, and the nodes it could no longer see are exactly
the ones that joined before the value moved.

The chart default is an empty list, which owns only what the controller
writes and leaves a new site unchanged. An existing site lists the value
its earlier chart wrote.

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

* fix(test): use a real legacy managed-by value in the ownership fixture

The duplicate-entry case invented nke-cwe, which the merge gate's name-check
rejects: it is not one of the names the allowlist carries, because nothing
ever wrote it. The two values this feature exists to keep accepting are
nke-cloud-workflow-engine and nke-controller, both allowlisted as such.

The case asserts that blanks and repeats are dropped, so any value serves.
Using one the controller actually encounters costs nothing and keeps the
fixture honest about what a legacy label looks like.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-19 17:01:15 -06:00
Terry Howe e34e07e355 feat(chart)!: default the controller chart names and SPIFFE service path segment to nvke (#1769)
* test(chart): assert default, legacy-pinned and greenfield renders separately

chart-identity-assertions.py asserted the legacy names against the default render, so moving a default and keeping an existing install on its names could not be told apart. It now renders three scenarios, each with its own expectations: the chart's defaults, hack/testdata/chart-legacy-pinned-values.yaml, and a renamed greenfield install.

A default that moves now changes DEFAULT only. A pin that stops holding the old name fails the legacy-pinned render. The management namespace check is folded into the scenarios, and every check runs so a failure shows which render it was.

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

* feat(chart)!: default nameOverride and the controller config ConfigMap to nvke-controller

A new install now gets nvke-controller for the Deployment, Service and every object named from the fullname, and nvke-controller-config for the settings ConfigMap. The ServiceAccount, the ServiceMonitor and the nke-rbac objects keep their names; they move separately.

BREAKING CHANGE: an install that predates this must set nameOverride to cloud-workflow-engine and controllerConfig.name to nke-controller-config before it takes this chart. The Deployment's spec.selector is immutable, so an upgrade that moves nameOverride fails, and the ConfigMap rename orphans the live object. hack/testdata/chart-legacy-pinned-values.yaml lists the pins.

The default scenario of chart-identity-assertions.py moves to the new names and the legacy-pinned scenario does not. The chart scripts, the chart test and the e2e helpers that select the ConfigMap by name follow the default; nvke-auth-demo.sh takes it from NKE_CONTROLLER_CONFIGMAP.

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

* style: gofmt map literal alignment in oidc site_test

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

* feat(chart)!: default the SPIFFE service path segment to nvke-service

A new install issues the controller the ID spiffe://<trust domain>/nvke-service/<service account>: the chart's default RBAC subjects, the ClusterSPIFFEID and the SPIRE admin ID now agree on nvke-service. The CLI bootstrap, the deploy path, the e2e stacks, Tilt and the e2e helpers that name the controller's ID follow.

BREAKING CHANGE: an install that predates this must set spiffe.servicePathSegment to nke-service and keep its ClusterSPIFFEID and SPIRE admin ID on /nke-service/. Node agents from before the nvke rename admit only that path, and the controller dials every node with one SVID, so moving it on such a site breaks controller-to-node mTLS.

chart-identity-assertions.py checks each scenario's SPIFFE subjects against its segment: nvke-service by default, nke-service in the legacy-pinned render.

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

* fix: address review feedback

Name the auth demo's controller ConfigMap setting NVKE_CONTROLLER_CONFIGMAP, the prefix AGENTS.md requires for settings that name the controller. Show the default SPIFFE subjects in the chart README under spiffe.servicePathSegment instead of a fixed /nke-service/.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-19 11:34:48 -06:00
Meet VadariaandClaude Opus 5.5 47478ebe8f feat: native LaunchLayer provider integration (#1543)
* feat(db): add LaunchLayer provider type and typed payload structs

Per NKX-14085: native typed LaunchLayer integration, mirroring NICo's
existing db-layer pattern exactly. Adds db.ProviderTypeLaunchLayer,
LaunchLayerClusterProvider, LaunchLayerNodePoolProvider (reused for
NodeSet, matching NicoNodePoolProvider's reuse), LaunchLayerControlPlaneProvider,
and LaunchLayerNodeProvider, each with the standard XProvider()/SetX()
accessor pair and clone helper. Extends every ResolveProviderType()
switch with the new case, and every existing SetNico/SetCapi setter to
null out the new LaunchLayer field too.

New migration adds the launch_layer jsonb column to clusters,
node_pools, node_sets, and nodes — control_plane_configurations needs
no migration since its config column is already a single jsonb blob
that can hold a new key without a DDL change.

First of several commits implementing full LaunchLayer provider
support (OpenAPI schema, internal/server wiring, the capability-client
implementations, RBAC, and Tilt dev wiring follow).

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(api): add LaunchLayer OpenAPI schema sections

Per NKX-14085: mirrors NICo's schema pattern exactly — LaunchLayerClusterProvider,
LaunchLayerNodePoolProvider (+Update), LaunchLayerNodeSetProvider (read-only),
LaunchLayerControlPlaneProvider (+Update), LaunchLayerNodeProvider (read-only),
plus the LaunchLayerClusterOwner/LaunchLayerSecurityGroup(Refs) nested shapes
CAPLL's own cluster-level schema needs. Wires a launchLayer sibling field into
the same ~10 container schemas nico is wired into, and extends every
not:anyOf provider-exclusivity block from 2-provider to 3-provider logic
(forbid every pair, plus forbid none on create-time schemas).

make generate / make api-compat-check both pass clean — purely additive,
no breaking change.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(clients): implement the LaunchLayer capability client

Per NKX-14085: new internal/clients/launchlayer package implementing all
9 ProviderClient capabilities, matching the existing capi/nico shape
exactly (Client struct{} + New(), one file per capability). Registers a
case db.ProviderTypeLaunchLayer in all 9 factory switches.

CAPLL's own Go module (github.com/NVIDIA/cluster-api-provider-launchlayer)
only resolves through this environment's internal proxy, not the real
public proxy.golang.org — unlike cluster-api-provider-nico, which already
made that transition. Per this repo's own "no internal dependency" rule,
LaunchLayerCluster/LaunchLayerMachine manifests are built as plain JSON
objects instead of importing CAPLL's typed API, the same approach the
capi client already uses for a caller-supplied manifest, applied here to
a controller-constructed one.

Notable design points, each confirmed against the actual CAPLL repo
(pulled fresh) rather than assumed:
- CreateMachine calls deps.CreateSpireJoinToken/NodeAgentBootstrapFiles
  the same way the CAPI client does, not NICo's no-SPIRE path — CAPLL is
  a pure bootstrap-Secret pass-through (docs/profile-args.md), so SPIRE
  material has to already be baked into the cloud-init payload.
- TryAdvanceStuckMachine and ResolveNodePoolUpgrade are no-ops, matching
  the CAPI client — CAPLL has no rotation/release-catalog concept.
- UsesFMDSBGPPeerASN is always false — the VPC-prefix compatibility
  signal it reports on is a NICo-only concept.
- ValidateNodePoolPayload/ValidateControlPlaneConfigPayload enforce
  instanceType required + hostOSProfile/vmProfile mutual exclusivity,
  matching #1387's content-validation pattern.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(server): wire LaunchLayer into cluster/node-pool/control-plane dispatch

Per NKX-14085: adds a third case to every provider-dispatch switch in
internal/server — the request-shape-to-client-call mapping that #1387
established stays in server, not internal/clients. Covers:

- clusters.go: create-time dispatch + field-presence validation
  (validateCreateLaunchLayerClusterProvider), the cluster->db and
  db->api conversions, the update-time mismatched-provider gate
  (generalized from a 2-way nico/infra check to 3-way), and the
  cluster-level control-plane instanceTypePreference-style update path
  (a no-op for LaunchLayer, since every field is immutable per CAPLL).
- node_pools.go: create/update dispatch, field-presence validation,
  db<->api conversions for NodePool. validateUpdatedNodePool's
  clusterIsCAPIBacked() boolean dispatch is generalized to a proper
  3-way switch — it was implicitly treating "not CAPI" as "Nico",
  which would have silently run NICo's disk-selection-strategy check
  against LaunchLayer node pools.
- cluster_control_plane_config.go: the parallel control-plane-config
  dispatch, field-presence validation, and the "merged spec" validator.
- node_sets.go / nodes.go: read-response conversions for NodeSet/Node.

config.go: new InfraProviderLaunchLayer constant, added to the
SUPPORTED_INFRA_PROVIDERS allowlist.

Full test suite passes with zero regressions — confirms the
clusterIsCAPIBacked generalization didn't change NICo/CAPI behavior.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(chart): grant RBAC for the LaunchLayer CRDs

Per NKX-14085: adds launchlayerclusters/launchlayermachines/
launchlayermachinetemplates to the capi ClusterRole, matching the
existing nicoclusters/nicomachines entries — the controller creates
and reads these objects directly (ClusterScaffold/MachineMaterialization),
the same way it does for NICo's CRDs. Also adds the three CRD names to
the apiextensions.k8s.io existence-check rule.

helm lint / helm template both verified clean.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(clients): add a 10th capability for the hard-reboot annotation key

Per NKX-14085: the hard-reboot path (applyCAPIMachineRebootAnnotation)
unconditionally wrote NVKE's own nke.nvidia.com/reboot annotation onto
the generic CAPI Machine object. That works for NICo because CAPNico's
--reboot-annotation flag is deployed configured to that same key — but
CAPLL watches a hardcoded infrastructure.cluster.x-k8s.io/reboot-requested
key with no configurable override (confirmed by reading CAPLL's own
controllers/instance_lifecycle.go), so the same unconditional write
would silently never trigger a LaunchLayer reboot.

New RebootAnnotationProvider capability (10th on ProviderClient,
registered the same way as the other 9) resolves the right key per
provider. CAPI/NICo keep today's key unchanged — this is a new
dispatch point, not a behavior change for them, confirmed by the full
test suite passing with zero regressions. Added a dedicated test
proving a LaunchLayer-backed node gets CAPLL's key, not NVKE's.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(controllerconfig): recognize launchLayer as a supported infra provider

The chart-mounted controller config validator still only accepted
"nico" and "infra" for supportedInfraProviders, so a deployment that
enables the LaunchLayer provider fails config validation at startup.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(tilt): fix nico dev-loop install script against current kind/helm

kind load docker-image fails against this node image's containerd 2.3.x
("unknown containerd config version: 4 (supported versions: 2 and 3)"):
kind parses `containerd config dump`'s live, migrated schema version,
which containerd 2.3.x reports as 4 even though the on-disk config file
still says 2. Load the image through ctr directly instead, the same
mechanism kind uses internally, skipping its version check.

helm upgrade/install also no longer takes --server-side=false on the
Helm build pinned here; drop it.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(tilt): add local Tilt dev-environment wiring for the launchlayer provider

Mirrors hack/nico-provider/'s shape: a new hack/launchlayer-provider/
Tiltfile plus an install-capll.sh script that builds the CAPLL manager
and fake-API images from a local cluster-api-provider-launchlayer
checkout, deploys the chart and the 3-service fake LaunchLayer API
(VPC, Compute, security groups) into the shared kind cluster, and
wires the provider into the root Tiltfile's provider-plugin system and
supportedInfraProviders list.

Verified end-to-end against a live Tilt session: a LaunchLayerCluster
and control-plane LaunchLayerMachine provision against the fake API
and reach Ready/Provisioned, and the new mutual-exclusivity and
content validators correctly reject malformed requests.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(api): waive the structural api-compat break in the Update not-blocks

Forbidding a third provider pair on UpdateClusterControlPlaneConfig and
UpdateNodePoolRequest needs their bare `not: {required: [...]}` turned
into `not: {anyOf: [...]}}`. The structural differ reads that as the
original `required` property being removed, but no request valid under
the old schema becomes invalid: every pair it forbade is still
forbidden, and the new pairs only involve the brand new `launchLayer`
field, which no existing client could have been sending.

Tried keeping `not.required` untouched and adding the new pairs via a
sibling `allOf` instead (logically equivalent by De Morgan's), since
that avoids the compat break without a waiver. It breaks
oapi-codegen's generated type for both schemas into an untyped
interface{}, so it is not viable here.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(chart): split nico and LaunchLayer RBAC into their own files

A deployment that enables only one typed provider was still getting
ClusterRole permissions for the other's CRDs and for LaunchLayer's,
since capi.rbac.create granted all of them unconditionally. Split
rbac-capi.yaml's nico and launchLayer rules into their own
ClusterRole/ClusterRoleBinding pairs, each independently gated by a
new capi.rbac.nico / capi.rbac.launchLayer value (both default true,
so capi.rbac.create=true keeps granting everything it did before
unless a deployment opts a provider out).

rbac-capi.yaml keeps the provider-agnostic CAPI rules (machines,
clusters, the finalizers subresource) and the provisioned-provider
rules, which this change leaves alone.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* revert: drop the unneeded kind-load ctr workaround

The "unknown containerd config version: 4" failure was my local kind
CLI (v0.29.0) being too old for this node image's containerd 2.3.x,
not a repo-level incompatibility -- confirmed by testing plain `kind
load docker-image` again after upgrading to kind v0.33.0, which loads
cleanly with no workaround. Revert both scripts to the plain kind-load
call; keep the --server-side removal from the same earlier commit,
since that one is a real mismatch against the Helm build pinned here
and is unrelated to the kind version.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix: close three LaunchLayer gaps the lint exhaustiveness checks caught

- internal/kube/tenant_client.go: ClientForDBCluster had no case for
  db.ProviderTypeLaunchLayer and fell into the "unsupported provider
  type" default, so any code path needing a LaunchLayer cluster's
  tenant client would have failed outright. LaunchLayer clusters have
  no pre-tenant-access legacy path to fall back to, so this always
  goes through clientFromTenantAccessSecret, same as CAPI.
- internal/server/clusters.go: createInitialNodePools copied Nico and
  Infra from each initial node pool's config into the create request
  it builds, but not LaunchLayer -- a LaunchLayer cluster created with
  initial node pools would have silently dropped their launchLayer
  payload.
- internal/server/node_pools.go: validateUpdatedNodePool's switch
  routed anything that wasn't CAPI or LaunchLayer to Nico's validator
  through its default case, rather than naming Nico explicitly -- the
  same implicit-default pattern already generalized elsewhere this
  epic. A genuinely unknown future provider type would have silently
  gotten Nico's validation instead of being rejected.

Also extracted UpdateCluster's controlPlaneConfig provider-match
rejection into validateUpdateControlPlaneConfigProviderMatch: adding
the LaunchLayer branch pushed the function to cyclomatic complexity 49
/ maintainability index 19 (confirmed this function was lint-clean on
main before this branch's changes), well past this repo's linters.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* style(clients): fix golangci-lint findings in the launchlayer package

- goconst: the "name" JSON-manifest key appeared 3 times across
  scaffold.go/machine.go; extracted nameKey.
- grouper: two ungrouped single const declarations.

No behavior change -- caught by CI's lint job, not run locally before
this fix since make lint was never run as part of local verification
during implementation.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(api): add missing property descriptions and fix exhaustruct in test/e2e

The controller/api lint job runs the openapi-lint spec linter in
addition to golangci-lint; it failed with 15
property-description-present violations across the LaunchLayer
schemas (securityGroups, securityGroupRefs' two fields, and all four
fields each on LaunchLayerNodePoolProviderUpdate,
LaunchLayerNodeSetProvider and LaunchLayerControlPlaneProvider --
descriptions existed on the base Create-variant schema but were never
copied onto its Update/NodeSet/ControlPlane siblings).

test/e2e is a separate Go module with its own golangci-lint job;
nodePoolRequest had the same Nico/Infra-but-not-LaunchLayer gap
internal/server/clusters.go's createInitialNodePools had, caught by
exhaustruct in that module's own lint run rather than controller's.

Neither of these ran as part of local verification during
implementation -- make lint only covers the controller module, not
controller/api or test/e2e, which are separate Go modules with their
own golangci-lint jobs in CI.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(name-check): allowlist the embedded swagger blob's incidental hits

oapi-codegen embeds the full OpenAPI spec in controller/api/server.gen.go
as a gzipped, base64-encoded blob for /openapi.yaml to serve at
runtime. Adding descriptions to the LaunchLayer schema in this PR
reflowed that blob's bytes and happened to produce a 3-character,
case-insensitive "nke" token inside it by chance -- not a name
reference, and not something any future spec edit is guaranteed to
avoid either.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(api): make LaunchLayer node-pool fields fixed at creation, like NICo

LaunchLayerNodePoolProviderUpdate exposed all 5 of its properties
(instanceType, hostOSProfile, vmProfile, fulfillmentStrategy,
securityGroupRefs) while its own description called all 5 "fixed at
creation" -- a contract the server never enforced. Updating any of
them silently persisted and could trigger a replacement node set with
the changed creation-fixed settings (code-review finding, "Major").

NICo already solves this same problem for its own fixed-at-creation
fields (instanceTypeID, partitions, sshKeyGroupIDs) by not exposing
them in NicoNodePoolProviderUpdate at all, rather than conditionally
allowing them up to some point and rejecting them after. Match that
precedent instead of building new Compute-submission-state tracking
NVKE has nowhere else: LaunchLayerNodePoolProviderUpdate now carries
no properties, same shape LaunchLayerControlPlaneProviderUpdate
already had. node_pools.go's applier becomes a no-op for launchLayer,
matching the existing no-op already written for the control-plane
side. Fixed both Update schemas' descriptions to drop the "once a
Compute request has been submitted" conditional language that was
never enforced.

Also added the missing LaunchLayer case to
nodePoolReplacementConfigChanged (code-review finding, "Minor"): its
switch fell through to the "assume changed" default for LaunchLayer,
so an unrelated field change (e.g. maxSurge alone) on a LaunchLayer
node pool could incorrectly be treated as needing a replacement node
set, which NodePoolNeedsNewNodeSet and validateControlPlaneRollout
could then act on.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(temporal): mark the reboot-annotation provider lookup non-retryable

clients.GetRebootAnnotationProvider returns a deterministic error for
an unsupported cluster.ProviderType -- a pure in-memory switch, no I/O
and no transient cause. The activity returned it unwrapped, so
Temporal's default retry policy would retry it indefinitely, unable
to ever succeed (code-review finding, "Minor"). a.GetCluster's own
error is left alone: it already wraps a "not found" error as
non-retryable internally.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(name-check): drop the now-dead server.gen.go allowlist entry

The schema edit in the previous commit reflowed server.gen.go's
embedded swagger blob again, and this time it does not contain an
incidental "nke" token -- so the entry added for the last reflow now
matches nothing and fails the check as dead, per name-check.py's own
design (an allowlist entry must match a real, current hit; it cannot
stand as a guard against a hypothetical future one). If a later
openapi.yaml edit reflows the blob into containing a hit again, that
needs its own fresh entry at that time, not a reinstatement of this one.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(clients): remove SPIRE join-token attestation from LaunchLayer

deps.CreateSpireJoinToken already only mints a token when a node is
specifically configured for join-token attestation (code-review
comment), so this wasn't creating tokens unconditionally. But CAPLL
is the production-target provider here, unlike CAPI (dev/test-only),
so leaving join-token attestation reachable for it even as a
configurable option is the real risk, not just whether it's the
active default.

CreateMachine no longer calls deps.CreateSpireJoinToken at all.
renderBootstrapUserData rejects a node configured for join-token
attestation outright, with a LaunchLayer-specific error, instead of
silently proceeding to render a SPIRE agent config with no join_token
value and no NodeAttestor plugin at all -- which is what would have
happened just from removing the template's join-token branches
without this guard. The template itself drops the join_token stanza
and its NodeAttestor, so there is no path to one reachable even if
the guard were ever bypassed.

Tested all three attestation methods (tpm, dsxImds, and the
join-token rejection) against the actual rendered template output,
plus the existing SPIFFE-disabled no-op path.

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(launchlayer): register SPIRE identity and node identity for LaunchLayer machines

Nothing wrote nke.nvidia.com/spire-agent-spiffe-id-path onto a
LaunchLayer-backed Machine, so on a SPIFFE-enabled site
MachineSpireEntryController never created its ClusterStaticEntry and the
node agent could never authenticate. LaunchLayerSpiffeController now
writes it before join. The path is the dsx_imds agent ID DSX gives a
LaunchLayer bare-metal instance,
/spire/agent/dsx_imds/tenant/<orgID>/bm/<instanceID>, built by the
LaunchLayer client's new SpireAgentPathProvider capability from
LaunchLayerCluster.status.vpc.orgID and LaunchLayerMachine.status.instanceID,
so the controller holds only the watch and Machine wiring. A test drives
a SPIFFE-enabled LaunchLayer Machine through both controllers to its
ClusterStaticEntry.

A SPIFFE-enabled LaunchLayer node can attest only through dsxImds: the
Compute API reports no TPM endorsement key, and join-token is not
offered for this provider. The new NodeAgentProfileValidator capability
holds that rule in the LaunchLayer client. Cluster creation rejects a
LaunchLayer cluster with 400 on a deployment whose node-agent profile
the rule refuses, instead of accepting a cluster whose nodes never join.
CreateMachine checks the node's own pinned profile again, now before
anything is applied, and returns ErrUnsupportedMachineConfig, which the
activity marks non-retryable, so a rejected node no longer retries
forever leaving an orphan LaunchLayerMachine.

The post-ready identity readback wrote every provider's instance IDs into
node.Nico. It now goes through NewNodeProvider.ApplyObservedNodeIdentity,
so a LaunchLayer node records instance, machine and rack IDs in its
launchLayer payload, and the provider clients read their own status
fields. NICo and CAPI behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(server): reject a launchLayer payload on NICo and CAPI pool updates

UpdateNodePoolRequest promises a 400 for a provider payload that does not
match the pool's cluster, but the NICo and CAPI branches never checked
launchLayer, so PATCH {"launchLayer":{}} on such a pool succeeded and
changed nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(hack): keep --server-side=false on the CAPNICo Helm installs

Dropping it switched the CAPNICo installs to server-side apply under the
pinned Helm 4.2.4, for the NICo e2e lane and Tilt, where the later
kubectl patch of the manager args can conflict on a rerun. The change
was unrelated to LaunchLayer; this restores main's version of the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* docs: document the LaunchLayer provider and how to enable it

The Clusters tag and the infrastructure-providers page still said NICo
was the only provider, while the API reference and chart RBAC present
launchLayer. Both now describe it, and the page covers enabling it:
supportedInfraProviders, capi.rbac.launchLayer, and dsxImds attestation
on a SPIFFE-enabled deployment. The supportedInfraProviders comment
names launchLayer, and the chart README gains the capi.rbac.nico and
capi.rbac.launchLayer rows with the updated capi.rbac.create and
supportedInfraProviders descriptions. The controller
README gains a LaunchLayer Tilt section. The node-pool schema says "at
most one" of hostOSProfile and vmProfile, matching the validator, and
the control-plane provider is "Fixed at creation."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix: guard a nil LaunchLayer pool update and document capi.rbac.create

validateUpdateLaunchLayerNodePoolRequest dereferenced a nil update body,
which the surrounding update path treats as a no-op. The generated HTTP
handler never passes nil, but the validator now matches its callers.

The LaunchLayer RBAC renders only when capi.rbac.create and
capi.rbac.launchLayer are both true, and capi.rbac.create defaults to
false, so the enabling steps now list it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(server): close LaunchLayer validation gaps

Several LaunchLayer requests were accepted with 201 and only failed later,
inside CAPLL or at node join, where nothing reports the cause back to the
caller.

Node-pool create and a control-plane desiredCount increase now run the same
node-agent profile check as cluster create, through one shared function. A
cluster created while SPIFFE was off could otherwise gain pools or
control-plane nodes after SPIFFE was enabled with tpm or joinToken, and
every one of those nodes would fail to join.

Cluster create now rejects security groups that CAPLL's CRD would refuse:
the name pattern and length are in the schema, and the server checks that
networkType is set exactly for VIRTUALIZED groups, that names are unique,
and that a VIRTUALIZED group is not placed in a BARE_METAL VPC. Without
this, ApplyCAPIClusterResources gets 422 and the provisioning workflow
retries forever. securityGroupRefs on node pools and the control plane
must name one of the cluster's groups, and cloudProviderEnabled true is
rejected because NVKE runs no cloud controller manager to set the Node's
provider ID.

The schema now marks siteID and instanceType as required, which the server
already enforced, and corrects descriptions that claimed NVKE applies
CAPLL's vpcType default or that some fields stay mutable. No published API
tag contains a LaunchLayer schema, so this is not a breaking change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(launchlayer): register the SPIFFE controller by CRD, skip it without SPIFFE, apply in order

LaunchLayerSpiffeController was registered only while supportedInfraProviders
listed launchLayer. That list gates admission of new clusters; removing
launchLayer from it to stop new clusters also stopped the controller, so
scale-ups and replacements on existing SPIFFE clusters never got an agent
path and never joined. The controller now runs whenever the Machine and
LaunchLayerMachine CRDs are installed.

SpireAgentPath ignored node.SpiffeEnabled. With SPIFFE off and the method
left at dsxImds it still wrote a path and requeued every 30 seconds while
the organization was pending. It now supplies no path without SPIFFE.

CreateMachine built the CAPI Machine after applying the LaunchLayerMachine
and the bootstrap Secret, so a build error left both behind and was
retried, contrary to its comment. Every object is now built before the
first apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* docs: correct LaunchLayer enablement and Tilt setup

The site guide and chart docs described a LaunchLayer setup that does not
work as written.

nodeAgent.spireAttestationMethod applies to every provider's new nodes, and
NICo accepts any method, so the guide's "nico,launchLayer" example would pin
a TPM-attested NICo site's new nodes to dsxImds; they would fail only when
they attest. The guide and the supportedInfraProviders value now say so,
and tell operators to append launchLayer to the existing value rather than
replace it.

The guide also omitted settings the deployment needs: operatorTenant and
endpoint with dsxImds, the SPIRE server's dsx_imds node attestor and the
node-side agent plugin and checksum, tenantAccess.enabled (LaunchLayer
reaches the tenant API only through that Secret), and keeping
capi.rbac.launchLayer true while CAPLL's CRDs exist, now that the
LaunchLayer SPIFFE controller is registered by CRD. capi.rbac.nico=false
likewise requires the NICo controllers to be off. The "Order Matters"
section now names CAPLL and the fourth CRD-gated controller.

The controller README's LaunchLayer Tilt example set only the attestation
method, which the chart refuses to render without operatorTenant; it now
enables the dsx-imds-attestation provider, which sets everything. The
Tiltfile header lists the launchlayer provider, the capnico-crds fixture
no longer claims the chart grants NICo RBAC unconditionally, and the chart
provider assertions cover a nico,infra,launchLayer value and both RBAC
toggles.

The four LaunchLayer waivers now record controller/api/v0.0.45, the newest
published API tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* docs: describe NICo as the default provider, not the only one

The API reference, the site guide and the chart describe LaunchLayer as a
supported provider that a deployment accepts once its operator enables
it, but five other places still said NICo is the only infrastructure
provider: the preview-status limitations, the NICo provider page, the
installation plan, the supported-platforms table and the docs glossary.
They now say NICo is the default and LaunchLayer is supported once
enabled, linking to the LaunchLayer enabling section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* refactor(launchlayer): adopt the nvke.nvidia.com keys

#1713 moved NVKE's label and annotation keys into internal/keys: they are
written under nvke.nvidia.com and read under either domain. The rebase
onto it left this branch on the removed constants.

LaunchLayerSpiffeController reads host-id and the SPIRE agent path with
Value and writes the path with String(), as NicoSpiffeController does.

The reboot key had become a list on main (both domains, so CAPNICo keeps
reacting while its --reboot-annotation names the legacy key), while this
branch's RebootAnnotationProvider returned one key. It now returns
HardRebootAnnotationKeys: both domains for NICo and CAPI, which keeps
main's behaviour, and CAPLL's one fixed key for LaunchLayer. The
activity writes each key to request a reboot and drops them to clear it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* feat(launchlayer): implement TenantAPIAccess and NodeMachineIDLabel

#1684 added both capabilities to ProviderClient with CAPI and NICo
implementations, so GetProviderClient failed with "unsupported provider
type" for every LaunchLayer cluster, not only at tenant access and node
labelling.

LaunchLayer reaches the tenant API through the published tenant-access
Secret (it has no node-agent fallback), and its machine-ID label is the
physical machine ID CAPLL records, empty on virtual machines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* refactor(clients): compose every capability in ProviderClient

ProviderClient composes every settled capability, as the #1684 review
pointed out, but NodeAgentProfileValidator and SpireAgentPathProvider
were outside it. GetProviderClient now resolves both, and its test checks
every capability for CAPI, NICo and LaunchLayer.

The reboot-annotation activity and LaunchLayerSpiffeController have the
cluster in scope, so they resolve the root client instead of calling a
single factory. The API validators keep their factory calls, as main's
other validators do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* fix(launchlayer): reject vmProfile and check pool scale-up for node-agent profile

A SPIFFE-enabled LaunchLayer node attests through DSX IMDS, which
identifies bare-metal instances only. A vmProfile node got a /bm/ agent
path it could never attest to and hung. ValidateNodeAgentProfile now
takes the node pool and rejects vmProfile unless external mTLS carries
the node-agent connection without an SVID. NICo and CAPI ignore the pool.

The check runs on every path that adds nodes:
- node-pool create and cluster create (each initial pool)
- the control plane at cluster create and scale-up, through the pool
  ControlPlaneConfigNodeProvider builds from its spec
- node-pool scale-up through desiredNodeCount, which was not checked
  before
- CreateMachine, for a node created outside the API

An unknown provider in a control-plane update now gets "unsupported
cluster provider" instead of "please provide " with an empty name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* refactor(launchlayer): drop checks the API and NVKE already guarantee

buildInfraMachine re-checked instanceType, which the schema and the
node-pool and control-plane validators already require. readStatusString
checked the group and kind of infrastructure references NVKE writes
itself, on a controller that only runs for LaunchLayer clusters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

* chore: satisfy interfacebloat and wastedassign

ProviderClient has one accessor per settled capability, so it grows past
the linter's 10 as capabilities move into it; it carries a reasoned
nolint like the agent client. The provider-match switch now returns on an
unknown provider, so its empty initial values were never read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>

---------

Signed-off-by: Meet Vadaria <mvadaria@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 17:59:43 +02:00
Terry Howe 687d642ea4 feat(chart): make the controller config ConfigMap name and SPIFFE path segment values (#1758)
* feat(chart): make the controller config ConfigMap name and SPIFFE path segment values

controllerConfig.name and spiffe.servicePathSegment replace two literals, nke-controller-config and nke-service. Their defaults are unchanged, so a default render is byte-identical to before. This lets a later change move the chart defaults while an existing install pins the names it already has.

chart-identity-assertions.py renders with both pinned to other values and asserts the ConfigMap, the Deployment's mounted volume, the Reloader annotation and every default SPIFFE subject follow them.

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

* fix: address review feedback

Assert the pinned render actually contains a Deployment before checking its
config mount and Reloader annotation, so a chart that drops the Deployment
under a pinned controllerConfig.name cannot pass a zero-iteration loop.

Compare the pinned render's full ClusterRoleBinding subject set against all
five expected SPIFFE IDs instead of substring-matching the path segment. The
old spiffe:// prefix filter silently dropped a missing or non-SPIFFE subject,
and the substring test accepted a subject whose first path segment was wrong
so long as one other subject was still correct.

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

---------

Signed-off-by: Terry Howe <thowe@nvidia.com>
2026-10-19 15:33:39 +00:00