Skip to content

feat: loki single binary deployment#2807

Draft
eoghanriley wants to merge 2 commits into
mainfrom
eoghanriley/core-640
Draft

feat: loki single binary deployment#2807
eoghanriley wants to merge 2 commits into
mainfrom
eoghanriley/core-640

Conversation

@eoghanriley

Copy link
Copy Markdown
Contributor

Description

Tests integration of Loki singleBinary/monolith with core to replace the deprecated simple scalable deployment that is currently in place.

Related Issue

Relates to CORE-640

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Steps to Validate

  • If this PR introduces new functionality to UDS Core or addresses a bug, please document the steps to test the changes.

Checklist before merging

@eoghanriley eoghanriley changed the title feat: WIP loki single binary deployment feat: loki single binary deployment Jul 16, 2026
@eoghanriley

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces Loki's deprecated SimpleScalable (write/read/backend) deployment with a Monolithic singleBinary deployment, consolidating three StatefulSets into one. All tests, uptime recording rules, and port-forward targets are updated accordingly.

  • src/loki/values/values.yaml: switches deploymentMode to Monolithic, enables singleBinary with affinity: null, and removes the per-tier replica/resource overrides; residual read/write/backend stanzas remain but are inert in this mode.
  • bundles/k3d-standard/uds-bundle.yaml: introduces LOKI_SINGLEBINARY_REPLICAS (default 1) and zeros out the old tier replica variables; however, uds-upgrade-test-config.yaml still overrides the now-absent LOKI_BACKEND_REPLICAS: 3 without a replacement for the singleBinary pod.
  • Tests and uptime rules: simplified from three per-component targets to a single loki StatefulSet target and a single uds:loki:up recording rule; documentation across docs/ still describes the old SimpleScalable topology and was not updated.

Confidence Score: 3/5

Core logging functionality is migrated correctly, but the upgrade-test config is broken and documentation is out of date.

The upgrade-test config overrides a variable (LOKI_BACKEND_REPLICAS) that no longer maps to any deployed component, so upgrade CI will run without the guard that previously prevented a single-replica Loki pod from being left in a broken state mid-restart. The same fragility that required the old override almost certainly applies to the new singleBinary StatefulSet. All documentation files (HA guide, overview, prerequisites, dev guide, C4 diagrams) still describe the deprecated three-tier topology, which will mislead operators trying to configure production deployments.

bundles/k3d-standard/uds-upgrade-test-config.yaml needs the LOKI_BACKEND_REPLICAS override replaced with an equivalent LOKI_SINGLEBINARY_REPLICAS guard; src/loki/values/values.yaml has cleanup left to do; docs/ files broadly need updating to reflect Monolithic mode.

Important Files Changed

Filename Overview
bundles/k3d-standard/uds-bundle.yaml Adds LOKI_SINGLEBINARY_REPLICAS variable (default 1) and zeros out the old write/read/backend replica variables; old variables are kept for backward compat but all default to 0
bundles/k3d-standard/uds-upgrade-test-config.yaml Still overrides LOKI_BACKEND_REPLICAS: 3 which is now a no-op; the safety concern that drove this override (single-replica restart failure) is not addressed for the new singleBinary StatefulSet
src/loki/chart/templates/uptime-recording-rules.yaml Consolidates three per-tier recording rules into a single uds:loki:up rule targeting the monolithic StatefulSet
src/loki/tasks.yaml Switches port-forward target from svc/loki-write:3100 to svc/loki-gateway:80 for the object-storage validation task
src/loki/values/values.yaml Switches deploymentMode to Monolithic, adds affinity:null for singleBinary, removes resource limits and replicas override; orphaned comment and residual read/write/backend stanzas remain
test/vitest/loki.spec.ts Replaces three separate per-component forwards and tests with a single lokiMonolithic forward; all queries and pushes now route through lokiGateway
test/vitest/falco-integration.spec.ts Renames lokiRead to lokiGateway and updates the forward to target loki-gateway:8080 instead of loki-read:3100
test/vitest/helpers/loki.ts Renames parameter from lokiRead to lokiEndpoint for clarity; no logic changes
test/vitest/uptime.spec.ts Removes the three old per-tier uptime rule assertions and replaces them with the single uds:loki:up assertion

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant V as Vector (DaemonSet)
    participant GW as loki-gateway (nginx)
    participant SB as loki (singleBinary StatefulSet)
    participant S3 as Object Storage (S3)

    Note over V,SB: Log ingestion
    V->>GW: POST /loki/api/v1/push
    GW->>SB: forward push
    SB->>S3: flush chunks

    Note over GW,SB: Log query
    GW->>SB: GET /loki/api/v1/query_range
    SB->>S3: read chunks
    SB-->>GW: results
    GW-->>V: response

    Note over SB: All roles in one pod (distributor, ingester, querier, compactor, ruler...)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant V as Vector (DaemonSet)
    participant GW as loki-gateway (nginx)
    participant SB as loki (singleBinary StatefulSet)
    participant S3 as Object Storage (S3)

    Note over V,SB: Log ingestion
    V->>GW: POST /loki/api/v1/push
    GW->>SB: forward push
    SB->>S3: flush chunks

    Note over GW,SB: Log query
    GW->>SB: GET /loki/api/v1/query_range
    SB->>S3: read chunks
    SB-->>GW: results
    GW-->>V: response

    Note over SB: All roles in one pod (distributor, ingester, querier, compactor, ruler...)
Loading

Comments Outside Diff (1)

  1. src/loki/values/values.yaml, line 210-225 (link)

    P2 Residual SimpleScalable sections left in values file

    The read, write, and backend stanzas are still present and each overrides affinity: null. In Monolithic deployment mode these components are not deployed, so the values are harmless but they create confusion about what is actually active. The write.serviceAccount.create: false workaround comment even links to a GitHub issue specific to the SimpleScalable setup. Consider removing or clearly commenting these out to make the file's intent obvious.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "feat: WIP loki single binary deployment" | Re-trigger Greptile

Comment thread src/loki/values/values.yaml
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