Skip to content

feat(engine/k8s): self-bootstrap logs aggregator + collector when missing#3159

Open
qu0b wants to merge 2 commits into
kurtosis-tech:mainfrom
qu0b:qu0b/engine-bootstrap-logs-stack
Open

feat(engine/k8s): self-bootstrap logs aggregator + collector when missing#3159
qu0b wants to merge 2 commits into
kurtosis-tech:mainfrom
qu0b:qu0b/engine-bootstrap-logs-stack

Conversation

@qu0b

@qu0b qu0b commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

What

On the Kubernetes backend, have the engine ensure the centralized logs aggregator + collector exist when an enclave's logs collector is created, self-bootstrapping them if they're missing.

Why

The logs aggregator + collector are normally stood up as part of the CLI's CreateEngine flow (kurtosis engine start). When the engine is deployed out-of-band — e.g. Helm/GitOps applying the engine Deployment directly — that flow never runs, so the logs components are never created and per-enclave log collection silently has nowhere to ship to.

How

  • New ensureLogsComponents (in logs_components_bootstrap.go): if the logs aggregator or collector is missing, create it; otherwise no-op.
    • Aggregator is created with the default sink (logs_aggregator.Sinks{}), matching the CreateEngine default — no behavior change for the normal path.
    • Engine namespace is read from the in-cluster ServiceAccount, with a fallback.
  • Called at the start of CreateLogsCollectorForEnclave.
  • Idempotent (no-op when both already exist) and sync.Mutex-guarded so concurrent enclave-pool fills don't double-create.

Kubernetes backend only; Docker/Podman unaffected. The normal CreateEngine path is unchanged because the components already exist by the time an enclave is created.

Note

The hook point is CreateLogsCollectorForEnclave; happy to move the check to a more explicit engine-startup hook if maintainers prefer — flagging for review.

@qu0b qu0b force-pushed the qu0b/engine-bootstrap-logs-stack branch from aa47374 to 662e172 Compare June 15, 2026 18:05
…sing

The centralized logs aggregator + collector are normally created by the CLI's
CreateEngine flow. When the engine is deployed out-of-band (e.g. Helm/GitOps
applying the engine Deployment directly instead of via 'kurtosis engine start'),
that flow never runs, so the logs components are never set up and per-enclave log
collection has nowhere to ship to.

Make the engine self-sufficient: on enclave creation, ensure both components
exist and (re)create them if missing. Idempotent (no-op when both already exist,
so the normal CreateEngine path is unchanged) and mutex-guarded so concurrent
enclave-pool fills don't race. Kubernetes backend only.
@qu0b qu0b force-pushed the qu0b/engine-bootstrap-logs-stack branch from 662e172 to b8bc628 Compare June 15, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant