feat(engine/k8s): self-bootstrap logs aggregator + collector when missing#3159
Open
qu0b wants to merge 2 commits into
Open
feat(engine/k8s): self-bootstrap logs aggregator + collector when missing#3159qu0b wants to merge 2 commits into
qu0b wants to merge 2 commits into
Conversation
aa47374 to
662e172
Compare
…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.
662e172 to
b8bc628
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CreateEngineflow (kurtosis engine start). When the engine is deployed out-of-band — e.g. Helm/GitOps applying the engineDeploymentdirectly — that flow never runs, so the logs components are never created and per-enclave log collection silently has nowhere to ship to.How
ensureLogsComponents(inlogs_components_bootstrap.go): if the logs aggregator or collector is missing, create it; otherwise no-op.logs_aggregator.Sinks{}), matching theCreateEnginedefault — no behavior change for the normal path.CreateLogsCollectorForEnclave.sync.Mutex-guarded so concurrent enclave-pool fills don't double-create.Kubernetes backend only; Docker/Podman unaffected. The normal
CreateEnginepath 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.