Skip to content

feat: add Gateway API support in hydra - #889

Open
PatTheSilent wants to merge 5 commits into
ory:masterfrom
PatTheSilent:master
Open

feat: add Gateway API support in hydra#889
PatTheSilent wants to merge 5 commits into
ory:masterfrom
PatTheSilent:master

Conversation

@PatTheSilent

@PatTheSilent PatTheSilent commented Jul 3, 2026

Copy link
Copy Markdown

Related Issue or Design Document

partially implements #845

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

This PR adds Gateway API HTTPRoutes in hydra for the API and proxy.
The objective was to provide a drop-in replacement for Ingress resources.
One discepancy is in _helpers.tpl and the hydra.config.urls.issuer helper. HTTPRoutes don't contain information about TLS in their spec so it's impossible to determine the protocol just from it. Since you can work around this by using .Values.hydra.config.urls.self.issuer I did not consider it a problem but I'm happy to get feedback.

This PR is a bit selfish. I just need to get this done one way or another and thought that contributing back was the best way to get it done.

Summary by CodeRabbit

  • New Features

    • Added optional HTTPRoute support for both public and admin endpoints.
    • Added new configuration options for route hostnames, parent references, annotations, matches, filters, and timeouts.
    • Updated issuer URL selection to recognize public HTTP routing and use the configured public hostname.
  • Documentation

    • Added default example settings for the new routing options in chart values.

@CLAassistant

CLAassistant commented Jul 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PatTheSilent, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 87a3a94c-1afd-4c15-9b66-f7feb03a8d56

📥 Commits

Reviewing files that changed from the base of the PR and between e300d2b and 33c9c65.

📒 Files selected for processing (2)
  • helm/charts/hydra/templates/httproute-admin.yaml
  • helm/charts/hydra/templates/httproute-public.yaml
📝 Walkthrough

Walkthrough

This PR adds Gateway API HTTPRoute support to the Hydra Helm chart, introducing conditional templates for public and admin routes, default disabled values with hostname placeholders, and an additional issuer URL derivation branch that uses the public HTTPRoute hostname when enabled.

Changes

HTTPRoute feature

Layer / File(s) Summary
Values and issuer URL derivation
helm/charts/hydra/values.yaml, helm/charts/hydra/templates/_helpers.tpl
Adds a new httproute values block with public/admin sections (disabled by default, default hostnames, PathPrefix rule) and a new conditional branch in the issuer URL helper that builds the issuer from the first public HTTPRoute hostname when enabled.
HTTPRoute templates for public and admin services
helm/charts/hydra/templates/httproute-public.yaml, helm/charts/hydra/templates/httproute-admin.yaml
Adds new conditionally-rendered HTTPRoute manifests for public and admin endpoints, including metadata, optional annotations/namespace/parentRefs/hostnames, and per-rule backendRefs plus optional filters, matches, and timeouts.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

flowchart TD
  ValuesYaml --> HelmTemplate
  HelmTemplate --> HttprouteAdminYaml
  HelmTemplate --> HttproutePublicYaml
  HttproutePublicYaml --> IssuerHelper
  IssuerHelper --> ConfigUrlsIssuer
Loading

Related Issues: None referenced.

Related PRs: None referenced.

Suggested labels: helm, enhancement

Suggested reviewers: None determinable from the provided information.

🐰 A hop, a route, a gateway new,
Public and admin paths shine through,
Hostnames default, disabled at rest,
Issuer finds its way with zest,
Helm charts grow, as rabbits do.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Gateway API support to Hydra.
Description check ✅ Passed The description includes the related issue, checklist items, and a brief rationale, though the main big-picture section is mostly empty.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
helm/charts/hydra/templates/httproute-admin.yaml (2)

17-20: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Default empty parentRefs produces an invalid HTTPRoute.

Same concern as flagged for httproute-public.yaml and values.yaml.

Also applies to: 27-32

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/charts/hydra/templates/httproute-admin.yaml` around lines 17 - 20, The
httproute-admin template currently renders an empty parentRefs block when
.Values.httproute.admin.parentRefs is unset, which makes the HTTPRoute invalid.
Update the template around parentRefs in the httproute-admin YAML to only emit
that section when there is at least one entry, using the same conditional
pattern used for httproute-public.yaml, and ensure the related defaults in
values.yaml do not leave parentRefs empty by default.

5-15: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Same labels/annotations nesting bug as httproute-public.yaml.

Identical control-flow issue: the if .Release.Namespace (line 7) is only closed at line 15, so labels: (9-10) and annotations: (11-14) are nested inside it, unlike service-admin.yaml's pattern where the namespace conditional closes immediately after the namespace: line.

🐛 Proposed fix
 metadata:
   name: {{ $fullName }}-admin
   {{- if .Release.Namespace }}
   namespace: {{ .Release.Namespace }}
+  {{- end }}
   labels:
     {{- include "hydra.labels" . | nindent 4 }}
   {{- with .Values.httproute.admin.annotations }}
   annotations:
     {{- tpl (toYaml .) $ | nindent 4 }}
   {{- end }}
-  {{- end }}
 spec:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/charts/hydra/templates/httproute-admin.yaml` around lines 5 - 15, The
metadata block in httproute-admin has the same nesting mistake as
httproute-public: the .Release.Namespace conditional in the template keeps
labels and annotations inside it instead of matching the service-admin pattern.
Update the httproute-admin template so the namespace guard only wraps the
namespace field, then render labels and annotations unconditionally afterward,
using the existing metadata structure and symbols like .Release.Namespace,
.Values.httproute.admin.annotations, and include "hydra.labels".
helm/charts/hydra/templates/httproute-public.yaml (1)

17-20: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Default empty parentRefs produces an invalid HTTPRoute.

See corresponding comment on values.yaml — with the default parentRefs: [], this with block renders no content, leaving parentRefs: with a null value, which is invalid since Gateway API HTTPRoutes require at least one parentRef to attach to a Gateway.

Also applies to: 27-32

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/charts/hydra/templates/httproute-public.yaml` around lines 17 - 20, The
HTTPRoute templates are rendering an empty parentRefs field when
.Values.httproute.public.parentRefs (and the same pattern in the other affected
template block) is left at its default empty list, which produces an invalid
route. Update the templating around the parentRefs section in the HTTPRoute
manifest so it either always renders at least one valid parentRef or
conditionally omits the entire HTTPRoute when no parentRefs are configured,
using the existing .Values.httproute.public.parentRefs lookup to locate the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/charts/hydra/templates/httproute-public.yaml`:
- Around line 5-15: The `httproute-public.yaml` template has `labels` and
`annotations` incorrectly nested under the `.Release.Namespace` conditional.
Update the `metadata` block so the `if .Release.Namespace` in the
`httproute-public` template only wraps the `namespace:` line, then close it
before `labels:` and the `with .Values.httproute.public.annotations` block,
matching the pattern used in `service-public.yaml`.

---

Duplicate comments:
In `@helm/charts/hydra/templates/httproute-admin.yaml`:
- Around line 17-20: The httproute-admin template currently renders an empty
parentRefs block when .Values.httproute.admin.parentRefs is unset, which makes
the HTTPRoute invalid. Update the template around parentRefs in the
httproute-admin YAML to only emit that section when there is at least one entry,
using the same conditional pattern used for httproute-public.yaml, and ensure
the related defaults in values.yaml do not leave parentRefs empty by default.
- Around line 5-15: The metadata block in httproute-admin has the same nesting
mistake as httproute-public: the .Release.Namespace conditional in the template
keeps labels and annotations inside it instead of matching the service-admin
pattern. Update the httproute-admin template so the namespace guard only wraps
the namespace field, then render labels and annotations unconditionally
afterward, using the existing metadata structure and symbols like
.Release.Namespace, .Values.httproute.admin.annotations, and include
"hydra.labels".

In `@helm/charts/hydra/templates/httproute-public.yaml`:
- Around line 17-20: The HTTPRoute templates are rendering an empty parentRefs
field when .Values.httproute.public.parentRefs (and the same pattern in the
other affected template block) is left at its default empty list, which produces
an invalid route. Update the templating around the parentRefs section in the
HTTPRoute manifest so it either always renders at least one valid parentRef or
conditionally omits the entire HTTPRoute when no parentRefs are configured,
using the existing .Values.httproute.public.parentRefs lookup to locate the fix.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a0eed4a-142e-40ee-9910-937260d7825b

📥 Commits

Reviewing files that changed from the base of the PR and between 4de8d62 and e300d2b.

📒 Files selected for processing (4)
  • helm/charts/hydra/templates/_helpers.tpl
  • helm/charts/hydra/templates/httproute-admin.yaml
  • helm/charts/hydra/templates/httproute-public.yaml
  • helm/charts/hydra/values.yaml

Comment thread helm/charts/hydra/templates/httproute-public.yaml Outdated
@PatTheSilent

Copy link
Copy Markdown
Author

@Demonsthere @piotrmsc any chance I could get your attention?

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