Skip to content

DO NOT MERGE — instrument tenant Talos bootstrap timing - #3144

Closed
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
mainfrom
debug/talos-bootstrap-timing
Closed

DO NOT MERGE — instrument tenant Talos bootstrap timing#3144
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
mainfrom
debug/talos-bootstrap-timing

Conversation

@lexfrei

Copy link
Copy Markdown
Contributor

Throwaway diagnostic. Not for merge, not gated — close after the data is captured.

Goal: classify why the tenant worker MachineDeployment md0 intermittently fails its status.replicas=2 wait. md0 is gated on the TalosConfigTemplate existing; this run captures whether the template is late because an input is slow, the talos-reconcile Job pod is slow/stuck (Pending / ImagePull / CrashLoop), the Job is recreated (churn), or the template only lands after the wait times out.

What it does: a background poller (hack/e2e-apps/talos-debug-poller.bash) runs from just before the install through the bringup and, every ~15s, appends a timestamped [TALOS-DEBUG ...] block (against the management cluster) covering:

  • the parent kubernetes-<name> HelmRelease: Ready/reason, attempted revision, install/upgrade failure counters, and per-revision history statuses (the remediation/churn axis);
  • the talos-reconcile Job(s): creationTimestamp + uid (recreation = churn), active/succeeded/failed, backoffLimit;
  • the Job pod(s): phase, waiting reason, running start, restartCount (the slow/stuck-pod axis);
  • the TalosConfigTemplate <rel>-md0 first-appearance timestamp;
  • the four runtime-wait inputs (apiserver Service ClusterIP, talos-ca Certificate/Secret, tenant k8s-ca Secret, management CoreDNS);
  • the MachineDeployment/MachineSet status and events (the "cannot create a new MachineSet when templates do not exist" line lands here).

Scope: wired in from kubernetes-latest.bats and kubernetes-previous.bats (not run-kubernetes.sh) so Test-Impact-Analysis runs only the two kubernetes tests, not the full suite. The md0 wait budget is unchanged so the failure window stays observable; a post-failure tail captures whether the template lands just after.

Reading the output: grep the e2e job log (or the cozyreport artifact) for [TALOS-DEBUG]. Both kubernetes-latest and kubernetes-previous run, giving two samples; md0 is bimodal (sometimes ~46s, sometimes >10m), so a fast run is the happy-path baseline and a re-run may be needed to catch a slow one.

Revert (the two .bats hooks + the .bash helper) once the timeline is captured.

Throwaway diagnostic to capture why the tenant worker MachineDeployment
md0 sometimes fails its status.replicas=2 wait: is the TalosConfigTemplate
late because an input is slow, the reconcile Job pod is slow/stuck, the
Job is recreated (churn), or the template only lands after the wait times
out.

Adds a background poller (hack/e2e-apps/talos-debug-poller.bash) that, from
just before the install through the bringup, every ~15s appends a
timestamped [TALOS-DEBUG] dump against the management cluster: the parent
HelmRelease conditions/remediation counters/history, the talos-reconcile
Job(s) creationTimestamp+uid+status+backoffLimit, its pod(s)
phase/waiting-reason/restarts, the TalosConfigTemplate first-appearance, the
four runtime-wait inputs, and the MachineDeployment/MachineSet status and
events. Wired in from kubernetes-latest.bats and kubernetes-previous.bats
(not run-kubernetes.sh) so Test-Impact-Analysis runs only the two kubernetes
tests instead of the full suite. The md0 wait budget is unchanged so the
failure window is observable; a post-failure tail captures whether the
template lands just after.

Revert once the timeline is captured. Nothing here ships.

Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a22f3cc0-9155-4066-bc3b-c7b370a80794

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch debug/talos-bootstrap-timing

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/L This PR changes 100-499 lines, ignoring generated files labels Jun 30, 2026
@lexfrei

Copy link
Copy Markdown
Contributor Author

Diagnostic complete — it served its purpose. The instrumented run pinned the root cause: an ordering deadlock where the post-install hook that creates the TalosConfigTemplate never runs because the install stalls in its main-resource wait (deadlocked on the cilium sub-release, which needs worker nodes that need the template). The structural fix is #3145. Closing this throwaway diagnostic.

@lexfrei
Aleksei Sviridkin (lexfrei) deleted the debug/talos-bootstrap-timing branch June 30, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant