Skip to content

fix(langfuse): make hub-only via alwaysSelector (prune spoke langfuse)#24

Open
elamaran11 wants to merge 2 commits into
feature/oam-for-agentsfrom
fix/langfuse-hub-only-selector
Open

fix(langfuse): make hub-only via alwaysSelector (prune spoke langfuse)#24
elamaran11 wants to merge 2 commits into
feature/oam-for-agentsfrom
fix/langfuse-hub-only-selector

Conversation

@elamaran11

Copy link
Copy Markdown
Contributor

Problem

Langfuse is a hub singleton (one Keycloak langfuse client, hub-domain redirect, shared platform realm), but it is currently deployed to every cluster — langfuse-spoke-dev / langfuse-spoke-prod are generated and sit OutOfSync/Degraded.

PR #23 tried to disable it on spokes via new gitops/addons/environments/dev|prod/addons.yaml (langfuse.enabled: false), but those files are never loaded — the bootstrap Application (gitops/fleet/bootstrap/agent-platform-app.yaml) only references bootstrap/default/addons.yaml + environments/control-plane/addons.yaml. And langfuse generation is a single hub-level decision: the langfuse ApplicationSet selects clusters by the global enable_agent_platform=true label (all clusters), because the platform runs with useSelectors=false, which makes per-chart selector blocks (langfuse's enable_langfuse) ignored.

Flipping useSelectors globally is not viable: most agentic addons' enable_<addon> labels (jaeger, litellm, otel_collector, oam_components, agent_gateway, …) are not present on any cluster, so enabling per-chart selectors would prune the whole agent platform.

Fix

Add an alwaysSelector hook to the shared ApplicationSet template that is honored regardless of useSelectors, then set it on langfuse to require environment in [control-plane]:

# gitops/addons/bootstrap/default/addons.yaml (langfuse)
  alwaysSelector:
    matchExpressions:
      - key: environment
        operator: In
        values: ['control-plane']

The hub cluster secret carries environment=control-plane; spokes carry dev/prod. So the generated langfuse ApplicationSet matches only the hub, and ArgoCD prunes langfuse-spoke-*. Spoke agents continue to send traces to the hub Langfuse via the OTel pipeline (PR #23).

alwaysSelector is backward-compatible — no existing chart defines it, so behavior for every other addon is unchanged.

Verification

On the live hub + spoke-dev + spoke-prod, after sync:

  • langfuse ApplicationSet generates only langfuse-hub; langfuse-spoke-dev / langfuse-spoke-prod are pruned.
  • Hub Langfuse v3 stays Healthy; no other addon's cluster targeting changes.

…d regardless of useSelectors)

The global useSelectors=false makes per-chart `selector` blocks ignored, so addons
fall back to the global enable_agent_platform selector and fan out to every cluster.
alwaysSelector is applied unconditionally, enabling per-cluster gating for hub-only
addons without flipping the global flag (which would break addons whose enable_<addon>
labels aren't present on any cluster). Backward-compatible: no existing chart sets it.
…l-plane

Langfuse is a hub singleton; it must not deploy to spokes. Add alwaysSelector matching
environment=control-plane so the generated ApplicationSet targets only the hub, pruning
langfuse-spoke-dev/prod. Replaces the non-functional environments/<env>/addons.yaml
approach (those files are not loaded by the bootstrap Application valueFiles).
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