mirror of
https://github.com/dsx-ai-factory/nvke.git
synced 2026-12-07 04:35:58 +08:00
pull-request/2579
24
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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> |
||
|
|
55b2a0029a |
refactor(dev)!: remove the deprecated CWE_* and NKE_CONTROLLER_* setting names (#2114)
* refactor(dev)!: remove the deprecated CWE_* and NKE_CONTROLLER_* setting names The controller's development, test and build settings read only their NVKE_CONTROLLER_* names now. The CWE_* and NKE_CONTROLLER_* aliases, deprecated since v0.23.0, are gone from the Makefiles, Tiltfiles, hack and CI scripts, the e2e framework and tests, and the docs. So are CWE_IMAGE (use CONTROLLER_IMAGE), the cwe_image key in tilt_config.json (use nvke_controller_image), --cwe-api in get-kubeconfig.sh (use --controller-api) and the cwe-name input of qualify-e2e.yml (use controller-name). local-backend-e2e.sh reads LOCAL_NVKE_CONTROLLER_IMAGE instead of LOCAL_CWE_IMAGE. BREAKING CHANGE: a value set under an old name, in .env, .env.tilt, tilt_config.json, a shell profile or a repository variable, is now ignored without a warning. Rename CWE_X and NKE_CONTROLLER_X to NVKE_CONTROLLER_X, except CWE_API (use NVKE_CONTROLLER_API_URL) and CWE_IMAGE in make -C cli images (use CONTROLLER_IMAGE). Rename LOCAL_CWE_IMAGE to LOCAL_NVKE_CONTROLLER_IMAGE and the cwe_image key to nvke_controller_image. get-kubeconfig.sh rejects --cwe-api (use --controller-api), and qualify-e2e.yml has no cwe-name input (use controller-name). Signed-off-by: Aaron Patten <apatten@nvidia.com> * ci: fail when a removed controller setting name comes back make name-check, which the merge gate runs, now also runs hack/removed-settings-check.py. It fails on any removed CWE_* or NKE_CONTROLLER_* setting name, LOCAL_CWE_IMAGE, cwe_image, --cwe-api or cwe-name in a tracked file, so a branch cut before the removal cannot bring a reader of an old name back. CHANGELOG.md is not scanned, and two look-alikes that are not controller settings are allowed by file. Signed-off-by: Aaron Patten <apatten@nvidia.com> --------- Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
5c86b4879d |
refactor(dev): name the controller's Tilt resource nvke-controller (#1770)
The controller's Tilt resource is nvke-controller and its build step is nvke-controller-compile. tilt_config.json sets the controller image with nvke_controller_image, and Tilt providers return controller_resource_deps, controller_env_overrides and controller_chart_flags. The cwe_image key and the cwe_* provider fields are still read for one release, with a warning. Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
46f04ce59e |
feat: write labels and annotations under nvke.nvidia.com and read both domains (#1713)
* feat(controller): add the keys package for the nvke.nvidia.com label domain The labels, annotations, taints and node conditions this controller owns move from nke.nvidia.com to nvke.nvidia.com. The rename is not atomic: objects labelled by an earlier build keep the old keys until something rewrites them, and a reboot or terminate request applied by hand arrives under whichever domain the operator knows. keys.Key holds the bare name and renders it under either domain. Callers write Key.String(), always the new one, and read with Get/Value/Has/ Matches, which accept both. Key.All() is the delete form, because removing only the new key leaves a legacy copy the next read would find. Both domains are compiled in, as cluster-api-provider-nico did for its own rename: there is no third domain anything could read, so there is nothing to configure. Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(controller): write object keys under nvke.nvidia.com and read both domains Routes every label, annotation, taint and node-condition key the controller owns through internal/keys, and deletes the string constants that held them. Writes land on nvke.nvidia.com; reads accept either domain, preferring the new one. Three places need more than a mechanical swap: - Node topology labels are rewritten on reconcile, which drops the legacy key rather than leaving a node carrying both. - Taint removal strips both domains. A node joined before the rename carries the provisioning taint under the legacy key, and a workflow untainting it may now be asking for the new one; removing only the requested form would leave the node NoSchedule for good. - Reboot and terminate completion clears both forms of the request label, which an operator or an external automation may have applied under either. Secret ownership labels converge the same way: a rewrite drops the legacy key so a Secret carries one domain, not two that could drift. Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(nico): point the capnico reboot and repair annotations at nvke.nvidia.com cluster-api-provider-nico watches exactly one Machine annotation for a reboot and one for a repair, named by --reboot-annotation and --repair-annotation, and silently ignores a request under any other key. A mismatch is not an error anywhere: reboot and repair requests are simply never actioned. So the controller writes both annotations under both domains until every deployment has moved, and these manifests move to the new one. Both keys are owned by the same field manager, so clearing the annotation still clears both. The dev capd-reboot-controller reads either form. Sites that deploy capnico from their own manifests can move the flags on their own schedule; see docs/operations/label-domain-migration.md. Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(cli): write the etcd key cluster-name annotation under nvke.nvidia.com nvkectl writes this annotation onto the etcd encryption key Secret it saves to disk, and reads it back to match a file to a cluster. The legacy key stays exported so a file written by an earlier nvkectl is still readable. Signed-off-by: Terry Howe <thowe@nvidia.com> * feat(capp): write the SPIRE agent path annotation under nvke.nvidia.com The provider owns this Machine annotation, so it is the thing that moves a Machine over: the write drops the legacy key rather than leaving two for the controller to choose between. Signed-off-by: Terry Howe <thowe@nvidia.com> * docs: describe the nvke.nvidia.com label and annotation domain What an existing site has to do (check the capnico flags, and anything outside NVKE that matches on these keys), what it does not (relabel objects, coordinate the upgrade, change how reboots are requested), and which nke.nvidia.com names are deliberately not part of this change. Signed-off-by: Terry Howe <thowe@nvidia.com> * chore: link the capnico dual-write to the issue that removes it The two Machine annotations written in both domains are scaffolding for a rollout, not a design. FIXME them against #1718 so the next reader knows what has to be true before they go, and say in the migration guide that a stale --reboot-annotation or --repair-annotation becomes a silent failure once the dual write is gone. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix: address review feedback - nodestatus: try the current domain before the legacy one when reading NeedsRecycle and NeedsRepair. Status.Conditions has no ordering guarantee, so matching either form took whichever came first: a stale legacy False left by an earlier build could mask a current True and drop the recycle or repair request it records. - nico_spiffe_controller_test: assert absence against the rendered key. testify compares map keys without converting types, so a keys.Key needle made the NotContains pass even with the annotation present. - capd-reboot-controller: honour a legacy reboot-complete timestamp. It already read a legacy reboot request but checked only the current completion key, so it replayed the simulated reboot and overwrote the completion it had already recorded. - management-engine: reserve nvke.nvidia.com in the userParams.labels CEL rule, not just in the doc comment. The rule excluded the legacy domain only, so a label under the domain this controller now writes could pass CRD admission and collide with one NVKE owns. The REST API validator already rejected both domains; this aligns the two. 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> |
||
|
|
26d1d23670 |
fix(e2e): retry the local entrypoint's image pulls (#1581)
local-backend-e2e.sh pulled the bundle mirror's alpine and nginx images, and the E2E runner image, without a retry. #1513 added one to ci/backend-e2e.sh for the mirror's uncached-blob 404, and the same 404 then failed the Local entrypoint lane at its bundle mirror. pull_with_retry, with the bounded timeout wrapper it uses, moves into backend-e2e-lib.sh so both entrypoints share it. e2e_start_bundle_mirror pulls a missing image through it before docker create and docker run, which pull a missing image once, and uses a cached one as is, as docker would, so a host that cannot reach the registry still starts the mirror. local-backend-e2e.sh pulls the runner image through it the same way. The function reports through the caller's log when there is one, since Makefile.dev's bundle-mirror target sources the library from a bare bash -c. bounded runs timeout with --foreground, so Ctrl-C during a slow pull in a hand run reaches the pull instead of being dropped, and falls back to running unbounded where timeout lacks the flag, as it already did where timeout is absent. Signed-off-by: Abhay Krishna Arunachalam <abhaykrishna@nvidia.com> |
||
|
|
1324a162dc |
feat(e2e): requirement labels, lane filters and a TPM attestation spec (#1589)
* feat(e2e): requirement labels, lane filters and a TPM attestation spec The needs:cpu and needs:gpu labels the Capacity Provider reads: the site-controller container holds the site node, the tenant control plane and a GPU worker (cpu=2, gpu=1); the standalone nico-forge entry holds the tenant alone (cpu=1, gpu=1). A tpm-labelled spec on the Forge tenant asserts every node's SPIRE agent attested by its TPM: each CAPI Machine carries a /spire/agent/tpm/<hash> identity and the management SPIRE server lists that agent. Lanes without the hardware exclude the requirement labels: capd, nico-containers and local-entrypoint add !tpm && !gpu, nico-vms adds !gpu because its guests have an emulated TPM, and e2e_suite_filter follows. Refs NKX-17007 Signed-off-by: Ron Compos <rcompos@nvidia.com> * fix(e2e): read TPM trust domain from SPIRE, reject shared identities The TPM attestation spec now takes the trust domain from the SPIRE server's own configuration instead of the kubeconfig context name, and tpmAgentIDs rejects two Machines claiming the same TPM path. The spec's label is renamed from tpm to tpm-attestation, with the lane filters updated to match. Signed-off-by: Ron Compos <rcompos@nvidia.com> --------- Signed-off-by: Ron Compos <rcompos@nvidia.com> |
||
|
|
46b0a6272d |
fix(e2e): probe openvswitch before the builds, not after them (#1561)
* fix(e2e): probe openvswitch before the builds, not after them The CAPD and NICo e2e entrypoints asked whether the host can load the openvswitch module only after building the CAPD node image -- the last and most expensive step before the suite starts. On the arc-arm64-cpu16 runners, which cannot load it (#1515), both jobs therefore spent four to six minutes of a cpu16 runner building an image they were about to throw away. Nothing built in between can change the answer. The module lives in the host's /lib/modules and the probe reads /sys/module, so the result is a property of the runner's kernel; the image argument supplies only /bin/sh and modprobe. Passing the CAPD node image made it look like a check on that image, which is what put the call after the build. So it moves ahead of the first build in both entrypoints and runs against alpine:3.22 -- already pinned and pulled later in the same CI script, so no new image enters the run. A host that cannot load the module now fails in seconds. This does not fix #1515: those runners still cannot load the module and the arm64 jobs still fail. It makes them fail fast and stop burning runner time. Signed-off-by: Terry Howe <thowe@nvidia.com> * fix(e2e): probe with the node image's own base, not alpine Review feedback on #1561. The probe has to run the same modprobe the nodes run. kindest/node carries kmod 34.2 built +ZSTD, which is what reads Ubuntu's compressed modules; alpine's modprobe is busybox's, a different implementation, so its answer would not be the one that decides whether the suite can pass. (The review said alpine has no modprobe at all -- it does, at /sbin/modprobe -> /bin/busybox. The conclusion holds for the other reason.) So the probe now uses the kindest/node image the CAPD node image is built FROM. build-image.sh already owns that pin and the mirror prefix, so it gains a --print-base-image mode and both entrypoints ask it rather than restating either: a tag bump there reaches the probe with no second edit. The image is one the node image build pulls minutes later anyway, so this still adds no image to the run -- it moves one pull earlier. Signed-off-by: Terry Howe <thowe@nvidia.com> --------- Signed-off-by: Terry Howe <thowe@nvidia.com> |
||
|
|
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> |
||
|
|
30a274ca9a |
fix(ci): match module packages to the full host kernel build (#1574)
Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com> |
||
|
|
f4be543c42 |
fix(ci): load openvswitch through privileged Docker (#1566)
ARC runners install the matching kernel module files but lack permission to insert modules. Load through the existing privileged preflight, streaming the runner module tree when the DinD daemon cannot see it. Preserve fail-closed checks and the ovs-ctl bridge-removal guard. Refs #1515 AI-assisted change. Validated with repository preflight, workflow and shell lint, YAML checks, and local Linux Docker transfer/failure regression tests. Signed-off-by: Ilya Kislenko <ikislenko@nvidia.com> |
||
|
|
74c1aab61a |
fix(e2e): stop early when the host cannot load openvswitch (#1531)
Without the module every OVN tenant stays unready and the run fails after about 105 minutes; check once after the node image is built. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
07da38b677 |
fix(e2e): give the CAPD suite 120 minutes (#1512)
Passing CAPD jobs take 103-111 minutes, so the shared 100-minute suite timeout cuts slow runs at the last spec. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
59619833ad |
test(e2e): test only the cluster-level controlPlaneConfig (#1084)
CWE provisions every control plane from the cluster-level controlPlaneConfig, so the e2e suite no longer builds or tests a control-plane node pool or reads the control-plane flag. The suite sends each entry's control plane as a controlPlaneConfig. The four entries that exercised a control-plane node pool are gone, along with the validations only they used and the self-skips that chose a shape from the flag. The workflows and scripts run the full suite once instead of running a flag-on leg and a flag-off leg, so the redeploy between legs, the per-leg label filters, the single-runner input and the provision-cp-with-controller input are removed. The nkectl smoke always builds its cluster from a controlPlaneConfig and no longer logs a kubeconfig reply that may hold credentials. Signed-off-by: Anisha Gupta <anisgupta@nvidia.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
418ed5c55c |
chore(e2e): say controller, not CWE, in the e2e harness, CI and Tilt (#1394)
Signed-off-by: Aaron Patten <apatten@nvidia.com> |
||
|
|
92a3039bae |
feat: default CNI to ovn-kubernetes (#1303)
* feat: default omitted CNI to ovn-kubernetes Empty cniPlugin and cniName now select ovn-kubernetes, and local images, examples, and create scripts follow that default. calico remains an explicit override. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: build OVN packages outside the gitignored bin directory crane was installed into the package tree's bin directory, which a checkout sync can delete while the download is still running. Stage the tool in the build scratch directory and create its destination immediately before moving it. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): complete pod checksums on the userspace datapath veth pods send partial checksums, and the netdev datapath forwarded them unfinished, so receivers dropped pod traffic to services and the node. Enable userspace TSO and restart ovs-vswitchd only when the setting changes. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(tilt): label the local NICo cluster button inputs The create dialog showed the defaults with no captions because text_input was called without label. Signed-off-by: Alex Greene <algreene@nvidia.com> * feat(controller): ensure host vTPM proxy for nico-containers on Linux Share ensure-vtpm-proxy.sh between Colima and bare Linux hosts, fail fast from Tilt and nico-sim when /dev/vtpmx is missing, and document the one-time host prep so remote Tilt targets do not hang waiting for kubeconfig secrets. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: load the vTPM proxy on the kernel that runs Docker Container nodes need /dev/vtpmx. Without it, swtpm never starts and nke-agent blocks while setting up SPIFFE, so provisioning looks stuck. Colima already loaded the module inside its VM, but a Linux host never did. One script now does that load, and make host-up runs it on either machine. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): keep an explicit OVN version when the plugin name is omitted Kubeadm init with no plugin name defaults to OVN, but a version sent with that request was discarded and 1.4.0 was installed instead. The requested version is used, and 1.4.0 is applied only when none was given. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): retry userspace TSO after a failed ovs-vswitchd restart ovs-vswitchd reads userspace-tso-enable only at startup. A failed restart left the setting enabled, so the next attempt treated it as already applied and never restarted the daemon. The previous value is restored on failure so the restart is tried again. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): install the CNI image package selected for a Forge sample cluster The Forge sample accepts CNI_PLUGIN=calico, but both node pools always installed the OVN image package. The pre-kubeadm commands now install the Calico images for Calico and the OVN images for OVN. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild CAPD OVN assets when any package is missing capd-image skipped preparing OVN assets when the charts package was present and newer than the script, even if the images or Helm package was gone. It now rebuilds when any of those packages is missing, and still rebuilds when the prepare script is newer than the charts package. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): fail the nico-vms sample create on HTTP errors The create request returned success on a 400 or 401 because curl exits 0 unless --fail is set, and --fail hides the body. The response stays visible, and the script now exits from the HTTP status. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): check the vTPM device in the configured Colima profile The macOS check ran colima ssh without a profile, so a non-default COLIMA_PROFILE could be reported missing or present against the wrong VM. The device checks now use the same profile colima-start.sh prepares. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: default each CAPD OVN package path on its own Setting CAPD_CNI_CHARTS_DEB_PATH skipped the images and Helm packages, so the node image was built without them. Each path is filled in when it is unset, and each one is checked before the image build. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): run container nodes on the kernel Open vSwitch datapath Userspace Open vSwitch encapsulates Geneve but has no port that can emit it, so traffic between container nodes is dropped. Container nodes now load the host kernel module and keep the dummy gateway bridge. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: drop the duplicate /lib/modules mount from CAPD nodes Kind already bind-mounts the host module tree read-only, so listing it again in extraMounts makes Docker reject the node container. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(cli): load the vTPM proxy without sudo when already root The arm64 bootstrap runner executes the job as root, and its sudoers file rejects sudo from root, so the e2e died after the fake nodes were ready. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild the CAPD Helm package when the OVN asset script changes The Helm freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale nke-e2e-helm.deb in place. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): create the sample CAPD cluster through controlPlaneConfig The local controller rejects control-plane node pools, so the sample script's node pool was rejected before a cluster was stored. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: build the CAPD bundle mirror for the Docker daemon's architecture The legacy bundle path defaulted to amd64 OVN packages, so an arm64 daemon was served image debs it cannot install. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(agent): reject an unknown CNI plugin instead of installing OVN The empty-plugin default already lives in the kubeadm init helper. The installer was also rewriting a typo to ovn and mutating the request. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix: rebuild the CAPD OVN images package when the asset script changes The images freshness check compared prepare-ovn-assets.sh with the charts package, so a newer script could leave a stale images deb in place. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(api): waive omitting cniPlugin on cluster create An omitted plugin selects ovn-kubernetes. Clients built against the published spec were required to send the field, so the compatibility gate needs a named waiver. Signed-off-by: Alex Greene <algreene@nvidia.com> * fix(hack): target the configured Colima profile for VM setup SSH, stop, and the failure hints used Colima's default VM, so a non-default profile never received the vTPM module or the Docker limits. Signed-off-by: Alex Greene <algreene@nvidia.com> * docs(agent): note that bare metal also uses the kernel datapath The container check keys off NKE_OVS_DATAPATH_TYPE. An unset variable keeps bare metal and VM nodes off the dummy-bridge path even though they run the kernel datapath. Signed-off-by: Alex Greene <algreene@nvidia.com> --------- Signed-off-by: Alex Greene <algreene@nvidia.com> |
||
|
|
c3fad3abff |
test(ci): use ovn-kubernetes in the default container lane (#1192)
* test(ci): use ovn-kubernetes in the default container lane Signed-off-by: Chao Chen <chaoch@nvidia.com> |
||
|
|
5053fcef67 |
fix(e2e): pull the bundle mirror's images through the Docker Hub mirror (#1222)
Every CAPI lane and the local entrypoint start a bundle mirror on the host: a `docker create` of alpine:3.22 to load the volume and a `docker run` of nginx:alpine to serve it. Both are bare names, so the host daemon, which has no registry mirror on the ARC runners, pulls them from Docker Hub anonymously once per leg. The job logs show it as `Unable to find image 'alpine:3.22' locally` followed by `3.22: Pulling from library/alpine` in every audited run. The local entrypoint also pulls registry:2 for the caches `make capd-up` starts, and runs one more alpine:3.22 to probe the mirror. Add dockerhub_image to backend-e2e-lib.sh: it prefixes an official image with `<mirror>/library/` when NKE_E2E_DOCKERHUB_MIRROR is set and returns it unchanged otherwise. Use it at the five host sites and for REGISTRY_MIRROR_IMAGE in both `make` callers. With the variable unset nothing changes. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
3b0cd6111d |
fix(e2e): put the Tilt lanes' management cluster behind the Docker Hub mirror (#1220)
* fix(e2e): pull the Kind node image through the Docker Hub mirror The management Kind cluster's node image is pulled by the host daemon, which has no registry mirror on the ARC runners. After #1208, #1215 and #1218 this was the last anonymous docker.io pull in every CAPI lane, in local-entrypoint-e2e and in nktp-e2e: one per leg, every run. When NKE_E2E_DOCKERHUB_MIRROR is set, copy the kind config with its `image:` lines rewritten to `<mirror>/kindest/node:...` and create the cluster from the copy. The digest is unchanged, so the pin in cwe-capi-kind.yaml still holds, and the containerd mirror written into the nodes afterwards is unaffected. nktp-e2e now sets the same mirror as the other lanes. Checked on bigbox with the pinned kind v0.32.0: kind logged `Pulling image: mirror.gcr.io/kindest/node:v1.37.0@sha256:a1ed56...`, the control plane was Ready after 18 s, and the image ID matched the docker.io pull. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): put the Tilt lanes' management cluster behind the Docker Hub mirror nico-vms-e2e builds its images through the mirror but creates its management cluster with `make capi-core-up`, a plain `kind create cluster`. The node's containerd had no mirror, so temporal, postgres, alpine, busybox, curl and the local-path helper were all anonymous Docker Hub pulls; helm fetched the Bitnami chart from registry-1.docker.io because the lane never installed the shim; and `make registry-mirror` pulled registry:2 from Docker Hub on the host. About ten anonymous manifest pulls per leg per run, invisible in the job log. Move configure_kind_dockerhub_mirror into backend-e2e-lib.sh, replacing the copies in backend-e2e.sh and local-backend-e2e.sh, and call it in nico-vms-e2e.sh between `make kind-up` and `make capi-core-up`, so nothing the latter starts pulls from Docker Hub directly. Pass a mirror-rewritten kind config to `make kind-up` there and in local-backend-e2e.sh, which covers the node image for local-entrypoint-e2e too. `make registry-mirror` takes REGISTRY_MIRROR_IMAGE, default registry:2; nico-vms-e2e.sh points it at the mirror. The workflow installs the same helm shim local-entrypoint-e2e.yml does. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
02b3333942 |
fix(e2e): pull host image builds through the Docker Hub mirror (#1208)
* fix(e2e): pull host image builds through the Docker Hub mirror The lanes already route pulls inside the Kind nodes and Helm through NKE_E2E_DOCKERHUB_MIRROR, but the host docker builds that make the controller, profiles, DSX mock, capd-reboot-controller and CAPD node images still resolved their bases from docker.io. The arm64 ARC runners share one egress address and their dind daemon has no mirror, so those builds hit 429 as soon as a few lanes ran at once: eight arm64 legs between 22:47Z and 22:59Z on 2026-10-02. Read each Dockerfile's docker.io ARG defaults and pass them as build-args on the mirror; give capd-reboot-controller and the node image the ARG they lacked; pull kindest/node through the mirror too. nico-vms gets the same variable. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): mirror the two remaining Docker Hub pulls and fix the mirror probe The first mirror runs of this change still showed two docker.io pulls. The nkectl bootstrap lane builds the controller image with nerdctl directly in the workflow, outside the lane scripts, and configureDockerHubMirror covers the bootstrap cluster's node rather than the host's containerd; it now passes the same build-args. The CAPNICo provider image is built from the staged module, whose Dockerfile names golang directly with no ARG; install-capnico.sh now feeds BuildKit a copy on stdin with official-image bases pointed at the mirror. build-image.sh's reachability probe treated the registry's 401 token challenge as no answer; it now accepts 200 and 401. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
705db3c214 |
test(controller): exercise DSX identity exchange in CAPD (#484)
* test(controller): exercise DSX identity exchange in CAPD * fix(test): sync identity exchange E2E module * docs(test): explain identity exchange server state * docs(test): describe CAPD identity exchange environment |
||
|
|
824167d1dd |
test(e2e): give capd and nico-containers the same specs (#458)
* test(e2e): give nico-containers the coverage CAPD had alone
The nico-containers row asserted scale and reboot. CAPD's identical 3+1
shape asserted five more, and CAPD was the only backend asserting etcd
encryption or OIDC at all. tenant_test.go's body never branches on
backend, and both backends provision the same kindest node image, so the
gap was table rows rather than capability.
Three earlier failures said what was actually missing, and none of it was
the mock:
- nodePoolLifecycle reported 'unsupported for backend nico-containers'.
That error came from workerNodePoolRequest, which had a branch for
CAPD and one for nico-vms and no third. Added NicoNodePoolRequest,
modelled on NicoVMSNodePoolRequest and delegating to the
buildNicoNodePool the cluster-create path already used.
- postReadyChecks failed on a nil cluster.ControlPlaneVIP. nicoSpec
never set the field where capdSpec and nicoVMSSpec both do. Set it,
defaulting to a new nicoControlPlaneVIP.
- csrApproval passed unchanged.
On that evidence this turns on the rest. The happy-path row adds
nodePoolCascade, nodeReplacement, manualScaleDown and clusterConfig,
which call CWE's node-pool API and read cluster fields.
Encryption and OIDC get their own rows, as they do for CAPD: a cluster
born encrypted cannot also exercise enabling encryption on an unencrypted
one, and brownfield OIDC needs a cluster created with OIDC off.
nico-containers goes 8 specs to 44, and the lane selects 19 to 55. CAPD
is unchanged at 48.
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
* test(e2e): give capd and nico-containers the same specs
The two container-backed backends tested different things. CAPD ran
cp-controller and nico-containers did not; nico-containers ran cascade,
node replacement, manual scale-down and cluster config and CAPD did not.
Neither gap was a capability difference. Both backends use the same
kindest node image, and tenant_test.go's body never branches on backend.
CAPD gains the four validations nico-containers picked up from the
nico-vms rows. They call CWE's node-pool API and read cluster fields.
nico-containers gains cp-controller, which needed:
- nicoControlPlaneControllerSpec: take the base spec, drop the
control-plane pools, set the cluster-level config.
- buildNicoControlPlaneConfig, because buildNicoRequest never copied
spec.ControlPlane.Config into the request, where buildCAPDRequest and
buildNicoVMSRequest both do. Without it the row failed in 0.048s with
'controlPlaneConfig is required when control-plane controller
provisioning is enabled'. It borrows buildNicoNodePool's machine
template rather than repeating it: a NICo control-plane node is
shaped exactly like a NICo pool node. ControlPlaneConfigSpec gains
SubnetIDs, which a container-backed control plane needs and the Forge
fields do not cover.
- A table row, at three control-plane nodes because the rolling-update
spec needs quorum while it rolls.
- A second leg on the lane. cp-controller specs skip unless CWE is
deployed with PROVISION_CONTROL_PLANE_WITH_CONTROL_PLANE_CONTROLLER,
and the flag is deployment-wide, so one CWE cannot serve both modes.
The leg machinery was already generic; only its names were not. The two
label filters are now derived from the backend rather than hardcoded to
capd, and the input is single-runner-control-plane-modes. The old env var
is still read, so nothing breaks mid-rollout.
Both backends now select 53 specs and the sets are identical, checked
spec by spec. Each lane runs 61 of the 197: 11 on the cp-controller leg
and 50 on the node-pool leg, passing on both arches. The only scenarios
left with one backend are the five that need real VMs: os-profiles,
upgrade, cp-rotation, multi-pod-cidrs and parallel-lifecycle.
NICo's timeout goes to 240 minutes. Over two runs the lanes now cost
about the same: CAPD 78 and 89 minutes, NICo 76 and 83.
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
---------
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>
|
||
|
|
0d00d6ea11 |
fix(capd): stop defaulting the node image to the CloudFront bundle server (#389)
* fix(capd): stop defaulting the node image to the CloudFront bundle server The node image defaulted BUNDLE_SERVER_URL and INDEX_FILE_URL to d3mq564cn7sth7.cloudfront.net and baked both into AGENT_ARGS, so every tenant node carried that address for its whole life. The CI runners cannot reach it, which made the default the one setting that could never work there: the agent failed to fetch Calico, no CNI was installed, and clusters timed out. Both are empty now, and the agent flags are only emitted when a server is configured, the same way the SPIFFE flag already worked. An unset bundle server is a supported state: agent.go documents it as InstallBundle being unavailable, and a nico VM already runs that way. NODE_AGENT_BASE_URL and SPIRE_BUNDLES_BASE_URL lose their CDN defaults too. Each is now required by the path that uses it, which fails with the flag to set or the source to use instead, rather than silently reaching a host the caller cannot get to. Callers that need a bundle server set one. Both E2E entrypoints already do, pointing at the mirror they build from public sources. Two callers never did and inherited the CDN: cli/Makefile's ensure-capd-image and Makefile.dev's capd-image, so a plain `make capd-up` baked it in as well. Verified by building the image both ways: unset -> AGENT_ARGS="--disable-mlx5-rescan --secure-server-port 15005" set -> ... --bundle-server-url http://172.18.0.9/ --index-file-url http://172.18.0.9/nke_bundles/Ubuntu_24.04/index.json and by grepping the built image: no CDN string under /etc or /usr/local/bin. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(e2e): run the local entrypoint lane on node image changes The entrypoint builds the CAPD node image through `make capd-up`, so a change under capd-kindest-node/ affects this lane, but its paths filter did not list that directory. The commit before this one changes exactly those files and would not have run the lane that exercises them. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(capd): give `make capd-up` a bundle source of its own Review caught that emptying the node image default broke the manual path. capd-image passed seven variables to build-image.sh and none was BUNDLE_SERVER_URL, so it had relied on the deleted ARG default. The agent installs Calico through FetchBundleFromIndex, and NoCniInstall is set only by the kubeadm bringup test, so a node built that way would have failed CNI with an empty URL. The E2E entrypoints export a mirror and were never affected. A new bundle-mirror target builds the bundle from public sources and serves it on the kind network beside the registry caches, and capd-image depends on it and falls back to its address. A caller that exports its own URLs still wins, which is what both E2E entrypoints do. The Dockerfile now gates each agent flag on its own variable. An index-only build was being dropped: build-image.sh keeps a caller-supplied INDEX_FILE_URL when the bundle server is empty and passes it as a build arg, and the agent lets --index-file-url win outright. Two comments that this branch made wrong: backend-e2e-lib.sh said the mirror saved a run from a CDN default that no longer exists, and cli/Makefile said its job used a public bundle host, which it no longer does. Verified by running the targets: the build failure now propagates rather than serving an empty directory, the mirror answers /index.json, and capd-image produces --bundle-server-url http://172.18.0.6/ --index-file-url http://172.18.0.6/index.json The first attempt derived nke_bundles/Ubuntu_24.04/index.json, which 404s against this layout, so the index is set explicitly. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(capd): pass the whole env to build-image.sh, and share the mirror helper Review caught that the `&&` before the environment prefix made the seven existing assignments a bare assignment list, so they became shell variables and never reached build-image.sh. Only the two after the `&&` did. That put CAPD_NODE_AGENT_LOCAL_BUILD back to auto and dropped COLIMA_DOCKER_HOST, which matters on a Colima host. The mirror address is now computed before the prefix, so the list is unbroken. My own check had missed it: I passed those variables on the make command line, and make exports command-line variables to a recipe on its own, which hid the broken prefix. This one runs `make capd-image` with nothing on the command line. bundle-mirror now calls e2e_start_bundle_mirror from backend-e2e-lib.sh instead of running its own docker. That copies into a named volume rather than bind mounting the working tree, because the daemon that resolves a bind path is not always this host, and it drops the always-restart policy that would have outlived the cluster. kind-down removes the mirror and its volume. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(e2e): run the local entrypoint lane on the inputs it actually uses The lane did not run on the previous head. GitHub matches paths against the push, not the pull request's cumulative diff, and that push touched only controller/Makefile.dev, which the filter did not list. capd-image and bundle-mirror live in Makefile.dev, the mirror runs prepare-capd-bundles.sh, and kind-up brings the management cluster up from cwe-capi-kind.yaml. All three decide what this lane runs, and none was listed. PR 390 changes that kind config and did not run this lane either. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
beb6d03677 |
ci(e2e): fail a leg when a spec skips at run time unexpectedly (#386)
* ci(e2e): fail a leg when a spec skips at run time unexpectedly Ginkgo reports a runtime skip only inside a total that is dominated by label filter exclusions: leg one prints "127 Skipped", of which 126 were never selected and exactly one is a spec that started and gave up. So a spec that quietly stops asserting looks identical to one the filter excluded. Fail on any runtime skip not named in E2E_EXPECTED_RUNTIME_SKIPS, naming the file that skipped. Keyed by file rather than a count, so adding or deleting specs never touches the list: a filter exclusion prints nothing, only a spec that ran and called Skip() does. Both current entries are deliberate, so this changes nothing about today's runs. It stops the next skip arriving unnoticed. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): set CWE_EXPECTED_VERSION so the health version spec runs The new spec floor caught a real gap. The CI entrypoint passes CWE_EXPECTED_VERSION and says so at ci/backend-e2e.sh:228, because without it the health suite's third spec calls Skip("CWE_EXPECTED_VERSION is not set") and the leg still reports success. The local entrypoint never passed it, so that assertion has never run outside CI: Ran 10 of 117 Specs - SUCCESS! 10 Passed | 0 Failed specs skipped at run time that were expected to run: health_test.go Tilt builds CWE with `make build`, which bakes BUILD_VERSION in, so the value comes from the Makefile that computed it rather than a second git describe. controller/Makefile gains a print-% target to read it. The bundle directory moves out of the state directory as well. That directory is what the workflow uploads on failure, and the bundle was 22 MB of the 31 MB it collected, all of it re-downloadable. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |
||
|
|
e48dee270e |
fix(e2e): run the local backend E2E on Linux, and stop it drifting from CI (#368)
* fix(e2e): run the local backend E2E on Linux, and stop it drifting from CI The local entrypoint only ever worked on one macOS setup, and it had drifted from the CI entrypoint in five ways nothing could catch, because no CI job has ever run it. Three things stopped it working elsewhere. It refused any host that was not Darwin, though the macOS coupling was only Colima sizing, the Colima socket and `make colima-up`; Linux runs Docker on the host and the architecture case already handled x86_64. It never changed directory, and `tilt ci` reads its Tiltfile from the working directory, so it only worked from controller/, which failed the same way on macOS from anywhere else. And it never set site_controller_vip, so the Tiltfile handed CAPD tenants the Kind bridge gateway; nothing is bound there on native Docker, so every tenant node's spire-agent got connection refused, never received an SVID, and nke-agent blocked setting up SPIFFE mTLS without binding its gRPC port. CWE then reported the node agent as not ready and no cluster ever provisioned. Only the first two are platform bugs. The rest is drift, so the parts that must not differ now live in controller/hack/backend-e2e-lib.sh, which both scripts source, in the style of agent/scripts/grpcurl-lib.sh: the management VIP, the tilt_config.json writer, the Ginkgo leg runner, the cleanup gate, the label filters and the provider list. Writing that library exposed three more disagreements. The node-pool filters were not the same, and the local one omitted the authentication specs. The local leg runner lacked -ginkgo.fail-on-empty, so a filter matching no spec passed silently. And the local providers omitted capd-reboot-controller while the node-pool leg runs reboot_test.go, which reboots a worker through a label nothing acts on without that controller, so the local entrypoint could never pass its own leg on any platform. The CI script also carried a fourth copy of the provider list, which now defaults from the library. How each entrypoint gets a cluster stays separate on purpose: CI builds every image and runs its tools from an inner container, local uses the Makefile targets and host tools, which is what makes local iteration fast. Adds the CI lane that would have caught all of this, advisory and path-filtered, following the nerdctl leg in nkectl-bootstrap-e2e.yml. Adds `make test-e2e-backend-local` beside the existing `test-e2e-backend-ci`, and `make secrets-check` so the one merge-relevant workflow with no local target has one. Corrects controller/Makefile's help, which promised Colima unconditionally. Verified on Ubuntu 24.04 x86_64 and on macOS 26.5 arm64. On Linux, before: nke-agent never listened on 15005, kubelet stayed inactive, and a run ended 2 passed 1 failed on a 10 minute provisioning timeout. After: the cp-controller leg is 10 passed 0 failed and the cleanup gate is clean. On macOS: the Make 4 guard reports correctly, `gmake preflight` passes, `gmake secrets-check` passes and fails correctly when gitleaks is absent, and the library is exercised under bash 3.2. shellcheck clean at the gate's severity with the warning count unchanged at 24, actionlint clean, docs-check clean, and the new lane is not a gate member. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): pick the SPIRE attestation method from the host The CI entrypoint hardcoded joinToken and the local one defaulted to tpm, so the local entrypoint failed on a GitHub runner. swtpm on the CAPD node needs /dev/vtpmx, the runners do not load the vTPM proxy module, and spire-agent then failed its dependency. The node agent never got an SVID, so every tenant cluster timed out after 10 minutes. Both entrypoints now call e2e_attestation_method, which picks tpm when the kernel that runs Docker can provide a vTPM and joinToken when it cannot. macOS keeps tpm, because colima-start.sh loads the module and refuses to continue without /dev/vtpmx. A Linux host with the module keeps tpm. The runners get joinToken, which is what the CI entrypoint already used. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): serve the CAPD bundle from public sources, not CloudFront The local entrypoint let the node image keep its default bundle server, so tenant nodes fetched Calico from CloudFront at run time. The GitHub runners cannot reach it, the fetch failed, no CNI was installed, and every tenant cluster timed out with "cni plugin not initialized". hack/ci/prepare-capd-bundles.sh already builds the same bundle from public sources, checksum-verified: SPIRE and its TPM plugin from github.com releases, and the Calico manifests from raw.githubusercontent.com. The CI entrypoint has used it all along. The local one now does too, serving it over the kind network and pointing the node image at that address. The mirror serves from a volume rather than a host path, because the Docker daemon does not share the host filesystem on Colima. It is addressed by IP, because tenant nodes are plain containers whose name resolution depends on the host resolver. The run fails if the mirror does not answer, since the node image bakes the URL in and a later failure would be harder to read. flox gains dpkg, which prepare-capd-bundles.sh needs and macOS lacks. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(colima): fail when the VM is smaller than the run asked for Colima ignores --cpu and --memory for a profile that already exists, so a VM created at the old 6 CPU and 12 GiB defaults stayed that size while the E2E entrypoint asked for 10 and 24 and reported the numbers it requested. The tenant control plane then starved: kubeadm reached wait-control-plane and gave up with "context deadline exceeded". verify_colima_size compares the running VM against the request and prints the stop-and-start command, since Colima cannot resize in place. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * build(flox): lock dpkg The manifest gained dpkg in the previous commit. The lock pins what that resolves to, so it belongs in the same branch. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): build the CAPD bundle for the architecture that will run it prepare-capd-bundles.sh downloaded linux-amd64 SPIRE and TPM plugin binaries and labelled the Calico entry amd64. On Apple Silicon the tenant nodes are aarch64, so the agent found no matching index entry and gave up: bundle version not found in index, bundle=calico version=3.30.1 arch=aarch64 and spire-agent, handed x86-64 binaries, exited 1. BUNDLE_ARCH now selects the release assets and defaults to amd64, so the CI runners fetch the same bytes as before. The local entrypoint passes the architecture it already computes for the E2E binary, which is hoisted so the bundle build can use it too. The Calico entry is now labelled na. That bundle holds manifests and a python script and nothing compiled, and ArmArchLabels and AmdArchLabels both accept na, so one entry serves either node. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(e2e): drop tenant nodes an earlier run left behind A failed run leaves its CAPD tenant node containers running, and kube-vip keeps advertising every dead control plane over BGP. The next run's tenant VIP then load balances across control planes belonging to several clusters, so kubectl reaches an API server whose certificate a different CA signed: failed to download openapi: tls: failed to verify certificate: x509: certificate signed by unknown authority That surfaced as a Calico install failure and a provisioning timeout, and it got worse with each failed run. One host had 13 such containers and a next-hop group with six members. The entrypoint now removes them before it starts. Diagnostics are collected into the state directory while the run exits, so nothing is lost. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * ci(e2e): give the local entrypoint lane a bigger box and more time The lane ran on linux-amd64-cpu16 with a 45 minute budget and was cut off mid run. The suite needs about 75 minutes on a developer machine: 15 for the cp-controller leg, 41 for the node pool leg, and the rest for the node image build and the Tilt deploy. It now runs on linux-amd64-gpu-l4-latest-1, which os-image-artifact.yml already uses, with 120 minutes. The actionlint config gains that label, which it was missing, so the checker stops rejecting a runner the repository already depends on. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> * fix(ci): fetch tags so the node agent gets a real version The lane checked out without tags, so `git describe --match 'agent/v*'` found nothing and the node agent version fell back to the short commit SHA. The etcd encryption workflow compares that against a semver and refused it: node agent version "57cd158" on control-plane node ... is older than required version 0.1.26 Four etcd encryption specs failed on that, and they pass on a developer machine because a normal clone has the tags. backend-e2e.yml already checks out with fetch-depth 0 and fetch-tags, so this lane now matches it. Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> --------- Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com> |