mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2414
21
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
17f1f606e0 |
feat(controller): support create-only Machine metadata (#1708)
- Add Machine labels and annotations to node pools and control-plane configuration - Persist metadata and apply it when creating Machines - Validate reserved domains with separate configurable allowlists - Add tests and documentation; validate lifecycle behavior on Tilt with mock NICo Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |
||
|
|
5c095369f5 |
refactor(controller)!: remove control-plane controller flag and node-pool control plane path (#1608)
* refactor(controller)!: remove control-plane controller flag and node-pool control plane path Control planes are always provisioned by the control-plane controller. Remove PROVISION_CONTROL_PLANE_WITH_CONTROL_PLANE_CONTROLLER, the flag-off node-pool provisioning branches, and the e2e plumbing that toggled it. Run the control-plane migration unconditionally on worker boot. Signed-off-by: Eric Staples <estaples@nvidia.com> * refactor(controller): remove unused NodePoolUpgradeConfig provider capability The control-plane reconciler no longer resolves node-pool upgrades, so the capability, its capi and nico implementations, and the factory that GetProviderClient ran on every resolve have no callers. Signed-off-by: Eric Staples <estaples@nvidia.com> * refactor(controller): count surge nodes from the in-memory control plane reconcileNodesNeedingRollout re-listed the cluster's control-plane nodes to count controller-managed ones, duplicating the list readControlPlane already loaded for the same reconcile. Signed-off-by: Eric Staples <estaples@nvidia.com> * fix(controller): guard nil controlPlaneConfig before reading desiredCount Signed-off-by: Eric Staples <estaples@nvidia.com> * docs(controller): tighten MigrateControlPlaneToController doc comment Signed-off-by: Eric Staples <estaples@nvidia.com> * fix(controller): skip clusters with no snapshot source in the migration leftover check A non-deleting cluster with no configuration_id whose only control-plane pools are deleting cannot be snapshotted, so its pooled nodes stayed pooled and tripped the fail-closed check, blocking worker startup. Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): cover MigrateControlPlaneToController against Postgres The re-parent, deprecated-generation and cleanup SQL is Postgres-only and had no coverage. The test runs it on a fresh database named by NVKE_TEST_POSTGRES_DSN and skips when that is unset. Signed-off-by: Eric Staples <estaples@nvidia.com> * fix(controller): warn for each cluster the control-plane migration skips A non-deleting cluster with pooled control-plane nodes, no configuration snapshot and no active control-plane pool has nothing to migrate from, so the leftover check skips it. Log a warning per skipped cluster with its ID, name and pooled node count so the skip is visible. MigrateControlPlaneToController now takes a logger. Signed-off-by: Eric Staples <estaples@nvidia.com> * test(controller): use the nvke name in control-plane test fixtures name-check rejects the legacy product name in new lines. Signed-off-by: Eric Staples <estaples@nvidia.com> --------- Signed-off-by: Eric Staples <estaples@nvidia.com> |
||
|
|
fadaa3483e |
feat(controller): validate node pool labels and taints, with a configurable label allowlist (#1615)
* chore: validate node labels and taints Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> * feat(controller): make the node label allowlist configurable Labels under kubernetes.io and k8s.io are rejected unless listed in nodeMetadataAllowlistedLabelKeys in nke-controller-config (chart value nodeMetadata.allowlistedLabelKeys, empty by default). Internal nke/nvke domains and the control-plane role key are always reserved, and the controller fails to start if the allowlist names them. Rejection errors name the reserved domain the key falls under. Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> * docs(controller): clarify node label allowlist Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> * fix(controller): align reserved node metadata domains and pass name-check Reserve nvke.nvidia.com, nke.nvidia.com and nke.io, dropping nvke.io. The OpenAPI descriptions now list all three and mark the nke domains as legacy. Allowlist the bare nke.io token in name-check: the controller names it only to reserve it. Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> * fix(controller): address review on node metadata validation Report the first invalid node label in sorted key order so repeated requests name the same key. Document the allowlist exclusions and startup validation in the chart values and README, and state why control-plane pools reject taints. Regenerate the embedded OpenAPI spec in server.gen.go, which was stale after the rebase, and fix a label test that the new Calico gate rejected first. Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> --------- Signed-off-by: pbikki-nv <50849668+pbikki@users.noreply.github.com> |
||
|
|
a7254929c3 |
feat(controller): per-provider OIDC discoveryURL (#1628)
Fleet-wide providers in oidc.providers could not set a discovery URL, so kube-apiserver always fetched <issuerURL>/.well-known/ openid-configuration, and an issuer the tenant API servers cannot reach at its own URL could not be used. Only the shared provider had one. Each provider now takes an optional discoveryURL, rendered as the issuer's discoveryURL in the tenant AuthenticationConfiguration and pinned with the rest of the provider on new clusters. The loader applies the checks kube-apiserver would: an absolute https URL with no credentials, query or fragment, different from issuerURL, and unique across the providers and the enabled shared provider. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
a9aa1b975d |
refactor(chart): rename nkeSystemNamespace and nkeOIDCAuth values keys, failing on the old ones (#1562)
* refactor(chart): rename nkeSystemNamespace and nkeOIDCAuth values keys, failing the render on the old ones Helm ignores an unknown values key silently, so a site still setting the old keys would fall back to chart defaults, including tenant-cluster OIDC reverting to disabled. Rename both keys to nvkeSystemNamespace and nvkeOIDCAuth, keep the old keys in values.yaml empty, and add a render guard that fails naming the replacement. Part of #1496. Closes #1550. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(chart): key the renamed-values guard off presence, not truth An explicitly supplied empty map is false in a Helm condition, so --set-json 'nkeOIDCAuth={}' slipped past the guard and rendered on the new key's defaults. Drop the empty defaults for both legacy keys so presence only ever comes from the caller, switch the guard to hasKey, and assert the empty-map case. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: rename the last nkeOIDCAuth readers the chart rename missed The site deploy path still wrote nkeOIDCAuth into the controller values, which the new guard refuses outright, and the CAPD and NICo VMs e2e preflights still read nkeOIDCAuth.enabled from the installed release, so they saw null and failed the run. Signed-off-by: Terry Howe <thowe@nvidia.com> * docs(chart): document the renamed values keys and their replacements Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
3038cf917c | feat(controller): gate new Calico clusters (#1599) | ||
|
|
8608645c97 |
fix(controller): bound node-agent readiness probes (#1328)
The node-agent readiness controller previously checked agents serially using a shared two-minute timeout. A slow agent could therefore occupy the only worker and delay readiness checks across the fleet. This change adds a configurable worker pool (default eight), a dedicated agent RPC timeout (default 30s), and jitter around the two-minute requeue interval. In addition, probe concurrency and latency metrics were added. Signed-off-by: Michael Shen <mishen@nvidia.com> |
||
|
|
668bc38a9b |
feat(cli)!: rename nkectl to nvkectl, keeping the old names for one release (#1456)
The binary, its directory, its config directory and its environment variables take the new name. For one release the previous names still work: every NVKECTL_* setting is also read under its NKECTL_* name with a deprecation warning (the NKECTL_CWE_* names of the generation before are no longer read), a config file left under nkectl/ is read and copied to nvkectl/ once, and releases publish both nvkectl-<os>-<arch> and nkectl-<os>-<arch>, to GitHub and to S3 under the existing prefix. The e2e helper package, the e2e test, the smoke and fetch scripts and the bootstrap e2e workflow follow the binary; the fetch script accepts a release that carries only the old asset name. The CLI's own documents and the two installation documents that print the download URLs change with it. Kept on purpose: the NVCR repository name until an nvkectl repository exists in the NGC org, the S3 prefix the publishing role's policy names, and the prose in the other documents. BREAKING CHANGE: the CLI is installed and invoked as nvkectl. The previous binary name, environment variable names and config directory are honoured for one release, as described above. Closes #1455 Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
97cc189dec |
feat(controller)!: mount nke-controller-config and load it at startup (#1325)
BREAKING CHANGE: The chart refuses an env entry for a setting nke-controller-config carries. Set it through its chart value instead. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
cfc32de7f4 |
feat(chart): expose oidc.providers as a chart value (#1326)
Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
7beaf77b8f | feat(chart): render the nke-controller-config ConfigMap (#1163) |