mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2414
857
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8150df8f7c |
build(deps): pin klauspost/compress 1.20.5 and brotli 1.3.0 (#2567)
Signed-off-by: Byron McAdams <bmcadams@nvidia.com> |
||
|
|
4eb5a32cec |
fix(controller): let a control-plane node that can't join be deleted (#2556)
* fix(controller): let a queued delete of a stuck control-plane node start its teardown selectControlPlaneJoin skips a node with an accepted delete unless its join is already in flight, so a node that keeps failing to join no longer blocks its own delete. Teardown of a control-plane node that reached ReadyToJoin but never joined now waits, best effort, for the agent to stop reporting a pending kubeadm join before it removes the etcd member. The wait is capped at 30 minutes, ends after 2 minutes if the agent is unreachable, and is guarded by workflow.GetVersion. Related: #2387 Signed-off-by: Carl Danley <cdanley@nvidia.com> * fix(controller): keep the kubeadm join wait inside its limits End each agent status call when the agent would count as unreachable or the wait runs out, whichever is first, so a call that hangs after a run of refusals no longer extends the 2-minute window. Use a schedule-to-close timeout for the wait activity, so a retry after a lost worker doesn't start a fresh 30-minute cap. Signed-off-by: Carl Danley <cdanley@nvidia.com> --------- Signed-off-by: Carl Danley <cdanley@nvidia.com> |
||
|
|
00d375a743 |
fix(agent): wait for kube-apiserver to reload its authentication config (#2542)
* fix(agent): wait for kube-apiserver to reload its authentication config PatchAPIServerManifest can replace the authentication configuration of a running kube-apiserver by writing only the file. kube-apiserver then reloads the file by itself: it builds the new authenticators, checks their health every 10 seconds and puts them in use once they are healthy. The agent waited only for /readyz, which answers 200 before, during and after the reload. So the call returned before the new configuration was in use. Enabling OIDC on an existing cluster takes this path. On a cluster with three control plane nodes and Kubernetes 1.36, each kube-apiserver logged "reloaded authentication config" 9.97 to 9.99 seconds after the agent wrote the file. The enablement returned 9.6 seconds before the kube-apiserver of the last node had loaded the file, and a client with a SPIRE token got "Unauthorized" from it for the next 9 seconds. The tree of that run did not have the control plane endpoint health gate yet, which drains a node before the patch. After a files-only change that writes the file that --authentication-config names, the agent now waits until the local kube-apiserver reports the hash of the written content in apiserver_authentication_config_controller_last_config_info. kube-apiserver sets that hash after it has put the new authenticators in use, so the agent compares no clocks. The wait ends after two minutes at the latest. The agent then restores the file and reports FAILED_RESTORED. When kube-apiserver counted failed reloads in that time, the message says that it rejected the file. Until now such a rejection was silent: the call reported success and kube-apiserver kept its old configuration. The agent reads the state of kube-apiserver before it writes the file. When it cannot read the metrics, or kube-apiserver does not publish the hash (Kubernetes before 1.34), it logs that and waits only for /readyz, as before. A change of the manifest is not affected: kube-apiserver restarts there and reads the file at its start. With this change, on a tree with the health gate, two runs of the same enablement: the agent waited 10.7 to 11.1 seconds on each node, the enablement returned after the last kube-apiserver had loaded the file, and a probe with a SPIRE token got no "Unauthorized" in 45 calls to each kube-apiserver. No kube-apiserver restarted. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(agent): describe the wait for the authentication config reload PatchAPIServerManifest now waits until kube-apiserver has loaded an authentication configuration that the agent rewrote without a restart. Say so where the design page describes how the call is verified. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(agent): say when the authentication config reload is not confirmed The design page said that the agent waits until kube-apiserver has loaded a rewritten authentication configuration, and that it restores the file if kube-apiserver does not. That is true only when the agent could read the loaded hash from the metrics of kube-apiserver before the write. When that read fails, also on Kubernetes 1.34 and later, the agent logs a warning and waits for /readyz alone, and the call can return OUTCOME_APPLIED before kube-apiserver has loaded the content. Say so, with the text of the warning. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): confirm the old authentication config after a restore When PatchAPIServerManifest gives up on a files-only change, it writes the old files back and waits for /readyz. If kube-apiserver had loaded a staged authentication configuration, that rollback starts another reload. The reload takes about 10 seconds, the staged authenticators stay in use until it ends, and /readyz answers 200 all the time. So the call could return OUTCOME_FAILED_RESTORED while the node was not yet back in its state from before the call. After the rollback the agent now waits until the local kube-apiserver reports again the hash that it had loaded before the write. The agent already reads that hash before it writes the file. If kube-apiserver never loaded the staged content, it still reports that hash and the wait ends with the first read. The wait has the same limit of two minutes as the wait for the staged content. When the limit passes, the call returns OUTCOME_FAILED_NOT_RESTORED, and the message says that kube-apiserver did not return to its previous authentication configuration. The wait is for the hash from before the write and not for the hash of the restored file. The two are the same when kube-apiserver had loaded the file that was on the node. The first is also right when it had not, and when the call created the file. When the agent could not read the hash before the write, the restore waits only for /readyz, as before. A files-only change can now take 440 seconds in the worst case: two minutes and 100 seconds for the change, and the same for the restore. The NVKE controller gives the call 8 minutes. One case stays open. A reload of the staged content that kube-apiserver started before the rollback can end after the call has returned. kube-apiserver then loads the restored file again by itself. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(controller): correct the worst case of the node agent call in a comment The comment on WithRolloutNodeAgentApplyOptions says that the node agent call takes about 400 seconds in the worst case. A files-only change of the authentication config now also waits for kube-apiserver to load the file, for up to two minutes after the write and for up to two minutes after a restore. Its worst case is 440 seconds: two minutes and 100 seconds for the change, and the same for the restore. The activity deadline of 8 minutes still covers that. Only the comment changes. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(controller): give the node agent call 10 minutes The activity that calls PatchAPIServerManifest had a deadline of 8 minutes, and its comment said that the call takes about 440 seconds in the worst case. That count took a readiness wait as 100 seconds. A readiness wait is up to 11 probes of /readyz of at most 3 seconds each, with 10 sleeps of 10 seconds between them: 133 seconds. A files-only change of the authentication config can take 536 seconds: up to 30 seconds for the read of the metrics before the write, 120 seconds for the reload and 133 seconds for readiness, then 120 and 133 seconds again for a restore. That is more than the 480 seconds of the deadline. A manifest change can take 466 seconds plus its reads of the mirror pod, which have no time limit of their own. Raise StartToCloseTimeout to 10 minutes. ScheduleToCloseTimeout and HeartbeatTimeout stay as they are. Correct the numbers in the comment of the activity options, and in the comment of the reload limit in the agent. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): accept the restored file after a rollback After a rollback of the authentication config, the agent waited until kube-apiserver reported the hash that it had loaded before the write. That hash is not always the hash of the file on the node. When kube-apiserver had another config loaded than that file, and then loaded the staged content, the rollback writes the file of the node back and kube-apiserver loads it. The hash from before the write does not come back. The wait ran to its limit of two minutes, and the call reported OUTCOME_FAILED_NOT_RESTORED for a node that no longer used the staged content. The wait now also ends with success when kube-apiserver reports the hash of the file that the rollback wrote back. The agent computes that hash before the write, from the content that the write replaces, in the same way as the hash of the staged content. When the call created the file, the rollback removes it, and only the hash from before the write counts, as before. The design page now names the two hashes that the wait accepts. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
47170e87f6 |
fix(kubeadmconfig): pass CIS 4.2.12 on the kubelet (#2552)
kube-bench's CIS 4.2.12 check compares the kubelet's tlsCipherSuites with an allowlist that spells the two ChaCha20 suites without their _SHA256 suffix. Every node therefore warned on suites the check means to allow, and the exception register carried an entry for it. Name the two suites the way the check does. The kubelet parses its configured list with k8s.io/component-base/cli/flag, which maps both spellings to the same suite, so it accepts exactly the suites it did. A new test parses the list that way to hold that, and checks the names against kube-bench v0.17.0's 4.2.12 allowlist. The API server's list keeps the _SHA256 names, which its own check, 1.2.29, accepts. With every node passing, the 4.2.12 register entry goes. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
28a8010cab |
chore(os-image): drop Kubernetes 1.34.2 after staging 1.37 (#2276)
Signed-off-by: Payal Patel <payapatel@nvidia.com> |
||
|
|
1a46559dd6 |
docs: say which published NVKE artifacts are private (#2531)
Signed-off-by: Nathan Hensley <nhensley@nvidia.com> |
||
|
|
ed0282a944 |
test(e2e): scan with kube-bench v0.17.0 and cis-2.0 (#2562)
kube-bench v0.17.0 ships cis-2.0, its configuration for the CIS Kubernetes Benchmark 2.0. Pin the release by its multi-arch index digest and select cis-2.0. Like the release before it, v0.17.0 maps Kubernetes versions only up to 1.35, so the scan keeps naming the benchmark. cis-2.0's checks are the ones the scans already ran: the same 131 check IDs, titles, audits and tests, with only remediation text changed. CIS 2.0.0 edited recommendations without adding, removing or renumbering any, so the register keeps its entries; the 4.2.12 reason now names cis-2.0, whose cipher allowlist is unchanged. kube-bench's job.yaml changed only its image tag, so the scan pods mount the same host paths. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
7042b30115 |
feat(e2e): perf tenant with 3 control planes, 2 monitoring, 50 workers (#2524)
## Summary
Each perf stream run now builds a tenant with three control-plane nodes, two monitoring nodes and 50 workers, up from one, one and three. A stream picks its control-plane count with a new parameter, and on Forge the site gives those nodes one shared address. Tenant waits grow with the node count, and the perf stream's time limit goes from 260 to 400 minutes. A stream that leaves the parameter unset keeps one control-plane node, so every other stream keeps its shape and its limits.
## Motivation / Context
Every perf run today measures a tenant with a single control-plane node, so no perf run covers a highly available tenant, where several control-plane nodes share one address. That address is the control-plane VIP, and the suite's Forge path never sent one.
kaps-bench also sizes its load from the worker count: cluster-density-v2 runs nine iterations per worker, so three workers give it 27 iterations and 50 give it 450.
Closes: N/A
Related: https://github.com/dsx-ai-factory/nvke/issues/2089
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Build/CI/tooling
## Component(s) Affected
- [ ] Controller (`controller/`)
- [ ] REST API (`controller/api/openapi.yaml`)
- [ ] Node agent or updater (`agent/`)
- [ ] gRPC API (`agent/pkg/agent/proto/`)
- [ ] nvkectl CLI (`cli/`)
- [ ] Cluster API provider (`cluster-api-provider-provisioned/`)
- [ ] Helm charts or deployment (`controller/deploy/`)
- [ ] NVKE telemetry pipeline (NKTP) integration (`deploy/nico/nktp/`)
- [ ] nico-sim (`controller/nico-sim/`)
- [ ] OS image or image checker (`os-image/`)
- [x] CI / workflows (`.github/`)
- [x] Docs / examples
- [x] Other: the e2e suite (`controller/test/e2e/`), the release planner and the release policy (`release/`)
## Implementation Notes
### Control-plane count and VIP
- `tenantControlPlaneNodes` joins `tenantWorkers` and `monitoringWorkers` in the stream parameters (`release/pkg/qualification/policy.go`). A negative value fails validation, and zero or unset means one.
- `release/hack/qualify-e2e.sh` carries it to the suite as `-e2e.tenant-control-plane-nodes`, the same way `monitoringWorkers` travels, and the qualify summary prints it.
- `forge-perf.yaml` reads the site's `controlPlaneVIP` from `FORGE_PERF_CONTROL_PLANE_VIP`, empty for none, and `qualify-e2e.yml` passes that variable from the GitHub environment and lists it and the count in its resolved-inputs table.
- On Forge the tenant gets the requested count, and the site VIP only when it has more than one control-plane node. An entry that names its own VIP keeps it. A full-stage run that asks for more than one control-plane node with no VIP stops before any machine is taken, and so does a count below one. Its capacity check counts every control-plane node.
- Only the Forge tenant applies the count. A full-stage run on another provider that asks for more than one control-plane node stops before any machine is taken.
### Perf stream shape
- `release/policy.yaml`: the perf stream sets `tenantControlPlaneNodes: 3`, `monitoringWorkers: 2` and `tenantWorkers: 50`. Its `suiteTimeoutMinutes` goes from 260 to 400.
- `tenantProvisionTimeout` gives 45 minutes up to ten tenant nodes and one more minute for each node above that, so 55 nodes get 90. Two waits use it, the tenant create wait and the readiness check, so neither cuts the other short. Each goes from 45 to 90 minutes for this stream.
- `tenantProvisionTimeout` is computed when the spec tree is built, after flags are parsed, so the nico-forge lane and the qualify site lane both get it. Simulator lanes keep their own create budgets, and their readiness timeout stays 45 minutes at default flags.
- Why 400 minutes: take a site build and checks of about 34 minutes (about 30 on our az41 run), then let the two waits, kaps-bench and the delete each use their full limit: 90 and 90, 75, and 75. With about 25 minutes of site cleanup that is 389. With a shorter limit the suite deadline could fire during the delete and leave machines allocated.
- kaps-bench keeps its time window per run spec. cluster-density-v2 has not run at 450 iterations yet, so the first full-size run shows whether its 30 minutes are enough.
- One policy test now expects two monitoring nodes on the perf stream. Both READMEs (e2e and release) and the two qualification docs describe the parameter, the VIP variable and the new tenant.
## Testing
Run on this branch (base
|
||
|
|
643e5eb773 |
feat(os-image): restore optional verified IMDS agent packaging (#2419)
Signed-off-by: Nathan Hensley <nhensley@nvidia.com> |
||
|
|
9b8b884bae |
build: bump the go-dependencies group across 1 directory with 6 updates (#2541)
* build: bump the go-dependencies group across 1 directory with 6 updates Bumps the go-dependencies group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/spiffe/go-spiffe/v2](https://github.com/spiffe/go-spiffe) | `2.9.0` | `2.10.0` | | [github.com/cedar-policy/cedar-go](https://github.com/cedar-policy/cedar-go) | `1.9.3` | `1.9.4` | | [github.com/gravitational/trace](https://github.com/gravitational/trace) | `1.5.4` | `1.6.0` | | [go.temporal.io/sdk](https://github.com/temporalio/sdk-go) | `1.51.0` | `1.52.0` | | [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.71.0` | `1.71.1` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.316.0` | `0.317.0` | Updates `github.com/spiffe/go-spiffe/v2` from 2.9.0 to 2.10.0 - [Release notes](https://github.com/spiffe/go-spiffe/releases) - [Changelog](https://github.com/spiffe/go-spiffe/blob/main/CHANGELOG.md) - [Commits](https://github.com/spiffe/go-spiffe/compare/v2.9.0...v2.10.0) Updates `github.com/cedar-policy/cedar-go` from 1.9.3 to 1.9.4 - [Release notes](https://github.com/cedar-policy/cedar-go/releases) - [Commits](https://github.com/cedar-policy/cedar-go/compare/v1.9.3...v1.9.4) Updates `github.com/gravitational/trace` from 1.5.4 to 1.6.0 - [Release notes](https://github.com/gravitational/trace/releases) - [Commits](https://github.com/gravitational/trace/compare/v1.5.4...v1.6.0) Updates `go.temporal.io/sdk` from 1.51.0 to 1.52.0 - [Release notes](https://github.com/temporalio/sdk-go/releases) - [Changelog](https://github.com/temporalio/sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/temporalio/sdk-go/compare/v1.51.0...v1.52.0) Updates `cloud.google.com/go/storage` from 1.71.0 to 1.71.1 - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/compute/v1.71.0...storage/v1.71.1) Updates `google.golang.org/api` from 0.316.0 to 0.317.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.316.0...v0.317.0) --- updated-dependencies: - dependency-name: github.com/spiffe/go-spiffe/v2 dependency-version: 2.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/cedar-policy/cedar-go dependency-version: 1.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/gravitational/trace dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.temporal.io/sdk dependency-version: 1.52.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: cloud.google.com/go/storage dependency-version: 1.71.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: google.golang.org/api dependency-version: 0.317.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): hold gravitational/trace at v1.5.4 and regenerate notices trace v1.6.0 removed TraceErr.Traces, which the pinned teleport/api still uses, breaking every controller build. Also refresh go.work.sum and THIRD_PARTY_NOTICES.md for the remaining bumps. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Terry Howe <thowe@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terry Howe <thowe@nvidia.com> |
||
|
|
3fe591ee78 |
test(controller): refresh the CAPNICo CRD fixture for v0.2.0 (#2539)
Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
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> |
||
|
|
bf25577b9f |
feat(controller): accept controlPlaneEndpoint on cluster create (#2515)
* refactor(controller): ask one cluster method at each control-plane endpoint gate Each gate that scales, upgrades or replaces control-plane nodes tested the control-plane VIP for an empty string by itself. The gates now call db.Cluster.HasStableControlPlaneEndpoint, which is true when the cluster has a VIP. The gates are the count check at create and scale, the upgrade and rollout checks of the cluster API, the node delete guard, the control-plane controller (recycling, remediation, rebalance, stuck pending nodes) and the node pool controller (surge, NodeSet replacement). No behavior changes. A later change adds a second kind of stable endpoint to the method. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): add controlPlaneEndpoint to the cluster API schema A cluster can name an API server endpoint that NVKE does not manage, for example a load balancer in front of the API servers. The create request gets the optional object controlPlaneEndpoint. Its type says who manages the endpoint, and the block named after the type carries what that type needs. This change has one type, External, with a host and an optional port in the external block. The port defaults to 6443. The cluster response returns the type and the resolved host and port. The update request has no such property, so the value is fixed at creation. The shape is the one of the proposal for a load balancer as the control plane endpoint, and this change is its first part. The enum of the type has only External. The other types of the proposal come later. A new enum value passes the API compatibility check, and a removed one does not, so the enum lists only what the code does. The existing descriptions change only where the new field makes them wrong or incomplete: - The overview of the Clusters tag and the description of controlPlaneVIP say which address is the API server endpoint. - Seven sentences that say an operation requires controlPlaneVIP now name both fields. Each is one changed line. - The 400 list of the create operation gets the new reasons. - The desiredNodeCount descriptions of the two node pool requests lose their sentence about control-plane pools. The node pool handlers refuse each create and each update of a control-plane node pool, so no request reaches a rule on that count. This change is only api/openapi.yaml and the code that make generate writes from it (models.gen.go, server.gen.go). The handler does not read the field yet. The next changes store it, check it and use it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): store controlPlaneEndpoint in the clusters table The clusters table gets three nullable columns for the API server endpoint that a cluster was created with: control_plane_endpoint_type, control_plane_endpoint_host and control_plane_endpoint_port. db.Cluster gets the fields ControlPlaneEndpointType, ControlPlaneEndpointHost and ControlPlaneEndpointPort. The type says who manages the endpoint. The one type is External, an endpoint that NVKE does not manage. The host and the port are the resolved endpoint. A cluster without the field stores NULL in the three columns, which is what each existing row has after the migration. An empty type marks such a row. control_plane_vip does not change. No handler writes the fields yet and no workflow reads them. The test proves that the values come back from a read and stay in the row through an update of the cluster. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): count controlPlaneEndpoint as a stable endpoint at each gate db.Cluster.HasStableControlPlaneEndpoint is now true for a cluster with an endpoint of the type External, as it is for one with a VIP. Each gate that scales, upgrades or replaces control-plane nodes asks this method, so the one line opens them all: scale-up, upgrade and rollout in the cluster API, node delete, recycling, remediation, rebalance, stuck pending nodes, surge and NodeSet replacement. The method reads the stored type and not the host. An empty type is a cluster without the field, and a type that this controller does not know is no stable endpoint. The tests run each gate with such a cluster. Recycling, remediation, rebalance and stuck pending nodes share one check, controlPlaneReplacementBlocked, which gets its own test. The 400 messages and the log warnings of the gates keep their text. Each of them is given only for a cluster with no VIP and no controlPlaneEndpoint. allowControlPlaneWithoutVIP keeps its meaning and its default. No cluster has the field yet, because the create request does not store it. A later change adds that, with the count check at create. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): check controlPlaneEndpoint on cluster create The create request is now rejected with 400 when it has both controlPlaneEndpoint and controlPlaneVIP, when the type is not External, when the type External has no external block, and when the host or the port is not valid. The host is a DNS name or an IPv4 address. A DNS name is lowercase, has at most 253 characters, no trailing dot and no wildcard. An IPv4 address must be unicast, not loopback and not link-local, and outside the pod and service CIDRs. The port is a number from 1 to 65535, and 6443 when the request has none. A host of only digits and dots must be a valid IPv4 address, so that a mistyped address does not pass as a DNS name and skip the address rules. A DNS name is not checked against the CIDRs, because NVKE cannot tell which addresses it resolves to. The host is not trimmed. NVKE does not resolve or dial the endpoint. The CIDR rule of controlPlaneVIP moves into a helper that both fields use. Its messages keep their text, and the checks of controlPlaneVIP do not change. The checks come before the change that stores the value, so that no commit stores a value without them. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): use controlPlaneEndpoint for kubeadm init kubeadm init now takes its controlPlaneEndpoint from one function, kubeadmControlPlaneEndpoint. For a cluster with an external endpoint the value is host:port. Without one it is the kube-vip VIP, then the IP of the initializing node, as before. The value goes into the ClusterConfiguration and into the request to the node agent, as before. NVKE also names the host of an external endpoint in apiServer.certSANs of the ClusterConfiguration. kubeadm adds the host of its controlPlaneEndpoint to the API server certificate by itself. The explicit entry keeps certificate renewal and control-plane joins correct if that default changes. A cluster without an external endpoint gets no certSANs entry, so its configuration does not change. The step fails for a cluster row with an endpoint type that this controller does not know, and for an external endpoint with no host or no port. The address goes into each certificate and each kubeconfig of the cluster, so the step does not guess. The kube-vip step needs no change and gets no check for the new field. It returns with no action for a cluster without a VIP, and a cluster with a controlPlaneEndpoint has no VIP: the create request refuses the two fields together, and no other request writes either of them to the cluster row. One test keeps this true: for such a cluster the step makes no kube-vip call and runs no script on the node. Each later step reads the endpoint back from what kubeadm wrote: the join string, admin.conf and the Cluster API endpoint. They need no change. No cluster has the field yet. The next change makes the create request store it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(controller): accept controlPlaneEndpoint on cluster create The create request now stores controlPlaneEndpoint in the cluster row: the type, the host and the resolved port, which is 6443 when the request names none. The cluster response returns the type and the resolved host and port. The response leaves the field out when the cluster has none. The count check at create asks HasStableControlPlaneEndpoint of the fields that the request would store. So a request with an external endpoint can ask for more than one control-plane node, as one with a VIP can. The tests go through the service and through the HTTP handler with the OpenAPI validator: at each level requests that are accepted and requests that are refused, then the bounds that only the schema checks, and a PATCH with the field, which the schema refuses. One test checks the JSON form of the field in the response. The full table of refused values is in the test of the check itself. This change comes after each part that reads the value, so that no cluster can have the field before kubeadm init uses it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: describe controlPlaneEndpoint for workload clusters The pages that state the VIP rule now name controlPlaneEndpoint as the second way to give a cluster a stable API address: the cluster spec table and the count rule in the create guide, the API address in the two access pages, the upgrade rule in the supported platforms, and the installation plan. The create guide shows the object with the type External, its host and its port, and says what the response returns. It says what the endpoint must do before the request, and that NVKE does not resolve or call the endpoint when it accepts the request. The access page says that NVKE does not take a node out of the endpoint before it restarts the API server or etcd there, so the health check of the endpoint must do it. The pages come after the change that stores the value, so that each sentence is true when it is added. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(controller): reject a DNS label over 63 characters in controlPlaneEndpoint The host check of an external control plane endpoint used IsDNS1123Subdomain, which checks the whole length and the form of a DNS name and not the length of each label. So a name with a label of 64 characters passed the check, and DNS has no such name. The check now also rejects a label of more than 63 characters. The text of the field in the spec says so, and the generated code follows it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs: say that an endpoint health check acts after the failure The access page said that the endpoint must stop traffic to a node through its own health check. A health check sees a failure only after it happens, so a call can fail between the restart of the API server or of etcd and that check. The page says so now. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
ce02d7290b |
fix(deps): bump github.com/google/cel-go to v0.30.0 (#2533)
v0.29.2 is affected by GO-2026-6094 (JSON private fields exposed via NativeTypes and ParseStructTag in cel-go/ext), fixed in v0.30.0. govulncheck reports the package as imported but not called (code scanning alert 1181); bump to clear it. Bumped in controller, controller/k8s-apis and management-engine; make work-sync updated cli/go.sum. Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
4f76e810d7 | test(e2e): report a CIS scan after the GPU runtime install (#2438) | ||
|
|
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>
|
||
|
|
2e7cfb59c0 |
docs(controller): document and pin that custom CIDRs require an explicit CNI plugin (#2526)
* test: pin that an empty CNI plugin has no default version Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> * fix(controller): accept custom CIDRs when the CNI plugin is omitted An omitted cniPlugin is stored as ovn-kubernetes, but the CIDR check saw the raw empty value and required ovn-kubernetes by name. Check the effective plugin instead. Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> * docs(controller): document that custom CIDRs require an explicit CNI plugin Revert the effective-plugin check so an omitted cniPlugin keeps being refused custom CIDRs, state the rule in the OpenAPI descriptions, and pin it with a handler row for each side. Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> * fix(management-engine): tidy go.mod for cedar-go v1.9.3 Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> --------- Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> |
||
|
|
f91b3e1b24 |
feat(agent): add a control plane endpoint health gate (#2514)
* feat(agent): add a control plane endpoint health gate The agent can take a control plane node out of the cluster endpoint before an operation, but only when the node runs kube-vip. A node behind a load balancer that it does not run has no kube-vip, so the withdrawal did nothing there. Connections through the load balancer stayed on the node while its API server or its etcd restarted, and worker kubelets on those connections went NotReady. Add a second way to withdraw a node, a health gate. The gate is a file, and the health check of the load balancer has to fail while the file exists. NodeAgentServer.ControlPlaneEndpointGate configures it. The zero value means no gate, and the agent then behaves as before. No flag sets the field yet. withdrawKubeVipLocked closes the gate first. It reads the IPv4 address of the backend interface, writes the gate file, waits the settle time, closes the established sockets of remote clients on that address and port 6443 with the existing ss -K code, and runs the existing quiet window check on that address. A failed check fails the withdrawal. restoreKubeVipLocked opens the gate after kube-vip is back. So StartKubeVipRestore opens the gate, and the etcd defragmentation gets the gate through the two calls that it already makes. A node with kube-vip and a gate leaves both, and returns to both. The gate file names the park directory of the flow that closed it. The directory decides who opens the gate, as it decides who restores a parked manifest. A caller's restore opens each gate. The etcd defragmentation opens only a gate that it closed, and it leaves a gate that a caller closed as it is. The backend interface must have one global IPv4 address. IPv6 is not handled, as for kube-vip. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(agent): open or hand off a gate that an etcd defrag left closed The etcd defragmentation closes the control plane endpoint gate and opens it in the same call. Two cases left the gate closed with nobody to open it. The agent can stop in the middle of a defragmentation. The repair of stale state at startup now opens a gate that names the park directory of the defragmentation, after it has put the parked manifests back. A gate that a caller closed names another directory and stays closed. The defragmentation can leave the node out of service on purpose, when etcd does not come back healthy. It then hands the parked manifests to the caller. It now hands the gate over with them, so the next start of the agent does not open the gate, and StartKubeVipRestore does. The tests of the defragmentation with a gate are in this commit, because one of their cases is the hand-off. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(agent): add the control plane endpoint gate flags Three flags configure the control plane endpoint gate: --control-plane-endpoint-gate-file path of the gate file --control-plane-endpoint-backend-interface interface on which the connections of the load balancer arrive --control-plane-endpoint-gate-settle settle time, default 10s With no gate file the agent has no gate. The agent does not start with a gate file and no backend interface, with a backend interface and no gate file, with a relative gate file path, or with a negative settle time. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(agent): describe the control plane endpoint gate The agent README lists the three flags, and says what the deployment has to provide and who opens a closed gate. Two pages were wrong with the gate. The agent design page said that the graceful shutdown and StartKubeVipRestore handle only kube-vip. The certificate renewal page said that a node without kube-vip skips the drain. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * feat(agent): close the control plane endpoint gate around kubeadm upgrade apply KubeadmUpgradeApply runs kubeadm upgrade apply, which restarts etcd and the API server of the node. The control plane endpoint gate did not cover this call. The load balancer took the node out only after its health check had failed, and in that time it still sent calls to an API server that could not answer them. With a gate, the call now takes the node out of the load balancer after kubeadm upgrade plan and before kubeadm upgrade apply, in the way the graceful shutdown does it. It opens the gate when kubeadm returns, also when kubeadm fails. A node that cannot leave the load balancer does not start the apply, and the call fails. The call parks no manifest, so the gate file names the call and not a park directory. A gate with that name is one that the agent opens, as it opens a gate of the etcd defragmentation. The repair of stale state at startup therefore opens it too, when the agent stopped in the middle of the call. The gate stays open on a cluster with one control plane node, which the agent reads as one voting member of etcd. kubeadm reaches the cluster through the load balancer, so with the only node out of it the apply would fail. The gate also stays open when the members cannot be listed. The call holds the lock of the static pod changes from the close to the open. A second call, which a caller sends when the first one takes too long, then waits and does not open the gate under the first. The call has no operation record, so it logs its gate steps as the repair at startup does. The log line of those steps no longer names the repair: it is now "control plane step outside an operation". With no gate file the call runs the same two commands as before and nothing else. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(agent): describe the gate of kubeadm upgrade apply The agent README says when KubeadmUpgradeApply closes and opens the control plane endpoint gate, that the call does not withdraw kube-vip, and why the gate stays open on a cluster with one control plane node. The list of gate file contents has the name that this call writes. The README also says that the other calls that restart the API server do not touch the gate, and that their caller closes and opens it. The agent design page names the call next to the graceful shutdown. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): reject a directory as the control plane endpoint gate file The agent accepted a gate file path that is an existing directory. It started, and each later withdrawal failed: the agent renames the gate file into place, and a rename cannot replace a directory. An operation of the agent that reads the gate first failed at the read. The check of the gate flags now rejects such a path at startup, like the other gate settings that cannot work. A path with no file is still accepted. No file is the open gate, so the file is absent at each normal start. The test of the gate flags has a case for an existing directory and a case for an absent file in an existing directory. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): stage the control plane endpoint gate file under a private name The agent staged the gate file at the gate path plus ".tmp" and wrote it with os.WriteFile, which follows a symbolic link. The agent runs as root. A user who can write to the folder of the gate could leave a link at that name. The agent then wrote the owner of the gate into the file that the link names, and the rename put the link at the gate path. The gate file now goes through atomicWriteFile, as the other files of this package that are renamed into place. That helper creates the staged file itself, with a name that nobody knows before, writes through the open file and removes it when a step fails. The rename replaces a link at the gate path and does not follow it. The gate no longer uses the FileWriter of the server. The tests fail the write through a function of the server that stands in for the helper. Startup does not refuse a folder that another user can write to. The folder often does not exist before the first close, and its mode does not say enough on a node image that has the folder on a mounted volume. The README now names such a folder as a thing the deployment has to provide. A new test puts a link at the old staging name and at the gate path. It checks that the file behind the link is unchanged and that the gate file is a regular file with mode 0644. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): keep parked manifests with the gate when its hand-off fails A defragmentation that gives up on its etcd member hands the gate and the parked manifests to the caller. The hand-off recorded a failure of the gate and still moved the manifests. The gate file then named the defragmentation, and the caller held the manifests. At its next start the agent opened that gate, because the gate file named a flow of the agent, while kube-apiserver was still parked for the caller. The hand-off now does the gate first and stops when the gate fails. No manifest moves. The gate and the manifests all stay with the defragmentation, and the defragmentation reports the failure as before. At its next start the agent puts the manifests back and then opens the gate, as it does for a defragmentation that was interrupted. A new test runs a defragmentation whose member does not return and whose gate file cannot be written again. It checks that the gate and kube-apiserver stay with the defragmentation, and that the next start puts kube-apiserver back and opens the gate. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): list the etcd members of kubeadm upgrade apply under the lock With a gate, KubeadmUpgradeApply listed the members of etcd before it took the lock of the static pod changes. When the list failed, it ran kubeadm upgrade apply with no lock. The apply of a first call restarts the local etcd. A second call, which a caller sends when the first one takes too long, could then fail its list and run a second kubeadm upgrade apply next to the first. The call now takes the lock before it lists the members. A second call waits for the first, and lists the members when the first apply is over. The apply on a cluster with one control plane node and the apply with members that cannot be listed still leave the gate open, and they now run under the lock too. With no gate file the call takes no lock, as before. The helpers that run under the lock do not take it themselves, and the defragmentation already lists the members under the same lock. A new test holds a first call in its apply, fails the member list and sends a second call. It checks that the second apply does not start while the first one runs. The cases for one control plane node and for a failed member list now expect the lock during the apply. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * docs(agent): say what kubeadm upgrade apply does with a gate that exists The agent README and the agent design page said that KubeadmUpgradeApply removes the gate file when kubeadm returns, and that the gate stays open with one control plane node or with members that cannot be listed. Both say more than the code does. The call removes only a gate file that it wrote. A gate that a caller closed stays closed until the caller opens it with StartKubeVipRestore, and the call then closes no connection. With one voting member of etcd, or with members that it cannot list, the call does not use the gate. It creates no gate file and leaves one that exists as it is. The two pages now say this. The cases of the upgrade test for a gate of a caller, for one control plane node and for a failed member list show the same behavior. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(agent): reject a gate file path that names a directory by its form Startup refused a gate file that is an existing directory. A path that ends with a separator, or whose last element is "." or "..", passed that check while nothing existed there. At the first close of the gate the agent creates the folder of the gate file, which for such a path is the gate path itself. The rename of the staged file then fails, and a directory stays at the gate path. Startup now refuses such a path with the same message. A path of an absent file with no such ending still passes. Three new cases of TestControlPlaneEndpointGateFlags have a path that ends with a separator, with "/." and with "/..". They fail without the new check. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
912b6f1cd8 |
test: pin how the agent and controller handle each CNI plugin (#2469)
The CNI plugin a cluster is created with decides who installs the CNI, which packages a node boots with, and whether kubeadm installs kube-proxy. Most of that was untested, so these tests pin what it does today. Nothing in production code changes, and all of them pass on main. - agent: kubeadm init installs a CNI only when neither no_cni_install nor the deprecated skip_cni_plugin_install is set, and reports no CNI status when it skips. - db: the plugin and version defaults, and the plugins the API accepts. - activities: KubeadmInit sends no_cni_install only when the CNI is installed afterwards, sends the legacy CNI fields and registry for OVN-Kubernetes and Calico, skips kube-proxy for OVN-Kubernetes only, and refuses a plugin it does not know. - workflow: the real CNIInstallMode decides whether InstallCNI runs, and a plugin with no post-init install never reaches it. - user-data: every template the repository ships renders for each plugin and names only that plugin's packages, a template that guards its CNI install installs only for the enabled plugin, and an unknown plugin is refused. - server: a cluster is stored with the plugin and version it was asked for, with ovn-kubernetes and the plugin's default filling what is omitted. Each test was checked by breaking the behaviour it pins and confirming it fails. Signed-off-by: Jyoti Mahapatra <jyotim@nvidia.com> |
||
|
|
0e5a9f1182 |
build(deps): bump ARG-pinned base image digests (#2426)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
50dca8f8ee |
fix(nico-sim): wait for systemd before simulated cloud-init commands (#2511)
* fix(nico-sim): wait for systemd before simulated cloud-init commands The container backend started the runcmd commands of the cloud-init data right after docker start. docker start returns before systemd in the node container is up. A systemctl call in runcmd then failed with "Failed to connect to system scope bus via local transport", the runner wrote error to the status file, and nothing runs the commands again. NVKE adds a systemctl restart of the agent unit as the last command of every node, so NodePreflight failed on check_cloud_init_status without end. In a test on a fast host, systemd was not up when the commands started in three of four starts. A real node cannot lose it, because cloud-init runs runcmd from a systemd unit. Wait for the control socket of systemd, /run/systemd/private, before the runner starts. systemctl run as root connects to that socket. The limit is 60 seconds. When it passes, the create fails with an error that names the container and the socket, the container is removed as for each other failed create, and the caller can create the instance again. A docker exec that fails ends the wait at once. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(nico-sim): read the systemd probe answer from stdout only The wait for systemd runs a probe in the node container and compares the output with the text "ready". The probe went through runDocker, which returns stdout and stderr as one text. A warning on stderr from Docker or from the exec then made the output differ from "ready" on each check. The wait ended at its limit and the create failed for a container whose systemd was up. Add runDockerStdout next to runDocker. It returns only what the command wrote to stdout. When the command fails, its error holds what the command wrote to stderr, so the cause of a failed probe stays in the error. The probe now uses it. runDocker keeps the combined output, so each other caller gets what it got before. Both helpers build their error in the new dockerError, which holds the lines that were in runDocker. The error of a failed probe no longer has the words "exec in container", because the Docker command line after them says the same. A new case of TestUnit_ApplyCloudConfig_WaitsForSystemd has the fake Docker print "ready" on stdout and a warning on stderr. It failed with the timeout error before this change and passes now. The case for a failed check now also requires the stderr text in the error. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * refactor(nico-sim): state the reason of the systemd wait one time The reason of the wait was in four places: a comment at the call, the doc comment of waitForSystemd, a paragraph of the README and the header of the test. The doc comment now has it. Step 3 of the cloud-init list in the README has the wait and what occurs at a timeout, and the paragraph after the list is removed. The time between two probes is now the constant systemdReadyInterval, next to statusUpdateTimeout. No test needs a different value, so the Service field of that name is removed. systemdReadyTimeout is the one value that tests set. The simulator behaves as before. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
03307407a0 |
build: bump the go-dependencies group across 6 directories with 8 updates (#2445)
* build: bump the go-dependencies group across 6 directories with 8 updates Bumps the go-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [go.etcd.io/etcd/api/v3](https://github.com/etcd-io/etcd) | `3.7.3` | `3.7.4` | | [go.etcd.io/etcd/client/v3](https://github.com/etcd-io/etcd) | `3.7.3` | `3.7.4` | | [github.com/cedar-policy/cedar-go](https://github.com/cedar-policy/cedar-go) | `1.9.2` | `1.9.3` | | [github.com/dsx-ai-factory/cluster-api-provider-nico](https://github.com/dsx-ai-factory/cluster-api-provider-nico) | `0.1.0` | `0.2.0` | | [go.temporal.io/sdk/contrib/opentelemetry](https://github.com/temporalio/sdk-go) | `0.8.1` | `0.9.0` | | [golang.org/x/tools](https://github.com/golang/tools) | `0.52.0` | `0.53.0` | | [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.70.0` | `1.71.0` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.315.0` | `0.316.0` | Bumps the go-dependencies group with 2 updates in the /agent directory: [go.etcd.io/etcd/api/v3](https://github.com/etcd-io/etcd) and [go.etcd.io/etcd/client/v3](https://github.com/etcd-io/etcd). Bumps the go-dependencies group with 1 update in the /auth directory: [github.com/cedar-policy/cedar-go](https://github.com/cedar-policy/cedar-go). Bumps the go-dependencies group with 2 updates in the /controller directory: [github.com/dsx-ai-factory/cluster-api-provider-nico](https://github.com/dsx-ai-factory/cluster-api-provider-nico) and [go.temporal.io/sdk/contrib/opentelemetry](https://github.com/temporalio/sdk-go). Bumps the go-dependencies group with 2 updates in the /management-engine directory: [github.com/dsx-ai-factory/cluster-api-provider-nico](https://github.com/dsx-ai-factory/cluster-api-provider-nico) and [golang.org/x/tools](https://github.com/golang/tools). Bumps the go-dependencies group with 2 updates in the /release directory: [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) and [google.golang.org/api](https://github.com/googleapis/google-api-go-client). Updates `go.etcd.io/etcd/api/v3` from 3.7.3 to 3.7.4 - [Release notes](https://github.com/etcd-io/etcd/releases) - [Commits](https://github.com/etcd-io/etcd/compare/v3.7.3...v3.7.4) Updates `go.etcd.io/etcd/client/v3` from 3.7.3 to 3.7.4 - [Release notes](https://github.com/etcd-io/etcd/releases) - [Commits](https://github.com/etcd-io/etcd/compare/v3.7.3...v3.7.4) Updates `github.com/cedar-policy/cedar-go` from 1.9.2 to 1.9.3 - [Release notes](https://github.com/cedar-policy/cedar-go/releases) - [Commits](https://github.com/cedar-policy/cedar-go/compare/v1.9.2...v1.9.3) Updates `github.com/dsx-ai-factory/cluster-api-provider-nico` from 0.1.0 to 0.2.0 - [Release notes](https://github.com/dsx-ai-factory/cluster-api-provider-nico/releases) - [Changelog](https://github.com/dsx-ai-factory/cluster-api-provider-nico/blob/main/CHANGELOG.md) - [Commits](https://github.com/dsx-ai-factory/cluster-api-provider-nico/compare/v0.1.0...v0.2.0) Updates `go.temporal.io/sdk/contrib/opentelemetry` from 0.8.1 to 0.9.0 - [Release notes](https://github.com/temporalio/sdk-go/releases) - [Changelog](https://github.com/temporalio/sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/temporalio/sdk-go/compare/contrib/opentelemetry/v0.8.1...contrib/opentelemetry/v0.9.0) Updates `golang.org/x/tools` from 0.52.0 to 0.53.0 - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.52.0...v0.53.0) Updates `cloud.google.com/go/storage` from 1.70.0 to 1.71.0 - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/compute/v1.70.0...compute/v1.71.0) Updates `google.golang.org/api` from 0.315.0 to 0.316.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.315.0...v0.316.0) Updates `go.etcd.io/etcd/api/v3` from 3.7.3 to 3.7.4 - [Release notes](https://github.com/etcd-io/etcd/releases) - [Commits](https://github.com/etcd-io/etcd/compare/v3.7.3...v3.7.4) Updates `go.etcd.io/etcd/client/v3` from 3.7.3 to 3.7.4 - [Release notes](https://github.com/etcd-io/etcd/releases) - [Commits](https://github.com/etcd-io/etcd/compare/v3.7.3...v3.7.4) Updates `github.com/cedar-policy/cedar-go` from 1.9.2 to 1.9.3 - [Release notes](https://github.com/cedar-policy/cedar-go/releases) - [Commits](https://github.com/cedar-policy/cedar-go/compare/v1.9.2...v1.9.3) Updates `github.com/dsx-ai-factory/cluster-api-provider-nico` from 0.1.0 to 0.2.0 - [Release notes](https://github.com/dsx-ai-factory/cluster-api-provider-nico/releases) - [Changelog](https://github.com/dsx-ai-factory/cluster-api-provider-nico/blob/main/CHANGELOG.md) - [Commits](https://github.com/dsx-ai-factory/cluster-api-provider-nico/compare/v0.1.0...v0.2.0) Updates `go.temporal.io/sdk/contrib/opentelemetry` from 0.8.1 to 0.9.0 - [Release notes](https://github.com/temporalio/sdk-go/releases) - [Changelog](https://github.com/temporalio/sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/temporalio/sdk-go/compare/contrib/opentelemetry/v0.8.1...contrib/opentelemetry/v0.9.0) Updates `github.com/dsx-ai-factory/cluster-api-provider-nico` from 0.1.0 to 0.2.0 - [Release notes](https://github.com/dsx-ai-factory/cluster-api-provider-nico/releases) - [Changelog](https://github.com/dsx-ai-factory/cluster-api-provider-nico/blob/main/CHANGELOG.md) - [Commits](https://github.com/dsx-ai-factory/cluster-api-provider-nico/compare/v0.1.0...v0.2.0) Updates `golang.org/x/tools` from 0.52.0 to 0.53.0 - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.52.0...v0.53.0) Updates `cloud.google.com/go/storage` from 1.70.0 to 1.71.0 - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/compute/v1.70.0...compute/v1.71.0) Updates `google.golang.org/api` from 0.315.0 to 0.316.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.315.0...v0.316.0) --- updated-dependencies: - dependency-name: go.etcd.io/etcd/api/v3 dependency-version: 3.7.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: go.etcd.io/etcd/client/v3 dependency-version: 3.7.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/cedar-policy/cedar-go dependency-version: 1.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/dsx-ai-factory/cluster-api-provider-nico dependency-version: 0.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.temporal.io/sdk/contrib/opentelemetry dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/tools dependency-version: 0.53.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: cloud.google.com/go/storage dependency-version: 1.71.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: google.golang.org/api dependency-version: 0.316.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.etcd.io/etcd/api/v3 dependency-version: 3.7.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: go.etcd.io/etcd/client/v3 dependency-version: 3.7.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/cedar-policy/cedar-go dependency-version: 1.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/dsx-ai-factory/cluster-api-provider-nico dependency-version: 0.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.temporal.io/sdk/contrib/opentelemetry dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/dsx-ai-factory/cluster-api-provider-nico dependency-version: 0.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/tools dependency-version: 0.53.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: cloud.google.com/go/storage dependency-version: 1.71.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: google.golang.org/api dependency-version: 0.316.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * build: refresh go.work.sum for go-dependencies group bump Signed-off-by: Terry Howe <thowe@nvidia.com> * build: regenerate third-party notices for go-dependencies group bump Signed-off-by: Terry Howe <thowe@nvidia.com> * chore: retrigger ci Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Terry Howe <thowe@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terry Howe <thowe@nvidia.com> |
||
|
|
ee3764cbe1 |
build: bump the kubernetes group across 6 directories with 1 update (#2443)
* build: bump the kubernetes group across 6 directories with 1 update Bumps the kubernetes group with 1 update in the / directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Bumps the kubernetes group with 1 update in the /cluster-api-provider-provisioned directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Bumps the kubernetes group with 1 update in the /controller directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Bumps the kubernetes group with 1 update in the /controller/hack/capd-reboot-controller directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Bumps the kubernetes group with 1 update in the /controller/test/e2e directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Bumps the kubernetes group with 1 update in the /management-engine directory: [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) Updates `sigs.k8s.io/controller-runtime` from 0.25.2 to 0.25.3 - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.25.2...v0.25.3) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes ... Signed-off-by: dependabot[bot] <support@github.com> * build: regenerate third-party notices for controller-runtime v0.25.3 Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Terry Howe <thowe@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terry Howe <thowe@nvidia.com> |
||
|
|
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> |
||
|
|
8f1c0bf168 |
fix(e2e): stop perf stream runs failing TestAllowTenantNodeLabels (#2519)
## Summary
Since #2424, every perf stream run fails at the end, after the e2e suite itself has passed, because one unit test reads the kaps-bench run specs the stream passes in. Each case of `TestAllowTenantNodeLabels` now sets those run specs itself, so the test gives the same answer in a stream run as in a plain `go test`.
## Motivation / Context
A stream run starts the e2e package with flags from the release policy, and the same `go test` process runs the package's plain unit tests after the suite. Since #2424 the node label allowlist also depends on the run specs. With the perf stream's `-e2e.kaps-bench-run-specs` still set, the test's no-label case got the worker label back:
```
Error: Expected nil, but got: []string{"node-role.kubernetes.io/worker"}
```
That is how https://github.com/dsx-ai-factory/nvke/actions/runs/45441339912 ended, after 53 of 53 suite specs had passed and both kaps-bench specs had run. A plain `go test` never sets the flag, so the test only fails inside a stream run.
Closes: N/A
Related: https://github.com/dsx-ai-factory/nvke/issues/2089, https://github.com/dsx-ai-factory/nvke/pull/2424
## Type of Change
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Build/CI/tooling
## Component(s) Affected
- [ ] Controller (`controller/`)
- [ ] REST API (`controller/api/openapi.yaml`)
- [ ] Node agent or updater (`agent/`)
- [ ] gRPC API (`agent/pkg/agent/proto/`)
- [ ] nvkectl CLI (`cli/`)
- [ ] Cluster API provider (`cluster-api-provider-provisioned/`)
- [ ] Helm charts or deployment (`controller/deploy/`)
- [ ] NVKE telemetry pipeline (NKTP) integration (`deploy/nico/nktp/`)
- [ ] nico-sim (`controller/nico-sim/`)
- [ ] OS image or image checker (`os-image/`)
- [ ] CI / workflows (`.github/`)
- [ ] Docs / examples
- [x] Other: the e2e suite (`controller/test/e2e/`)
## Implementation Notes
Test only: its first two cases now set `kapsBenchRunSpecs` next to `monitoringWorkers`, as the third case already did. Both values keep the save and restore the test already had.
## Testing
Run on this branch (base
|
||
|
|
5a86a7c13e |
fix(controller): delete orphaned spire host entries (#2461)
* fix(controller): delete orphaned spire host entries The machine SPIRE entry controller deleted a host's ClusterStaticEntry only when it observed the Machine with a deletion timestamp. If the Machine finished deleting while the worker was down, the entry leaked. When a host is re-provisioned its TPM parent ID stays the same but its host ID changes, so the leaked entry and the new one both match the agent and it may present the old host SVID, failing the mTLS handshake. After applying a Machine's entry, delete managed sibling entries with the same parent ID whose host ID has no Machine that is not being deleted. A leader-elected sweep also runs every 10 minutes and deletes managed entries older than 1 hour whose host ID matches no Machine. Host entries labeled nke.nvidia.com/managed-by=cloud-workflow-engine by the pre-import controller are included: its node-table garbage collection was removed with it, so entries for hosts deleted around that switch were never cleaned up. Entries without one of these managed-by labels are never touched. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(controller): keep sweeping past failed entry deletes Collect delete errors in the sibling cleanup and the orphan sweep and return them joined, so one entry that cannot be deleted no longer blocks the rest. Skip the sweep when no Machine carries a host ID: the site's own nodes are Machines, so an empty list means a bad read, not orphans. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
445bde08f9 |
feat(controller): accept enableCPNodeRecycling on cluster create (#2453)
* feat(controller): accept enableCPNodeRecycling on cluster create Add enableCPNodeRecycling to CreateClusterRequest and store it on the new cluster. Previously the field could only be set with PATCH, so an operator could not opt in at create. The e2e nvkectl rows now create with the flag set and check that the controller stored it. The existing patch spec sets the flag to false so that its check is meaningful. Signed-off-by: Meha Mehta <meham@nvidia.com> * test(e2e): skip the create-time recycling check on a reused cluster A reused cluster is not created by the run, so initCluster sends no create request and the flag may already have been patched to false by an earlier run. Signed-off-by: Meha Mehta <meham@nvidia.com> * test(e2e): register the create-time recycling check only on fresh runs A reused cluster was not created by this run, so its create-time flag is unknown. Skipping the spec at run time reported a skip from nvkectl_test.go, which e2e_assert_no_new_skips rejects. Leave the spec out of the tree on reused runs instead. Signed-off-by: Meha Mehta <meham@nvidia.com> * test(e2e): read the reuse setting before the spec tree is built test.cfg is assigned inside the creates-the-cluster spec, which runs after the tree is built, so the guard read an empty ReuseCluster and always registered the create-time check. Load the config file when the tree is built instead. Signed-off-by: Meha Mehta <meham@nvidia.com> * test(e2e): patch to the opposite of the stored recycling flag A reused cluster can already hold the value the patch sets, so an ignored patch still passed. Read the stored value first and patch to the opposite, so the assertion holds on reused clusters too. Signed-off-by: Meha Mehta <meham@nvidia.com> --------- Signed-off-by: Meha Mehta <meham@nvidia.com> |
||
|
|
3ed03c7530 |
docs: document controller API authorization (#2174)
* docs: document controller API authorization Add an operator guide for API authorization: the admin and viewer roles, granting them by claim and by service account, turning authorization on in permissive mode, finding the callers enforcing mode would refuse, switching to enforcing, and the metrics to watch. Link it from the docs index, the controller README and docs, and the observability page. Pages that said NVKE does no authorization now say every admitted caller can call every endpoint until authorization is on. Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): name the Teleport app settings the roles claim needs The token carries roles only when rewrite.jwt_claims includes them, and the header rewrite is written differently in teleport.yaml and in a dynamic app resource. Signed-off-by: dbudris <dbudris@nvidia.com> * docs: use the apiAuthz.authorizer.localBundle values paths The chart now holds the authorization bundle under apiAuthz.authorizer.localBundle, beside apiAuthz.authorizer.backend. Update the operator guide, the controller README and the troubleshooting table to match. Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): say the chart refuses permissive authorization while it is off Signed-off-by: dbudris <dbudris@nvidia.com> * docs(operate): restructure the API authorization page after review Explain grants and the shipped roles up front, and show the apiAuth admit change a viewer grant needs. Restart NVKE when switching to enforcing mode, since only nvke-controller-config changes, and add a rollback. Name the failed-to-authorize log line, act on each outcome, and give success signals for grant changes. Split steps to one command each, move Teleport and role customization to the end, drop the metrics table that observe.md already covers, and add next steps. Signed-off-by: dbudris <dbudris@nvidia.com> --------- Signed-off-by: dbudris <dbudris@nvidia.com> |
||
|
|
6013a54cac |
feat(e2e): publish the perf stream's kaps-bench results to OpenSearch and run cluster-density-v2 (#2424)
Today the perf stream runs kaps-bench with --local-publisher, so its results reach only the kaps-bench-results.tar.gz artifact, and kaps-bench never sees an OpenSearch setting because the suite builds its environment from scratch. With KB_OPENSEARCH_URL set, the suite hands KB_OPENSEARCH_URL, KB_OPENSEARCH_USER and KB_OPENSEARCH_PASS to kaps-bench in its environment, and kaps-bench publishes to OpenSearch with the ci_job_url, release_version and release_source=nvke tags. Only the suite step of a stream with kaps-bench run specs gets the three secrets. OpenSearch's endpoint is masked in the job log and withheld from the uploaded artifacts, and its password is redacted from the results archive. A password with a line shorter than 8 bytes, which that redaction would skip, is refused before the run starts. Each run with kaps-bench also records the image digest and the version kaps-bench reports in run-inputs.txt, since the image tag floats. After the smoke test, the perf stream also runs kaps-bench's baseline/cluster-density-v2.yaml, at kaps-bench's default size and within the stream's existing time limits. Every kaps-bench run gets the tenant's worker count as --param NODE_COUNT, which cluster-density-v2 compares with the worker nodes before it starts. smoke-prometheus records the value and does not use it. Without KB_OPENSEARCH_URL, kaps-bench gets today's environment byte for byte and keeps publishing locally. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> |
||
|
|
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> |
||
|
|
b28d4f13d1 |
test(e2e): scan nico-vms clusters after upgrade and scale (#2417)
The CIS scan ran only on fresh clusters, so nothing showed whether a cluster still passes once its control plane is upgraded or its node pools grow. Two nico-vms entries now scan again at those points, against the same exception register: - "nico-vms k8s upgrade" scans after creation, on 1.35.3, and again once the upgrade to 1.36.3 has replaced its control plane. - "nico-vms" scans after creation and again while its worker pool is scaled up. The scale step is split into "scales the node pools up" and "scales the node pools back down", so the scan runs while the added node is in the cluster. Both clusters are now created encrypted at rest, as CAPD core is, so the scans check the encryption configuration NVKE renders (1.2.27, 1.2.28) rather than report its absence. The upgrade entry therefore upgrades an encrypted cluster, which no lane did before. Both entries are happy-path, which the NICo VMs lane runs. Their tenant nodes boot the NVKE FDE node image, so these are the first scans of that image. The lane now passes -e2e.artifacts-dir, inside the state directory it redacts and uploads, so the scan results are kept. The tenant scan takes the point in the cluster's life it runs at, which names its spec and its results directory, kube-bench/<cluster>/<phase>. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
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> |
||
|
|
16e762d606 |
build(deps): bump gobwas/ws to v1.5.0 for GO-2026-6940 (#2439)
govulncheck fails every merge gate on GO-2026-6940 in github.com/gobwas/ws v1.4.0, fixed in v1.5.0. The controller reaches the vulnerable ws.ReadFrame through the Teleport API client: an indirect dependency of controller/internal/teleport, called from internal/agent/tlsjwt.go. v1.5.0 no longer needs github.com/gobwas/pool, which drops out of controller/go.mod and its THIRD_PARTY_NOTICES.md. go.work.sum is refreshed with make work-sync, and the notices with make notices. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
c1ef896e22 |
feat(controller): expose observed node pool counts (#2400)
* feat(controller): expose observed node pool counts (poc) Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): keep node pool counts with pool queries Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): name compared node set current Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): use a generic json equality helper name Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): use inner join for node set counts Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): use node set names in count aggregation Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): consolidate node pool response mapping Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * docs: keep node pool field definitions in the api reference Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): restore single node pool response conversion Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * test(controller): colocate node pool count tests Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * test(controller): colocate node pool response count tests Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(api): name observed node pool count explicitly Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * fix(controller): compare template JSON numbers by exact value Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): limit JSON comparison to node pool counts Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): restore shared pool configuration comparison Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): move json equality to shared utils Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * test(controller): use unambiguous numeric precision fixtures Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * refactor(controller): simplify node pool count responses Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> * perf(controller): index nodes by node pool Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> --------- Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> |
||
|
|
e92d0dc7e1 |
fix(controller): wait for cloud-init on legacy agents (#2432)
- Use a completion script for agents older than v0.1.24 - Wait for readiness to populate agent versions before preflight Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |
||
|
|
42a2cbd51f |
fix(controller): keep control-plane remediation running when failure-domain discovery fails (#2425)
Any failure-domain discovery error other than infrastructure that is not yet provisioned aborted the whole control-plane reconcile, so remediation, the Kubernetes upgrade, joins and requested deletes stalled until discovery succeeded. Only the steps that choose a failure domain need it. Defer just scale-up, stuck-pending replacement, rollout, rebalance and scale-down when discovery fails, for any reason. The error is logged and the cluster requeued rather than returned, because returning it rolls back the reconcile's transaction and would undo the writes this keeps running. Closes #1640 Signed-off-by: Kaveesh Khattar <kaveeshkhattar@gmail.com> |
||
|
|
b4e7ea79b9 |
refactor(controller): move kubelet client CSR approval into kubeletcsr (#2421)
Keep the client CSR controller and its certificate-request helpers out of the bootstrap package so serving approval can share them. Bootstrap identity and authorization keep their own condition helpers. Signed-off-by: Ryan Bever <rbever@nvidia.com> |
||
|
|
dd1ed438ce |
build: bump the go-dependencies group with 8 updates (#2370)
* build: bump the go-dependencies group across 1 directory with 8 updates Bumps the go-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/prometheus/common](https://github.com/prometheus/common) | `0.73.1` | `0.74.0` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.58.0` | `0.59.0` | | [github.com/cedar-policy/cedar-go](https://github.com/cedar-policy/cedar-go) | `1.9.0` | `1.9.2` | | [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) | `0.152.0` | `0.153.0` | | go.temporal.io/api | `1.64.2` | `1.64.3` | | go.temporal.io/sdk | `1.50.0` | `1.51.0` | | [golang.org/x/mod](https://github.com/golang/mod) | `0.42.0` | `0.43.0` | | [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.311.0` | `0.315.0` | Updates `github.com/prometheus/common` from 0.73.1 to 0.74.0 - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/common/compare/v0.73.1...v0.74.0) Updates `golang.org/x/crypto` from 0.58.0 to 0.59.0 - [Commits](https://github.com/golang/crypto/compare/v0.58.0...v0.59.0) Updates `github.com/cedar-policy/cedar-go` from 1.9.0 to 1.9.2 - [Release notes](https://github.com/cedar-policy/cedar-go/releases) - [Commits](https://github.com/cedar-policy/cedar-go/compare/v1.9.0...v1.9.2) Updates `github.com/getkin/kin-openapi` from 0.152.0 to 0.153.0 - [Release notes](https://github.com/getkin/kin-openapi/releases) - [Commits](https://github.com/getkin/kin-openapi/compare/v0.152.0...v0.153.0) Updates `go.temporal.io/api` from 1.64.2 to 1.64.3 Updates `go.temporal.io/sdk` from 1.50.0 to 1.51.0 Updates `golang.org/x/mod` from 0.42.0 to 0.43.0 - [Commits](https://github.com/golang/mod/compare/v0.42.0...v0.43.0) Updates `google.golang.org/api` from 0.311.0 to 0.315.0 - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.311.0...v0.315.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.74.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/crypto dependency-version: 0.59.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/cedar-policy/cedar-go dependency-version: 1.9.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/getkin/kin-openapi dependency-version: 0.153.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.temporal.io/api dependency-version: 1.64.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: go.temporal.io/sdk dependency-version: 1.51.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/mod dependency-version: 0.43.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: google.golang.org/api dependency-version: 0.315.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * build: regenerate notices and workspace, move to DescribeWorkflow Regenerate the third-party notices and go.work.sum for the dependency bumps. Replace the deprecated Temporal DescribeWorkflowExecution with DescribeWorkflow, which the Temporal SDK 1.51.0 bump flags under SA1019. Signed-off-by: dbudris <dbudris@nvidia.com> * build: align workspace manifests after rebase and migrate the gofail teardown test to DescribeWorkflow Signed-off-by: dbudris <dbudris@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dbudris <dbudris@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
b6915fdb61 |
build: bump sigs.k8s.io/cluster-api/test (#2291)
Bumps the kubernetes group with 1 update in the /controller/hack/capd-reboot-controller directory: [sigs.k8s.io/cluster-api/test](https://github.com/kubernetes-sigs/cluster-api). Updates `sigs.k8s.io/cluster-api/test` from 1.13.7 to 1.13.8 - [Release notes](https://github.com/kubernetes-sigs/cluster-api/releases) - [Commits](https://github.com/kubernetes-sigs/cluster-api/compare/v1.13.7...v1.13.8) --- updated-dependencies: - dependency-name: sigs.k8s.io/cluster-api/test dependency-version: 1.13.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kubernetes ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
4c9ed2ffb5 |
feat(e2e): run the kaps-bench smoke test on the perf stream (#2361)
* feat(e2e): run kaps-bench on the perf stream's tenant Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): stage kaps-bench and helm on the perf stream's runner Today a CI perf run stops at the suite's early check: the job leaves E2E_KAPS_BENCH_DIR empty and the runner has neither kaps-bench nor helm. After this, a stream with kaps-bench run specs logs in to NVCR, sets up helm at the pinned version, copies kaps-bench and its folder out of the image pinned in make/tool-versions.mk, and checks them with list-run-specs. Each run also uploads kaps-bench-results.tar.gz with the other suite files. Every new step runs only for a stream with kaps-bench run specs, so other streams run as before and their plans do not change. kaps-bench-results.tar.gz holds kaps-bench's output dir alone: its kubeconfig sits in the suite's temp dir outside it, and kaps-bench never sees the jump hosts or the token issuer that the log scrub withholds. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): check the kaps-bench binary before a machine is taken requireKapsBenchTools now refuses a kaps-bench folder with no runnable kaps-bench in it, and a folder path that is not absolute, so both fail before the site and tenant are built instead of at the first run spec. Flag help and docs list the binary among the folder contents, say the results archive is absent when no run spec got as far as writing an output dir, and say helm is needed and checked for a stream with kaps-bench run specs. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): let kaps-bench install what its run specs need Perf stream policy now names the run spec smoke/smoke-prometheus.yaml in place of smoke/smoke.yaml. That run spec lists kube-prometheus-stack as something to install first, so kaps-bench installs it with the helm in its own folder and leaves it for the run specs that follow. nvke no longer installs Prometheus: the helm call and its embedded values file are removed, and the perf stream's runner no longer needs helm on PATH. requireKapsBenchTools also refuses a folder without a runnable bin/helm, so such a folder fails before the site and tenant are built. kapsBenchSetup is the renamed once-per-tenant setup and writes the cluster context. kaps-bench gets 5 minutes between SIGTERM and SIGKILL when a run spec reaches its limit. In that time it stops its engine, writes its final record and removes a chart it had half installed. 5 seconds was too short for that: a stop during a chart install took 11.2 seconds in a hand test. tenantToolRun takes the 5 minutes as a stop grace per tool, and AICR keeps 5 seconds and its 10 second wait. So that the grace fits inside the spec's limit, kaps-bench is stopped 39m50s into the first run spec and 24m50s into a later one. When a canceled command returns, every process group it listed gets SIGKILL straight away, so a child that ignored SIGTERM does not outlive the spec. AICR runs get the same. Each run spec keeps its time limit and token lifetime, and the perf stream keeps its suite timeout. In qualify-e2e.yml, the helm steps run only for the GPU runtime again, as on main. KAPS_BENCH_IMAGE stays at v0.3.1, which has no smoke-prometheus.yaml, so the perf stream stops at its early check until the pin moves to an image that has it. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * feat(e2e): give the perf stream's tenant a monitoring node Today the perf stream's tenant is one control plane and three workers, and nothing keeps the benchmark's Prometheus off the workers it measures. A stream can now ask for monitoring nodes with monitoringWorkers in release/policy.yaml, and the perf stream asks for one, so its tenant is one control plane, three workers and one monitoring node. Planning carries the value into the plan, the summary line and the matrix, and the run step passes it to the suite as -e2e.monitoring-workers. With it above 0, the suite asks the site controller for a second node pool, monitoring, whose nodes are labeled node-role.kubernetes.io/monitoring and tainted monitoring=true:NoSchedule, and labels the workers node-role.kubernetes.io/worker. Only Pods that tolerate the taint can land on the monitoring node. Pool labels and taints are applied by the controller while it provisions a node, before it lifts its own provisioning taint, so no node is schedulable without them. Both label keys sit under kubernetes.io, which the controller refuses unless its nodeMetadata.allowlistedLabelKeys lists them. A site the suite builds allowlists exactly those two keys, and only when the stream asks for a monitoring node. Taint keys under reserved domains are always refused, so the taint key is simply monitoring. Forge and DSX pool specs and the NICo and CAPD request builders now carry a pool's labels and taints where they dropped them, and the capacity check counts the monitoring node with the workers, since it takes the worker shape. A stream without the parameter, or with 0, runs as before: its plan, its run step's flags, the node pools in its create request and the site's controller values are all unchanged. Plans for every other scope are byte identical. Not proven before a real run: the tenant's OVN-Kubernetes DaemonSet comes from a bundle outside this repository. Upstream OVN-Kubernetes tolerates every taint, and this bundle was not read. If it does not tolerate monitoring=true:NoSchedule, the monitoring node never becomes Ready and the tenant create times out. kaps-bench does not place Prometheus on the monitoring node yet, so until its values select the node, Prometheus still lands on a worker. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * chore(e2e): follow the latest kaps-bench image Perf runs stage nvcr.io/j7sbcjl3qgta/kaps-bench:latest and pull it fresh each time, so every run gets the build kaps-bench main published last. A perf result can move with a kaps-bench change and no nvke change. Each run prints the image digest in its Stage kaps-bench step; compare digests before comparing two results. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): redact the kaps-bench results archive kaps-bench-results.tar.gz now goes through the same substitution as nvkectl-diagnostics.tar.gz, with each withheld value and its base64 form replaced in every file of the archive. In the site lane the list is the one the site's archives get: the values withheldFromEnvironment returns and every credential the deploy places on the node. In the lane that builds no site it is the values withheldFromEnvironment returns. Perf runs follow the newest kaps-bench image, so what kaps-bench writes into its output folder can change with no change in this repository, and a failed connection's error text names the address it tried; a file with nothing to replace keeps its bytes. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): refuse monitoring nodes on a tenant that gets the GPU runtime A run that installs the GPU runtime on its tenant and also asks for monitoring nodes now fails before a machine is taken: in the site lane's first step at stage full, and at the start of the tenant create in the lane that builds no site. GPU checks expect -e2e.tenant-workers GPU nodes, and the monitoring node takes the worker shape, so on a GPU run it would most likely count as one more. No stream runs that combination, so the suite refuses it up front. A run with the GPU runtime switched on and no GPU to install it on, as on the perf stream, still goes ahead and skips the runtime. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> * fix(e2e): check the kaps-bench folder before the nico-forge lane creates a tenant Against a site the suite did not build, the nico-forge lane now checks the kaps-bench folder and its run specs at the start of the tenant create, as the site lane does in its first step at stage full. Until now that lane found a missing folder only once the tenant was up and its checks had run. A run without kaps-bench run specs passes the check as before. In the e2e README, nico-forge is now the only lane named as running on a site the suite did not build, since nico-dsx runs only on a site it builds. Signed-off-by: Ganesh Reddy <gputta@nvidia.com> --------- Signed-off-by: Ganesh Reddy <gputta@nvidia.com> |
||
|
|
f75b8de15c |
feat(controller): serve controller-runtime metrics (#2084)
The manager's own metrics server is disabled, and /metrics served only the default Prometheus registry, so nothing exported the metrics controller-runtime records in its own registry: reconcile counts, errors and durations, work queue depth and latency, REST client requests and leader election status. Serve that registry from /metrics beside the default one. It carries its own Go runtime and process collectors, which duplicate the default registry's and fail the scrape, so leave those families out. Leave out the series of the controllers NVKE runs for each tenant cluster too. Their names end in the cluster's ID, so they would grow with every tenant cluster and outlive deleted ones. The management plane's own controllers keep their series. A metric both registries define differently now costs the scrape that metric, not the whole response. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
03846b9a18 |
test(e2e): drop the remove-ovn-requests hook from the nico-vms-cp fixture (#2410)
* test(e2e): drop the remove-ovn-requests hook from the nico-vms-cp fixture The nico-vms-cp fixture profile no longer clears ovnkube-node's resources after a control-plane join, and the runbook that did it is removed. OVN keeps the chart's requests (300m CPU, 1312Mi per pod on chart 2.4.2) and runs Burstable. That fits on the lanes' 6 GiB and 8 GB control planes. Signed-off-by: Aaron Patten <apatten@nvidia.com> * test(e2e): run the nico-vms releases workers on the large instance type Without the remove-ovn-requests hook, ovnkube-node keeps its chart requests (1312Mi on chart 2.4.2) on every node, and a cpu2-mem2gb worker cannot fit them. The "nico-vms releases" spec and the release matrix were the last nico-vms specs with workers on that type; they now use nicoVMSLargeInstanceID, like the happy-path and ovn specs. The fixture README now counts the seven runbooks the nico-vms profiles reference, apart from evict-cnpg-node.sh. Signed-off-by: Aaron Patten <apatten@nvidia.com> --------- Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
f1d5d4c2f6 |
docs(os-image): direct users to build node images from source (#2298)
Signed-off-by: Nathan Hensley <nhensley@nvidia.com> |
||
|
|
0493582197 |
test(e2e): scan CI clusters with kube-bench (#2156)
Scan the clusters the CAPD and bootstrap e2e lanes build with kube-bench, and fail the lane on any FAIL or WARN the exception register does not cover, or on an entry for a check kube-bench does not report. The scan runs the kube-bench v0.16.0 image as published, with cis-1.12, the newest benchmark it ships. The release maps no Kubernetes version after 1.34, so the scan names the benchmark rather than rely on kube-bench falling back to it. A scan runs the policies checks first and alone, in a pod that takes nothing from the host but the admin kubeconfig and runs as a service account that mounts no token, so section 5 does not report the scan itself. It then runs one pod per node, reads each report from its log, and deletes everything it created. A policies report whose audits returned no rows is an error, not a list of findings. NVKE now sets kube-controller-manager's --terminated-pod-gc-threshold to 12500, Kubernetes' own default, on every cluster it creates. The scan's check 1.3.1 looks for the flag; setting the default explicitly satisfies it without changing how many finished pods a cluster keeps. Existing clusters keep the configuration they were created with. Like the other flags NVKE sets, a cluster-create request cannot override it through extraArgs. The register, exceptions.yaml, lists each accepted check by ID, with a title and a reason in our own words. An entry applies on every node of every cluster. One whose check passed on every node is listed as unneeded, since the other kind of cluster may still need it. The CAPD lane scans "CAPD core" on pull requests and "CAPD with etcd encryption" on full runs, once their nodes are ready, and copies the results out with its diagnostics, as the local entrypoint runner now does too. Both create encrypted clusters, so the scan checks the encryption configuration NVKE renders; CAPD core now creates one. The bootstrap lane scans the site cluster in stage 4d of run.sh; a scan that failed or never reached a verdict fails the run after the teardown, and the workflow uploads the results on every provisioned run. The substrate now mounts its etcd tmpfs with mode 0700, the mode kubeadm gives the directory it creates, instead of tmpfs's default 1777. The CAPD node image, which the bootstrap image builds on, now creates the etcd user and, at every boot, gives it /var/lib/etcd, as the production node image does; the node containers mount a root-owned tmpfs there. The scan pods mount each host's /etc/passwd and /etc/group, so kube-bench names the directory's owner as the host does: its own image has no etcd user and reported UNKNOWN:UNKNOWN. Check 1.1.12 then passes on the CI clusters and on production nodes. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
c34780da4b |
feat: authenticate node agents in KubeVirt VMs over TLS/JWT (#2379)
* feat(controller): accept VM subjects for TLS/JWT node agents DSX Identity issues /vm/<id> subjects to virtual machines through the metadata-service sidecar. Accept /vm/<node UUID> alongside /bm/<node UUID> so node agents in KubeVirt VMs can authenticate. Signed-off-by: Suket Sharma <sukets@nvidia.com> * feat(agent): fetch TLS/JWT tokens from the DSX metadata service Add --dsx-identity-metadata-url (NKE_DSX_IDENTITY_METADATA_URL). When set, the tls-jwt token source fetches the DSX identity token from the metadata service at /latest/meta-data/identity instead of minting a JWT-SVID from the SPIRE workload API and exchanging it. A KubeVirt VM cannot run an attested SPIRE agent, but the DSX metadata-service sidecar in its virt-launcher pod returns an already exchanged token for the VM's workload identity. Signed-off-by: Suket Sharma <sukets@nvidia.com> * fix(agent): bypass HTTP proxies for DSX metadata service requests The metadata service is reachable only from the VM's own pod network, so a node-wide HTTP_PROXY must not carry the request. Signed-off-by: Suket Sharma <sukets@nvidia.com> * refactor(agent): read metadata token expiry with golang-jwt Use jwt.ParseUnverified instead of decoding the JWT payload by hand, and reword the MetadataClient doc comment. Signed-off-by: Suket Sharma <sukets@nvidia.com> * fix(agent): require external mTLS with the DSX metadata service A VM has no SPIRE agent, so without --nvke-controller-client-ca-bundle the agent would fall back to the SPIRE workload API for its server certificate and fail at runtime. Reject that configuration at startup instead. Signed-off-by: Suket Sharma <sukets@nvidia.com> --------- Signed-off-by: Suket Sharma <sukets@nvidia.com> |
||
|
|
867eb5aa78 |
build: bump github.com/russellhaering/gosaml2 from 0.11.0 to 0.12.0 in /controller (#2402)
* build: bump github.com/russellhaering/gosaml2 in /controller Bumps [github.com/russellhaering/gosaml2](https://github.com/russellhaering/gosaml2) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/russellhaering/gosaml2/releases) - [Commits](https://github.com/russellhaering/gosaml2/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: github.com/russellhaering/gosaml2 dependency-version: 0.12.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * build: sync workspace and notices for gosaml2 0.12.0 Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Terry Howe <thowe@nvidia.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terry Howe <thowe@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> |
||
|
|
be19c614c1 |
feat(controller): accept control-plane component extraArgs at cluster create (#2395)
* feat(controller): add control-plane component extraArgs to the create API Add apiServer, controllerManager and scheduler, each with an extraArgs map from flag name to value, to CreateClusterControlPlaneConfig and to the cluster's controlPlaneConfig. Store them in the control-plane configuration snapshot, which is JSONB, so no migration is needed. Refs #2386 Signed-off-by: Carl Danley <cdanley@nvidia.com> * feat(controller): validate and render control-plane extraArgs Reject an operator argument for a flag NVKE sets on that component, a flag name that isn't lowercase words joined by hyphens, a feature-gates value that doesn't parse, and a gate that contradicts NVKE's. The create handler runs the check before it writes anything. Render the arguments into each component's extraArgs in the kubeadm ClusterConfiguration at init, from the snapshot the init node is pinned to. feature-gates is merged with NVKE's gates and sorted. Control-plane nodes that join later read them from kubeadm-config. A test keeps the list of flags NVKE sets in step with the renderer and the kubeadm-config rewrites. Refs #2386 Signed-off-by: Carl Danley <cdanley@nvidia.com> * feat(controller): reject AllAlpha and AllBeta in operator feature-gates Each sets every gate of its stage, including gates a later Kubernetes version adds, so an upgrade would turn on features nobody chose. The design review agreed to reject them, through a per-version gate catalog that was later dropped. Keep that decision without it, and record it in the design doc and the API description. Refs #2386 Signed-off-by: Carl Danley <cdanley@nvidia.com> * docs(design): describe the flag-name rule for control-plane extraArgs The Validation section said only that each map is from a non-empty flag name to a string value. The controller also requires lowercase words joined by single hyphens, without the leading "--", because components turn "_" into "-" when they parse flags. Say so, and why. Refs #2386 Signed-off-by: Carl Danley <cdanley@nvidia.com> * chore: allowlist the kubeadm golden bootstrap token in gitleaks The new extraArgs golden files render the synthetic bootstrap token that validInitConfig sets, and generic-api-key flags "token: <value>". Allow that one literal under controller/internal/kubeadmconfig/testdata only, with condition AND, so a real credential in those files, or the same literal elsewhere, is still caught. Refs #2386 Signed-off-by: Carl Danley <cdanley@nvidia.com> --------- Signed-off-by: Carl Danley <cdanley@nvidia.com> |
||
|
|
972630aff9 |
refactor(controller)!: remove provisioning profile hooks (#2392)
- Stop running prejoin/postjoin profile hooks during provisioning - Remove profile-driven provisioning reboot scheduling BREAKING CHANGE: Provisioning no longer runs profile hooks or profile-driven reboots. Stop old workers and terminate affected in-flight provisioning and join workflows before starting this version. Signed-off-by: Vivin Wilson <vwilson@nvidia.com> |
||
|
|
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> |