Skip to content

Conversation

@lexfrei
Copy link

@lexfrei lexfrei commented Nov 6, 2025

What this PR does / why we need it:

This PR adds full HTTPRoute support (Gateway API v1) to the Loki Helm chart, providing a modern alternative to traditional Ingress resources for routing traffic to Loki components.

Features:

  • Gateway HTTPRoute for simple routing through loki-gateway service
  • Main HTTPRoute for component-level routing (distributor, query-frontend, ruler, compactor)
  • Support for all deployment modes (SingleBinary, SimpleScalable, Distributed)
  • Advanced Gateway API features:
    • HTTPRoute filters (RequestHeaderModifier, ResponseHeaderModifier, RequestRedirect, URLRewrite)
    • Multiple parentRefs support for multi-gateway configurations
    • Custom rules with matches, filters, and backendRefs
  • Comprehensive testing (CI values + integration tests)
  • Full documentation auto-generated via helm-docs

Which issue(s) this PR fixes:
N/A - New feature

Special notes for your reviewer:

  • HTTPRoute templates follow the same architecture as existing Ingress templates
  • Gateway API v1 (stable) only, no backward compatibility with v1beta1
  • HTTPRoute and Ingress are mutually exclusive options
  • All existing functionality remains unchanged
  • Validated with kubectl dry-run in live cluster

Checklist

  • Reviewed the CONTRIBUTING.md guide
  • Documentation added (auto-generated via helm-docs)
  • Tests updated (CI + integration tests)
  • Title matches conventional commits format
  • Changes documented in CHANGELOG.md
  • Chart version bumped (6.46.0 → 6.47.0)

Add full HTTPRoute support for both gateway and component-level routing.

Features:
- Gateway HTTPRoute for simple routing through loki-gateway
- Main HTTPRoute for component-level routing (distributor, query-frontend, ruler, compactor)
- Support for all deployment modes (SingleBinary, SimpleScalable, Distributed)
- HTTPRoute filters (header manipulation, redirects, URL rewrites)
- Multiple parentRefs support for multi-gateway configurations
- CI and integration tests

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei lexfrei requested a review from a team as a code owner November 6, 2025 22:35
@CLAassistant
Copy link

CLAassistant commented Nov 6, 2025

CLA assistant check
All committers have signed the CLA.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
lexfrei and others added 2 commits November 7, 2025 18:09
Add preInstallScript to install Gateway API v1.4.0 CRDs before deploying
the chart to fix integration test failures.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@trevorwhitney
Copy link
Collaborator

hi @lexfrei, mind sharing a bit more about what HTTPRoute is and what issue this PR is addressing?

@lexfrei
Copy link
Author

lexfrei commented Nov 7, 2025

@trevorwhitney Thanks for taking a look! Regarding the missing issue:

HTTPRoute is the official successor to Ingress - it's part of the Kubernetes Gateway API project, which graduated to GA (v1.0) in October 2023 and is now the recommended standard for ingress traffic management in Kubernetes.

Why no issue?

  • This is a straightforward feature addition, not a complex architectural change
  • HTTPRoute follows the exact same pattern as the existing Ingress implementation in this chart
  • There's no ambiguity about how to implement it - it's a direct parallel to templates/ingress.yaml and templates/gateway/ingress-gateway.yaml
  • The implementation is well-defined by the Gateway API spec

Prior art:
There was a previous attempt in #16799, but it appeared abandoned and incomplete. Rather than resurrect that discussion, I implemented a complete solution following the chart's existing patterns.

What this PR provides:

  • Gateway HTTPRoute (simple routing, analogous to ingress-gateway.yaml)
  • Main HTTPRoute (component-level routing, analogous to ingress.yaml)
  • Support for all deployment modes (SingleBinary/SimpleScalable/Distributed)
  • Advanced Gateway API features (filters, multiple parentRefs)
  • Comprehensive tests (CI + integration)
  • Full documentation

References:

Happy to create a retroactive issue/LID if the team prefers formal process documentation, but I felt this was more of a "parity feature" than something requiring extensive design discussion.

@jkroepke
Copy link
Contributor

jkroepke commented Nov 7, 2025

Hey @lexfrei

to have the same experience across all Grafana Charts, could you please use the following pattern for values, which is used at Grafana Chart as well?

https://github.com/grafana/helm-charts/blob/76d7026888fa2820457a4f819195575233414788/charts/grafana/values.yaml#L318-L352

Refactor Gateway API configuration to follow the same pattern as Grafana chart:
- Rename gateway.httproute -> gateway.route
- Rename httproute -> route
- Add apiVersion and kind fields for flexibility
- Use matches/filters/additionalRules structure
- Update templates: httproute-gateway.yaml -> route-gateway.yaml, httproute.yaml -> route.yaml
- Update CI and integration tests accordingly
- Regenerate documentation

This aligns with the pattern used across Grafana Helm charts for consistency.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei
Copy link
Author

lexfrei commented Nov 8, 2025

@trevorwhitney Thanks for the feedback! I've refactored the implementation to align with the Grafana chart pattern:

  • Renamed gateway.httproutegateway.route
  • Renamed httprouteroute
  • Added apiVersion and kind fields for flexibility
  • Changed structure to use matches, filters, and additionalRules instead of direct rules array
  • Updated templates accordingly (route-gateway.yaml, route.yaml)
  • Updated all CI and integration tests

The structure now follows the same pattern as in the Grafana chart. Is this close enough to the established pattern, or are there additional adjustments you'd like to see?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants