Commit Graph
4 Commits
Author SHA1 Message Date
Abhay Krishna 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>
2026-11-19 13:58:56 -08:00
Chao 6bc0e1c9e8 fix(agent): rename node agent package and contracts to nvke (#1565)
* fix(agent): rename node agent package and contracts to nvke

Signed-off-by: Chao Chen <chaoch@nvidia.com>
2026-10-12 14:14:32 -07:00
Guillermo Gaston 472610d634 feat(nico-sim): unify nico-vms and mock-nico
Adds a Docker-backed NICo simulator backend alongside the existing VM backend, dispatched per site with a shared instances table. Existing databases migrate automatically at startup. Unifies the nico-mock and nico-vm Tilt providers into a single nico-sim provider.
2026-09-08 19:33:50 -04:00
nhammernik 7ce92b69ce feat: import cloud-workflow-engine (#7) 2026-08-05 16:25:10 -06:00