Repository navigation
Conversation
| // https://github.com/lf-edge/eve/pull/5971. | ||
| httpsClient := &http.Client{ | ||
| Transport: &http.Transport{ | ||
| TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec // lgtm[go/disabled-certificate-check] |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 17.0-stable #7058 +/- ##
===============================================
+ Coverage 23.73% 24.36% +0.63%
===============================================
Files 517 528 +11
Lines 95847 97461 +1614
===============================================
+ Hits 22747 23748 +1001
- Misses 71164 71816 +652
+ Partials 1936 1897 -39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
eriknordmark
left a comment
There was a problem hiding this comment.
Half of #6796 (pillar, not kube-init) never reached 17.0-stable since it depended on this go daemon. It makes sense to add those commits in this PR to avoid it getting forgotten (since it looks like it has already been backported).
@eriknordmark good catch! I added missing commits to the PR |
|
@rucoder Please rebase on the latest upstream/17.0-stable so that we can trigger evetests. |
126494d to
ee47d97
Compare
@milan-zededa done! |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
All eve-k tests passed, with the exception of TestVMAppPurgeDuringFailover, which is a known issue that remains unresolved: #6610
Test results: https://github.com/lf-edge/eve/actions/runs/44537571141
All other eve-kvm test failures are known, already documented in the 17.0-stable nightly ledger, and unrelated to this PR.
So, from a testing perspective, we're good to proceed with the merge.
|
We'll ignore the two yetus -1 votes. Both issues are already present in master, and keeping this port identical to master is more important than diverging to silence them.
|
This comment has been minimized.
This comment has been minimized.
|
Correction to the
|
|
I cancelled the re-run of the evetest workflow (run 44593997184, attempt 2): its Each of them deadlocked right after skipping its first subtest listed in That is a bug in the evetest harness, fixed in 17.0-stable by c6776e7 ("evetest: fix deadlock when a suite subtest is skipped by EVETEST_SKIP", #7180). This PR's branch predates the fix, and the tests run the evetest code of the PR, so any run of it hangs the same way whenever a suite subtest is skipped. Re-running this old run would hang again. If you wish to run evetest on this PR again, please rebase it onto the current 17.0-stable first, then comment |
During the single-node to multi-node transition, and on any later leader election such as a node failover, k3s restarts and the embedded etcd reforms. A transiently-behind kube-apiserver watch cache can then serve a reconnecting informer a successful but incomplete watch stream, silently dropping a window of events with no "410 Gone" to force a re-list. CoreDNS runs its kubernetes informer with resync disabled (resyncPeriod = 0), so the lost Service events are never backfilled: Services created in that window stay permanently NXDOMAIN, which breaks CDI upload and app volume deployment on the freshly formed cluster. Serving LIST/WATCH straight from etcd removes the stale-serve path: a reconnect either resumes cleanly or gets an honest 410 that forces a re-list. Ship a config.yaml.d drop-in that appends watch-cache=false to kube-apiserver-arg (the "+" suffix appends rather than replacing the base args), installed by cluster-init.sh only in edge-node-cluster mode so single-node keeps the cache. Edge clusters are small, so the cache buys little; the control-plane cost was benchmarked and found negligible at realistic load. Signed-off-by: Paul Gaiduk <paulg@zededa.com> (cherry picked from commit 27496ff)
Direct deps kube-init's typed client-go and containerd usage
relies on:
k8s.io/api v0.34.1
k8s.io/apimachinery v0.34.1
k8s.io/apiextensions-apiserver v0.34.1
k8s.io/client-go v12.0.0+incompatible (aliased to v0.34.1
via replace)
github.com/containerd/containerd/v2 v2.2.5
github.com/containerd/errdefs v1.0.0
k8s.io/kube-openapi's own go.mod aliases v0.31.0 as its module
version, but the repo never publishes that as a tag — the pseudo
below is what actually exists on the repo and is what our replace
directive points at.
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
(cherry picked from commit 66f1559)
The primitives kube-init's FSM writes to persistent storage: - Marker: typed filesystem-path values (LonghornInitialized, NativeKubernetesMode, MultusInitialized, …). IsMarked / Mark / Unmark route through AtomicWriteFile so partial writes never leave a half-marker. - AtomicWriteFile: temp-file + rename atop the destination, with an fsync in between so the on-disk state matches the return value even across a crash. - Reboot: the daemon's controlled reboot path. Writes a marker naming the reason before invoking the reboot binary so the next boot can consult the reason without racing the boot sequence. - K3sKubeconfig / ContainerdSocket / SealedDirName: canonical paths every subsystem shares. Constants (not vars) so a subsystem cannot accidentally rewrite them at test time. - ToK8sName: kubernetes-node-name transform (lowercased device UUID). Load-bearing for cross-subsystem consistency — the FSM's node-uuid label, monitor's reapply, tiebreaker's node-lookup, and Longhorn's node-object all agree on this spelling. The /var/lib snapshot itself lives in its own commit; what is here are the primitives it is built on. state also carries the operator wait items: a named point the FSM will block at until released, used to hold a node mid-transition while it is inspected. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit f89ab6b)
A node that joins an HA cluster has its /var/lib overwritten with
cluster-mode state: different certs, a different node identity and a
different datastore. Converting it back to a standalone node is
therefore not a reconfiguration but a restore, so each node captures its
pre-cluster /var/lib during its own first boot, while it is still
standalone, and the conversion puts that tree back.
What is captured is node identity, not the whole tree: server/tls,
server/cred, the cluster token and agent/. Everything else under
/var/lib is re-derivable — the unpacked k3s bundle, CNI binaries and k3s
binaries alone account for ~419MB of a ~443MB tree and are reproduced by
the install path. kubelet/ is deliberately excluded: restoring it is
worse than not, since a stale cpu_manager_state breaks kubelet on the
next boot.
The datastore is the one file written continuously, so it cannot be
copied byte-for-byte underneath a live writer. It is captured with
SQLite's VACUUM INTO, which produces a single self-contained,
online-consistent file, so the snapshot is taken with k3s running and
nothing has to be stopped or quiesced to get a usable copy. Note this is
kine/SQLite rather than etcd: server/db/etcd/ is a vestigial stub on a
single-node server, so `k3s etcd-snapshot` does not apply.
Restoring is an overlay copy, which means anything the snapshot does not
contain survives it, and cluster-mode leftovers have to be removed
explicitly:
server/db/etcd a real etcd member directory next to a restored kine
datastore gives k3s two conflicting datastores, and
makes etcdClusterInitialized() report a bootstrapped
cluster that no longer exists.
state.db-wal/-shm SQLite treats a -wal beside a database as that
database's own journal and replays it on open, so a
cluster-mode journal feeds pages into the restored
file: it grows past its snapshot size,
integrity_check reports "invalid page number", and
k3s dies with "database disk image is malformed" on
every start with no way back. VACUUM INTO never
writes these, so removing them is unconditional.
Longhorn replicas replicas under /persist/vault/volumes belonging to
volumes the restored cluster knows nothing about
would otherwise be adopted by a single node that
cannot serve them.
Component markers are part of the restored state. The snapshot is taken
before they are written, so a restored tree reads "components installed,
not yet initialised" and the next boot re-runs initialisation against
the datastore it actually has.
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
(cherry picked from commit a96859d)
…ntainerd wait Everything that must be ready before k3s can start. The FSM sits in INSTALLING → STARTING_CTRD while this package runs; a failure here aborts the boot rather than starting k3s on a broken substrate. - Kernel modules loaded via modprobe (bridge, iptables_nat, iscsi_tcp, etc.). Absent kernel bits surface with the specific module name so operators can spot a kernel-config regression. - cpu_manager_state cleanup: kubelet sometimes leaves a stale cpu_manager_state under /var/lib/kubelet after a reboot with a changed --cpu-manager-policy. Deleting it on every boot before containerd starts is upstream-blessed cleanup. - Cgroup mount: /sys/fs/cgroup, kubepods.slice hierarchy. - iSCSI daemon start (needed for Longhorn's block-mode volumes). - Vault wait: pillar's vaultmgr signals "ready" via a fs marker; the daemon blocks here until the marker is present so k3s does not race the vault-mount. - EdgeNodeInfo wait: blocks until the pubsub subscription delivers the device identity (DeviceName / DeviceID). - Containerd start + reachability probe. Everything is idempotent — the FSM re-enters INSTALLING on recycle without expecting a clean state. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit c6521d1)
Every EVE-k cluster ran k3s's servicelb and Traefik, exposing Traefik on 80/443 of every node address. kube-init writes the local-storage drop-in with a bare "disable:" key, which replaces the base config's servicelb and traefik entries instead of adding to them. The "disable+" fix went into the copy under cfg-manifests, which kube-init never reads, so the dead copy is removed. A unit test renders the drop-ins kube-init writes beside the base config, applies k3s's merge rule, and fails if servicelb or traefik is no longer disabled, or if a shipped drop-in shadows a rendered one. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 7fddaf2)
…ng labels
reapplyNodeLabels patched and read back the Kubernetes Node using the raw
device name. k3s registers the node under state.ToK8sName(deviceName),
lowercased with underscores turned into dashes, so for any device whose
name has an uppercase letter or an underscore ("Dell-5810-3") the patch
failed every tick:
warning: reapply node labels+annotation: nodes "Dell-5810-3" not found
This is the re-stamp path for the node-uuid label and the Longhorn
default-disk label and annotation. The single→cluster transition clears
NodeLabelsInitialized precisely so this runs again, because a node that
installed Longhorn in an earlier single-node life keeps its
LonghornInitialized marker and never re-runs the install-time stamping.
With the re-stamp failing, a node added to an existing cluster never gets
node.longhorn.io/create-default-disk, Longhorn creates no default disk
for it, and any app volume scheduled there stays pending, leaving the app
stuck in LOADING.
Use state.ToK8sName(m.deviceName) for the patch, the read-back and the
log lines, as every other node lookup in kube-init already does. The
shell cluster-init.sh labelled "$HOSTNAME" and did not have this problem;
it came in with the Go rewrite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: vignesh-zededa <vignesh@zededa.com>
(cherry picked from commit 5e153e0)
Bumps [github.com/moby/sys/user](https://github.com/moby/sys) from 0.4.0 to 0.4.1. - [Release notes](https://github.com/moby/sys/releases) - [Commits](moby/sys@user/v0.4.0...user/v0.4.1) --- updated-dependencies: - dependency-name: github.com/moby/sys/user dependency-version: 0.4.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> (cherry picked from commit a4cbd44)
kube-init lifts EVE's CPU confinement while a first boot deploys k3s and its components, and restores it once the node is running. It widens /eve, /eve/services and every service leaf, but not /eve/containerd. containerd now has a cpuset of its own (ctrd_max_vcpus, one CPU by default), and the user containerd is the CRI runtime k3s uses: it pulls and unpacks every image the first boot deploys. Widen and restore its cgroup with the services, when 010-eve-cgroup created one. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit d0f8eb9)
CDI importers only added the cluster-wide trustedCAProxy bundle to their trust pool when the DataVolume also had a certConfigMap (fixed upstream in lf-edge#4109, first released in v1.66.0). Without it, an HTTP DataVolume without a certConfigMap fails with "proxyconnect tcp: x509: certificate signed by unknown authority" through mgmtproxy's cni0 listener, even though the CA is published and mounted at /proxycerts. v1.66.1 is the latest release. The operator manifest still references the same seven images already preloaded by kube-init. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Milan Lenco <milan@zededa.com> (cherry picked from commit c5248c8)
CDI was only deployed together with KubeVirt, which is amd64-only. But pillar creates every EVE-k app volume as a PVC filled through a CDI upload, including NOHYPER apps that run as plain pods, and holds volume creation until CDI is ready. On arm64 nodes app instances therefore sat in LOADING forever, with no error reported. Track CDI with its own installCDI flag, set unless the node is in native-kubernetes mode, and give it its own block in the deploy graph. Nodes that finished first boot without CDI never re-run the deploy graph, and the component update pass skips components that are not installed. Add EnsureCDI to the steady-state tick: it installs the operator, then the CR once the operator is available, one step per tick, and leaves the node alone while a K3sBase conversion is removing CDI or after it did. The CDI proxy patch now keys off the CDI CR existing instead of the KubeVirt marker, so arm64 importers get the mgmtproxy config too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 6a33fb4)
…igration On the bootstrap node the single→cluster transition restarts k3s with --cluster-init, which migrates the sqlite datastore into a new embedded etcd. The new etcd numbers its revisions from the keys it copied, well below the last kine resourceVersion (observed: 5168 before, 2313 after). The pods keep running across the k3s restart, since they live in the user containerd, so every reflector resumes its watch from a resourceVersion that is now in the future and silently drops events until etcd counts past it. Longhorn is where this shows. A Volume CR created after the transition never reaches longhorn-manager's cache: its post-create existence check times out with "not found", every CSI CreateVolume retry after that gets "already exists", and the app volume's PVC upload fails. pillar reports it as "PVC Upload ... attempts to upload image failed, engine not deployed on node", because the volume never got an engine. Every app deployed within minutes of forming an ENC cluster on a single node was exposed; how many failed depended on how far the old resourceVersion ran ahead. Arm a marker when the bootstrap config is provisioned, and have the health worker delete the controller pods on this node once the API is back: Deployment-owned pods in kube-system, longhorn-system, cdi and kubevirt, plus the longhorn-manager and virt-handler DaemonSet pods. Their replacements list from the new etcd. Data-path pods (instance-manager, engine-image, csi-plugin), node plumbing (multus, kube-vip) and the app namespace are left alone, so running volumes and VMs are not interrupted. Joining nodes skip this: their old pods do not exist in the cluster they join, and the kubelet removes them. Only pods created before the marker's mtime are selected. The marker is armed after k3s stops for the transition, so a newer pod already listed from the new etcd, and a retry after a failed delete or an unreachable API never recycles the fresh replacements again. The pass also checks spec.nodeName itself, not just through the field selector. The marker is cleared once every stale pod is gone, and stays armed while the API is unreachable. The pass reaches the API through a two-method interface (list this node's pods, delete a pod), so its tests use a small in-memory fake rather than the client-go fake clientset and everything it would vendor: only this node's pre-migration controller pods go, data-path and newer pods stay, a failed delete keeps the marker armed, and the cutoff is the marker's mtime rather than the time of the pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vignesh-zededa <vignesh@zededa.com> (cherry picked from commit c8414b0)
…ycled Between k3s returning from a single→cluster transition and kube-init's first health tick recycling the controller pods, the Longhorn, CDI and KubeVirt Deployments are all Running and Available, still watching the pre-migration datastore. An app volume created in that window hits their stale caches, or is cut by the recycle a few seconds later. - kube-init mirrors its controller-restart marker as /run/kube/controller-restart-pending, on the /run bind shared with pillar; /var/lib is not visible to pillar, and is a ZFS zvol on some devices. It is set together with the marker, re-created each tick while the marker is armed (/run is tmpfs), and removed when the recycle is done. - kubeapi exports ControllerRestartPending (a stub on non-EVE-k builds), and ClusterStorageReadyForVolumes reports not-ready while it is set. - volumemgr's clusterStorageReady checks it ahead of its cached answer, which otherwise latches true for good. pillar is not restarted by the transition, so a node that served volumes in single-node mode would never re-probe. While the marker is set it returns not-ready and drops the cache. The marker goes as soon as the deletes succeed, before the replacement pods are up, so the next probe must wait for the CDI Deployments to be available again. The marker path is spelled out in both modules, which cannot share a constant. It is documented once, under "Markers shared with pillar" in the kube-init README, and pinned in a test on each side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: vignesh-zededa <vignesh@zededa.com> (cherry picked from commit a407274)
longhornNodeCreate only set metadata.name, leaving spec.name empty. Longhorn's own node controller reads node.Spec.Name (not metadata.name) in shouldEvictReplica, so every reconcile hit "no node name provided to check node down or deleted" and errored out before persisting the node's computed disk status -- leaving status.diskStatus permanently null and blocking auto-salvage forever. Set spec.name to match metadata.name, as Longhorn's own CreateDefaultNode does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Milan Lenco <milan@zededa.com> (cherry picked from commit 07070ee)
kubeclient set no rest.Config.Timeout, because that timeout also cuts open watch streams. Without it, an API call whose context has no deadline waits forever on an apiserver that accepts the connection and never answers. Give the request clients a 90s Timeout. This is longer than the apiserver's own 60s request timeout, so it only stops a call that gets no answer. Add watch clients without the timeout. Use them for the informer factories, the Longhorn wait informers and the kubectlx waits. The discovery client keeps the 32s default that client-go applies when the config has no Timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Durbin <andrewd@zededa.com> (cherry picked from commit a32ead2)
podExec runs from the monitor tick, whose context has no deadline. kubeclient's requestTimeout does not cover exec, so a stuck exec can stop the health checks. Give each podExec a 60s deadline. The SPDY executor ignores the context while it waits for the upgrade response, so try the WebSocket executor first. It applies the deadline to the handshake too. SPDY stays as the fallback for an apiserver that refuses the WebSocket upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Durbin <andrewd@zededa.com> (cherry picked from commit ed0b52e)
On a single-node EVE-k device, k3s stores its state in sqlite through kine. kine keeps lease expiry timers in memory and, at every k3s start, sets each key's expiry to the start time plus its lease. With event-ttl at 72h, a device that reboots more often than every three days never expires an event. On sc-sm-e300-10, which reboots several times a day, 26 days of events accumulated: 295600 of 298249 rows and 236 MiB of the 644 MB datastore. kine lists scan the whole name index, so every list and every compaction gets slower as the table grows, and listing the events no longer finishes within two minutes. A 1h TTL is shorter than a typical uptime, so events expire within an hour of each k3s start, including those carried over from before a reboot. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj (cherry picked from commit 01073b8)
Lowering event-ttl only affects events written afterwards: kine stores each event's lease in its row and re-arms expiry from that lease at every k3s start. On a device that reboots more often than every three days, events written under the former 72h TTL therefore never expire, and an upgraded device keeps its whole backlog. Before starting k3s, kube-init now deletes the events that carry the 72h lease and vacuums the datastore if any were removed. Events from a user override with a different TTL are left alone. On sc-sm-e300-10 the same deletion, done by hand, removed 297835 events in 42 s and shrank the datastore from 644 MB to 81 MB. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyjigXVFZhuUg5LiRSVwsj (cherry picked from commit 6babf29)
17.0-stable added two shell-era helpers that master never had, because master already ran kube-init when the matching fixes landed: - cluster-status-probe, the client half of the authenticated cluster status server (lf-edge#6753). kube-init's k3s/statusauth.go derives the same credentials in-process. - cni-state-utils.sh, which clears the retired pod subnet when a node joins a cluster (lf-edge#6727), with its host-side test and the `make -C pkg/kube test` target that ran it. kube-init's clustermode does the same cleanup. Nothing in the kube container runs either one any more; remove them, the Dockerfile stage that built the probe, and the Makefile and README references. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Three earlier 17.0 backports carried master commits whose pillar half names kube-init as the other side of a contract, and reworded those comments to name cluster-init.sh or cluster-status-probe, which ran on this branch then: - lf-edge#6584 (master 5327945): mgmtproxy's cni0 token and TLS cert, read by kube-init's mgmtproxy.PatchCDIProxyConfig. - lf-edge#6753 (master 042622f): the cluster status server credentials, derived again in kube-init's k3s/statusauth.go. - lf-edge#6917 (master a407274): the controller-restart marker, written by kube-init's clustermode.ControllerRestartPending. kube-init now owns all three, so restore master's wording. Comments, docs and one test failure message only; no code change. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
kube-init's go.mod says go 1.25.12, the toolchain master's eve-alpine ships. 17.0-stable's eve-alpine has Go 1.25.11, so the kube image build stops with "go.mod requires go >= 1.25.12 (running go 1.25.11; GOTOOLCHAIN=local)". Nothing needs 1.25.12: the go directive is the minimum language version, every other module in the tree declares go 1.25.0 on both master and 17.0-stable, and no kube-init dependency asks for more than 1.25.0. Declare the same. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
kube-init came over from master with pillar pinned at a master commit, which is not on 17.0-stable. Pin pillar at the current 17.0-stable head instead, using go get, go mod tidy and go mod vendor only. kube-init uses nothing from pillar that 17.0-stable lacks, so no pillar change has to land first. go get also moves eve-api, otel, logr and genproto to the versions this pillar requires. tidy marks golang.org/x/sys as a direct dependency, since kube-init imports it itself. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
The instance-manager gate is satisfied as soon as its CR reports Running, often seconds after the pod starts -- before Longhorn's disk monitor has ever run for that node. For a v1 (filesystem) disk, that monitor itself requires a running instance-manager, so a fresh one can pass the existing gate while Status.DiskStatus stays nil indefinitely, since nothing retriggers the monitor once the window passes. Observed live: a descheduler-driven VMI move landed a volume on a node 4 seconds after its instance-manager started, and the replica controller failed forever with "cannot find disk name for replica" -- even though longhorn-disk.cfg on disk held the correct UUID throughout. Add a gate requiring every disk in Spec.Disks to have a Status.DiskStatus entry with a recorded DiskUUID, and at least one of them to have a True Ready condition, the exact condition that stayed unmet. Only one ready disk is required so that a recorded but degraded disk does not strand a node that can still host replicas, matching the any-disk semantics of checkLonghornSchedulable. The gate lives in checkLonghornReady, so it applies to all of its callers, not only the descheduler: ClusterStorageReadyForVolumes (volume creation), WaitForLonghornReady (the CSI attach wait) and the components-ready poll. All of them need the node's disks resolved before replicas can be placed or attached. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Milan Lenco <milan@zededa.com> (cherry picked from commit 638874a) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
The kube linuxkit package now ships a Go daemon in place of the shell path. Adds a kube-init build rule that DOCKER_GO-invokes `go build ./cmd/... .` inside pkg/kube/kube-init/, staged into pkg/kube/dist/ before the linuxkit pkg build. pillar-* targets are unchanged. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit a7cdcba) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
kube-init's vendor tree is upstream Go modules with well-known licenses; the SPDX generator's per-file scan blows out on the tree size without adding value. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit d1b6f47) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
The kube-init daemon is its own Go module, and make test enumerates its modules explicitly, so none of kube-init's tests have ever been executed by the target — the package ships a test suite that no CI path runs. The container build only compiles the binary, and no workflow names the module either, so the gap is invisible short of noticing the absence in the log. Add it alongside the other per-module invocations. The suite needs ./... because kube-init's tests live in its subpackages rather than at the module root, unlike the newlog and edgeview entries above. Runs green under -race in about 75 seconds. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 3ef0d4a) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
domainmgr retries WaitForKubernetes forever while the KubeVirt CR is not Available on single node and replicated storage clusters. KubeVirt is only installed on amd64, so on arm64 eve-k domainmgr never gets past startup, never subscribes to DomainConfig, and every app stays in Booting. Apps on those arches run as pods, so skip the KubeVirt readiness gate there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit e700961) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
A NOHYPER app on eve-k runs as a pod whose container image is loaded locally into containerd (PullNever). The pod does not read the app's PVC at all. After a reboot, contentTreeSatisfiedByPVCs sees the app's PVC already filled and accepts the content tree as REMOTELOADED, so the image is never downloaded and ingested again. The volume adopts the PVC, the pod is started and fails forever with ErrImageNeverPull. Never accept a content tree from PVCs when a native container volume references it, and don't take the PVC adoption fast path for such a volume either: it waits for the image like before, and the CSI handler reuses the existing, fully uploaded PVC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 1e3232b) Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
When a node goes down, the virt-launcher pods of its VM apps stay in Terminating and KubeVirt often does not create a replacement. After two minutes checkAppsFailover() then scales the VMIRS to 0 and back to 1 to get one scheduled, but only on the node for which isDecisionNode() is true, which followed the eve-kube-stats-leader lease. That lease runs with a 300s duration. If the node that died was the stats leader, no survivor can acquire it for up to five minutes, and no node is allowed to do the reset in the meantime. This was hit on a 3-node cluster where the powered-off node had been the stats leader for two days: the pods went Terminating at 08:47:57 and the reset was due from about 08:50:50, but dell-5810-2 only took the lease at 08:52:17, reset the VMIRS at 08:53:04, and the replacement pod was created at 08:53:17, almost six minutes after the node was lost. The eve-app-op election was added for exactly this: deciding the one node allowed to act for an app whose node is down, with a 60s lease so the handover never dominates the outage, and with the tie-breaker excluded. Make isDecisionNode() follow it. The stats lease remains in use for the stats collector, the node-prune sweep and the other existing readers, none of which need a fast handover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 902a643)
checkAppsFailover() enters its "failover start" branch for every app scheduled on this node that is not yet running, whether or not an old copy of its pod is Terminating anywhere. For an app that is just booting (pod in Init, for example) it then calls DetachOldWorkload() with an empty node and app domain name, which returns at once with "a node name is required", and logs "failover start/complete for appDomainName: " with an empty name every 10 seconds. It also keeps checkStuckPendingVMI() suppressed for that app although no failover is landing on this node. These spurious lines showed up on the failover node while debugging a slow failover, and made the real failover activity harder to find. Require a terminating pod before taking this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 007a6ed)
ee47d97 to
4604861
Compare
|
Evetest: Claude chose to skip 19 test/suite name(s) as unrelated to or redundant for this PR. Which ones and why: run summary. Comment |
TestUpgradeSuite: failures likely caused by this PRTestEVEUpgradeKubevirtToKubevirtFailureClaude's conclusionRoot causeLive inspection of the paused device confirms k3s itself came up fine ( The PR diff is a wholesale rewrite of Given the PR squarely rewrites the exact component-installation ordering/timing logic responsible for the observed symptom, but I can't fully rule out this being an instance of the same underlying environmental resource-starvation issue that predates the PR, I judge this as plausibly PR-caused rather than clearly so. |
Description
Backport kube-init, the Go daemon that replaced
cluster-init.shon master (#5971), to 17.0-stable. 17.0-stable still runs the shell version. Every kube fix on master since #5971 lands in kube-init, so each one has had to be rewritten in shell to reach 17.0: #6584, #6727, #6753, #6832, #6886, #6887 and #6917 all were. 17.0 also misses the kube-init fixes nobody rewrote. With kube-init on 17.0-stable, master's kube fixes cherry-pick as they are.Backport of #6116, #5971, #6309, #6449, #6456, #6499, #6507, #6542, #6590, #6599, #6614, #6652, #6665, #6702, #6704, #6755, #6771, #6794, #6796, #6860, #6861, #6897, #6934
This is a single PR. The earlier plan (#7055 and a re-vendoring PR first) is dropped together with #6697, which is not being backported: kube-init does not use cnirpc or anything #6697 added.
What it contains, in order:
make testruns kube-init's unit tests,.spdxignoreskips its vendor directory, andmake rungives the QEMU VM 8 vCPUs instead of 4.eve-app-oplease instead of the 300s stats lease, so failover is not held back for up to five minutes when the dead node was the stats leader.cluster-status-probeandcni-state-utils.sh, the shell-era helpers that [17.0-stable] evetest: port scans; fix the exposure they found on EVE and EVE-k #6753 and [17.0-stable] kube: clear the retired pod subnet when a node joins #6727 added on 17.0 only; kube-init does both jobs in-process.go 1.25.0in kube-init's go.mod, like every other module on 17.0-stable. Master'sgo 1.25.12did not build with 17.0-stable's Go 1.25.11 before the 1.26.10 toolchain bump.go get,go mod tidyandgo mod vendor. It came over pinned at a master commit.Not included:
tools/bump-and-commit.shfinds no package hash to update.Backported commits
Cherry-picked with
-xfrom master, grouped by master PR:#6116
#5971
#6309
#6449
#6456
#6499
#6507
#6590
#6542
#6599
#6614
#6652
#6665
#6704
#6755
#6771
#6794
#6796 (zedrouter commit already on 17.0-stable via #6797)
#6861
#6702
#6860
#6897
#6934
17.0-only commits, not cherry-picks:
How to test and validate this PR
Automated, in CI:
make testnow runs kube-init's unit tests, and the eve-k build compiles the daemon.Done locally:
make pkg/kubeandmake pkg/pillarbuild.-race(the commandmake testruns). The pillar unit tests for kubeapi, volumemgr, domainmgr and zedkube pass, including the new Longhorn disk-status and native-container tests and eve-k: fix VM failover held back by the stats lease and a false portmap overlap #6796'sTestIsDecisionNodeFollowsAppOpLease.go vet -tags k ./...on pillar is clean.tools/bump-and-commit.shfinds no package hash to update.Still to do on eve-k hardware (amd64 and arm64):
cluster-init.sh) to this build: kube-init takes over the existing k3s state without reinstalling, and the apps keep running.Changelog notes
eve-k: cluster bring-up and update now run in the Go kube-init daemon instead of
cluster-init.sh, as on master. It brings the fixes made to kube-init on master since, plus Longhorn readiness and arm64 app deployment fixes.Fixed VM app failover on eve-k clusters being delayed by up to five minutes when the failed node was the cluster's stats leader.
Checklist