Repository navigation
fix(kubernetes): parallel worker VM provisioning on tenant cluster create - #3177
IvanHunters wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sections (a) and (c) of the existing node-join failure diagnostic pin down WHERE the worker stalled (VMI/DV provisioning versus tenant kubelet CSR). They cannot answer WHY the second Machine was created minutes after the first became Ready, which is the pattern observed in recent tenant-latest / tenant-previous flakes: a 5- to 10-minute gap between Machine №1 Ready and MachineSet.ScalingUp to 2. That gap is only legible in the CAPI controller-manager reconcile timeline. Add section (d) that dumps the last 15m of controller-manager output across cozy-cluster-api (capi-manager, capk-manager, capi-kamaji-controller-manager, capi-kubeadm-bootstrap-manager, cabpt-manager), cozy-kamaji, cozy-kubevirt-cdi, and cozy-linstor, with timestamps and all sidecar containers included. Guarded with \`|| true\` end-to-end so a dead pod never masks the real \`exit 1\`. Diagnostics-only change: the happy path is untouched and never runs these commands. Signed-off-by: Ivan Okhotnikov <[email protected]>
beee9af to
11c025b
Compare
|
The section (d) diagnostics largely duplicate what the e2e harness already captures on failure. On any bats failure, So you can get the root cause without merging anything to
Two things the hand-rolled loop would actually do worse than the existing snapshot:
Suggested path: pull the artifact from a red run, pin the specific reconciler behind the gap, then open the fix PR against |
|
This PR has had no activity for 60 days and was marked |
|
Closed because no activity followed the |
Summary
Tenant Kubernetes clusters currently take ~13 minutes to reach 2 Ready
workers even though a single worker boots in ~5. The recurring
kubernetes-latest.bats/kubernetes-previous.batsnode-jointimeouts (12m budget) are the symptom; the root cause is a 5- to
10-minute gap between "Machine №1 Ready" and "MachineSet.ScalingUp to
2" on the first tenant-cluster rollout — worker provisioning happens
serially instead of in parallel.
This PR is opened as draft and lands in two stages:
logs on failure, so the next CI cycle produces the reconcile
timeline needed to pin the root cause to CAPI / CAPK / Kamaji-CP /
CABPT / CDI / LINSTOR-CSI. Without those logs any chart-side fix
would be guesswork.
run-kubernetes.shwait predicate fix, appendedas separate commits once (1) points at a specific reconciler.
What (so far)
hack/e2e-apps/run-kubernetes.sh:352— extend the existingnode-join failure diagnostic block with section (d): 15-minute
window of controller-manager logs across
cozy-cluster-api,cozy-kamaji,cozy-kubevirt-cdi,cozy-linstor, timestamped,all-containers, guarded with
|| true. Happy path untouched.Why
Sections (a) and (c) tell us WHERE the worker stalled (VMI/DV vs
tenant kubelet CSR). Neither shows WHY the reconcile fired late —
that lives in controller-manager reconcile events and rate-limiter
backoffs.
Snapshot from #3044 CI run 28568334647
demonstrates the pattern:
```
MachineSet.status.conditions[?type=ScalingUp]:
lastTransitionTime: 2026-07-02T06:45:17Z
message: "Scaling up MachineSet to 2 replicas (actual 1)"
```
The first Machine had been Ready since 06:40:39 — a ~5-minute idle
gap before ScalingUp fired, with no visible reconciler activity in the
current diagnostic dump.
Test plan
controller log dump on the next `kubernetes-latest.bats`
or `kubernetes-previous.bats` failure.
the fix in `packages/apps/kubernetes/templates/cluster.yaml`
strategy block and switches the `.status.replicas` wait to
`.status.readyReplicas` in `hack/e2e-apps/run-kubernetes.sh:275`.
each other; both nodes Ready in ~7m.
`kubernetes-previous.bats` both pass on this branch.