Skip to content

feat(chart): add opt-in Fleet (OpAMP) support - #367

Open
strawgate wants to merge 5 commits into
mainfrom
claude/project-thread-vl6lho
Open

strawgate wants to merge 5 commits into
mainfrom
claude/project-thread-vl6lho

Conversation

@strawgate

@strawgate strawgate commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Summary

Self-hosted Logfire can now run Fleet, which manages OpenTelemetry Collectors, the Logfire SDKs and the Kubernetes Operator over OpAMP. It is off by default and turned on with fleet.enabled: true.

  • Workloads. Two new ones, logfire-opamp (the OpAMP server, image logfire-opamp) and logfire-fleet-control (agent state in the crud database, image logfire-fleet-control-prod). Each has the usual per-workload values: replicas, resources, autoscaling, scheduling, env and securityContext.
  • Sizing presets. small, standard and large run two logfire-opamp pods and autoscale logfire-fleet-control from two; tiny runs one of each. logfire-opamp has a fixed replica count, because a scale-down closes the stopped pod's agent sockets.
  • Routing. logfire-service (HAProxy) sends exactly /v1/opamp to logfire-opamp, ahead of the backend's /v1/ catch-all. The backend uses leastconn and a one-hour timeout tunnel for the WebSocket. Its health check goes to the plain admin port, which the probes use as well.
  • Config. logfire-backend gets FLEET_MANAGEMENT_ENABLED and FLEET_OPAMP_URL, which turns on the Fleet pages, API and enrollment. logfire-backend-auth gets FLEET_MANAGEMENT_ENABLED, which enables the routes the OpAMP server resolves agent credentials against.
  • OpAMP URL. Agents connect to wss://<primary hostname>/v1/opamp, or ws:// when public TLS is off. fleet.opampUrl overrides it, and validation rejects any path other than /v1/opamp.
  • Secrets. A generated logfire-fleet-transport-token Secret carries the bearer logfire-opamp sends to logfire-fleet-control. It is read back on upgrade. Under existingSecret it is a key in that Secret instead.
  • In-cluster TLS. Both workloads get certificates, and in cert-manager mode the chart creates them. logfire-opamp then serves its public listener on inClusterTls.httpsPort and verifies auth and Fleet control against the in-cluster CA. With in-cluster TLS off, or a ws:// public URL, the chart sets OPAMP_ALLOW_INSECURE_AUTH, because otherwise the server refuses plain HTTP.
  • Migrations. None needed. Fleet's tables are part of the crud schema that logfire-backend-migrations already creates.
  • Docs. A README "Fleet" section covers the workloads, the URL, proxy WebSocket timeouts, secrets and sizing.

Upgrade notes

No action is needed while fleet.enabled is false, because nothing new renders.

To enable Fleet:

  • Use this chart version or later. Its platform release publishes the logfire-opamp and logfire-fleet-control-prod images. If you mirror images, mirror both.
  • With existingSecret.enabled, add a logfire-fleet-transport-token key of at least 32 characters.
  • With inClusterTls.certs.mode=existingSecrets, create the logfire-opamp and logfire-fleet-control TLS Secrets.
  • A proxy in front of logfire-service must allow WebSocket upgrades on /v1/opamp.

Breaking changes

None.

Scope

The chart version moves to 0.15.4-rc.5, the next pre-release after main's 0.15.4-rc.4, so merging publishes a pre-release. The appVersion on main (04a0335e) is already a platform release that publishes the Fleet images, so this PR does not change it.

Validation

  • helm unittest: 271 passed. The Fleet cases cover the /v1/opamp route order and its upstream and admin health-check ports, the auth, control and public URLs with TLS off and on, the transport token Secret with and without existingSecret, the fleet.opampUrl path validation, Fleet control's keep-alive, and the preset replica counts.
  • helm lint and a full render pass with ci/ci-values.yaml.
  • CI now installs Fleet: ci-values.yaml sets fleet.enabled, so the upgrade and Istio suites deploy both workloads, and the route tests check that /v1/opamp reaches logfire-opamp (400 to a plain GET, 401 with a Bearer challenge to an upgrade without a credential).
  • A manual Kind run of an earlier revision passed end to end: install, Collector and SDK enrollment with a policy change, restart and two-replica failover, and in-cluster TLS.

Generated by Claude Code

fleet.enabled deploys logfire-opamp and logfire-fleet-control, routes the
/v1/opamp WebSocket to logfire-opamp through logfire-service, generates the
shared transport token, and turns on the backend and auth Fleet routes with
the OpAMP URL agents connect to. In-cluster TLS covers both workloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmH295pyWtNXQMA8MmL6w
@strawgate strawgate self-assigned this Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmH295pyWtNXQMA8MmL6w
With existingSecret enabled, the Fleet pods need logfire-fleet-transport-token
in that Secret. Add it in the PR workflow and in the Kind preparation script,
so a run with fleet.enabled does not stop in CreateContainerConfigError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmH295pyWtNXQMA8MmL6w
…ions open

- Add logfire-opamp and logfire-fleet-control to the tiny, small and standard
  sizing presets (large inherits standard). logfire-opamp runs a fixed count,
  because a scale-down closes the stopped pod's sockets; fleet-control
  autoscales on CPU from two pods (one on tiny).
- Set KEEP_ALIVE_TIMEOUT=620 on logfire-fleet-control, as the hosted
  deployment does. logfire-opamp keeps idle connections for up to 90 s, so the
  server's 5 s default lets a batch hit a connection the server is closing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmH295pyWtNXQMA8MmL6w
Main pins platform v2026-11-18.01 (04a0335e), the first release that
publishes logfire-opamp and logfire-fleet-control-prod to the public
registries, so this branch needs no appVersion change.

- Chart version 0.15.4-rc.5, the next pre-release after main's rc.4.
- Fleet preset entries follow main's rule for light services: memory
  requests, no memory limit.
- ci-values turns fleet.enabled on, so the upgrade and Istio suites install
  Fleet, and the route tests check /v1/opamp reaches logfire-opamp (400 to a
  plain GET, 401 with a Bearer challenge to an upgrade without a credential).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQmH295pyWtNXQMA8MmL6w

This branch has not been deployed

No deployments
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