Skip to content

fix(observability): make a cold install-observability succeed from zero - #34

Merged
scotwells merged 1 commit into
mainfrom
fix/observability-cold-install
Jul 19, 2026
Merged

fix(observability): make a cold install-observability succeed from zero#34
scotwells merged 1 commit into
mainfrom
fix/observability-cold-install

Conversation

@scotwells

@scotwells scotwells commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Problem

task install-observability on a fresh cluster fails partway through and needs manual recovery to finish. Independent causes, each of which aborts the install on its own.

Fixes

1. OTel Collector CR install was racy — now ordered and retried. The OpenTelemetryCollector CR was listed in components/observability/kustomization.yaml, so the task's first kustomize build | kubectl apply tried to create it before its CRD/webhook existed (no matches for kind). The task does also apply it in a dedicated step — but that step only waited for the operator HelmRelease Ready + CRD Established, and neither guarantees the operator's admission webhook is serving with an injected caBundle (both are async after the Helm install), so it still failed with an x509 / no endpoints webhook error on a cold cluster. Fix: drop the CR from the bundle (so it is installed exactly once, in order), and in the dedicated step wait for the operator Deployment to be Available and retry the apply until the webhook is ready.

2. cert-manager cainjector OOMKilled. cainjector caches every CRD/APIService/webhook to inject CA bundles, so its memory scales with cluster object count. At 64Mi it OOMKills (exit 137) once the stack's CRDs/webhooks land — and until it's healthy it never injects the OTel operator's webhook caBundle (cause #1's x509). Raised to 256Mi.

3. Loki HelmRelease never went Ready. The Loki chart enables memcached chunk/results caches by default, each requesting ~8-9Gi, which stay Pending (Insufficient memory) on a single-node cluster and hold the Loki HelmRelease not-Ready — so wait helmrelease/loki fails even though everything else is up. Disabled both caches (unneeded for the SingleBinary + filesystem dev setup).

How the collector is installed now

Still installed as part of install-observability — just once, in order. It was being applied twice: prematurely in the bulk kustomize build | kubectl apply at the top of the task (before its CRD/webhook existed → the cold-start failure), and again in a dedicated step. This drops the premature bundle copy and keeps the dedicated step, which now (a) waits for the CRD Established, (b) waits for the operator Deployment Available, and (c) retries kubectl apply of the CR until the admission webhook accepts it — then waits on the collector DaemonSet rollout. components/observability has no other (e.g. Flux/GitOps) consumer, so this is the single install path.

Result

task install-observability completes clean from a fresh cluster with no manual intervention.

Verification

Applied all of this on a live cold install: cainjector stable at 256Mi, OTel Collector DaemonSet Ready, and end-to-end telemetry confirmed — assistant metrics scraped into Victoria Metrics (up{job="assistant"}=1) and traces landing in Tempo.

@scotwells
scotwells force-pushed the fix/observability-cold-install branch from d392c0b to db7b38c Compare July 19, 2026 15:42
Installing the observability stack on a fresh cluster fails partway through
and needs manual recovery. Independent causes, all fixed here:

- OpenTelemetryCollector CR install was racy. It sat in the kustomize bundle,
  so the first `kustomize build | kubectl apply` created it before its CRD and
  webhook existed. The task already applies it in a dedicated step, but that
  step only waited for the operator HelmRelease Ready + CRD Established —
  neither of which guarantees the operator's admission webhook is serving with
  an injected caBundle (both are async after Helm install), so it still failed
  with x509 / "no endpoints" on a cold cluster. Fix: drop the CR from the
  bundle, and in the dedicated step wait for the operator Deployment and retry
  the apply until the webhook is ready.

- cert-manager cainjector OOMKilled (exit 137) on its 64Mi limit once the
  stack's CRDs/webhooks landed, so it never injected the OTel operator's
  webhook caBundle. Raise the limit to 256Mi (its footprint scales with
  cluster object count).

- Loki's default memcached chunk/results caches request ~8-9Gi each and stay
  Pending on a single-node cluster, leaving the Loki HelmRelease permanently
  not-Ready. Disable them — unneeded for a SingleBinary + filesystem setup.

After this, `task install-observability` completes clean from a fresh cluster
with no manual intervention.
@scotwells
scotwells force-pushed the fix/observability-cold-install branch from db7b38c to e927ca4 Compare July 19, 2026 15:44
@scotwells
scotwells requested a review from ecv July 19, 2026 15:47
@scotwells
scotwells enabled auto-merge July 19, 2026 15:47
@scotwells
scotwells merged commit 595c23a into main Jul 19, 2026
2 checks passed
@scotwells
scotwells deleted the fix/observability-cold-install branch July 19, 2026 16:52
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.

2 participants