Skip to content

feat(rocketchat): add Gateway API HTTPRoute support#234

Open
somaz94 wants to merge 3 commits into
RocketChat:masterfrom
somaz94:feat/httproute
Open

feat(rocketchat): add Gateway API HTTPRoute support#234
somaz94 wants to merge 3 commits into
RocketChat:masterfrom
somaz94:feat/httproute

Conversation

@somaz94

@somaz94 somaz94 commented Jun 11, 2026

Copy link
Copy Markdown

Adds an optional Gateway API HTTPRoute to the rocketchat chart as an alternative to the existing Ingress, gated behind httproute.enabled (default false). It mirrors the Ingress routing so existing deployments are unaffected.

What

  • Main rule routes the chart's host to the Rocket.Chat service via a PathPrefix / match (mirroring the Ingress).
  • When microservices.enabled, /sockjs and /websocket are routed to the ddp-streamer service (required for microservices mode, mirroring the Ingress).
  • httproute.enabled requires at least one httproute.parentRefs entry; the template fails fast with a clear message otherwise. apiVersion is pinned to gateway.networking.k8s.io/v1.
  • Optional httproute.matches, filters, and extraRules for customization.

New values block (httproute.*), README parameter rows, a NOTES.txt hint, and bats render tests are included. Existing Ingress behavior and labels are unchanged.

Validation (helm 3.18.1)

  • helm lint passes with default values.
  • Disabled by default — renders zero HTTPRoute objects.
  • httproute.enabled=true without parentRefs fails with the guard message.
  • Microservices mode renders main + /sockjs + /websocket rules; monolith renders the single main rule.

No chart version bump (handled by maintainers at release time, matching recent feature PRs).

@CLAassistant

CLAassistant commented Jun 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@somaz94 somaz94 marked this pull request as ready for review June 11, 2026 05:28
@debdutdeb

Copy link
Copy Markdown
Member

Love this. With ingress api freezed, definitely something we needed to add eventually.

Do you think some tests could be added for this here - https://github.com/RocketChat/helm-charts/blob/master/rocketchat/tests/rocketchat.bats ?

@debdutdeb debdutdeb self-assigned this Jun 12, 2026
@somaz94

somaz94 commented Jun 12, 2026

Copy link
Copy Markdown
Author

Thanks for the quick look, @debdutdeb! Agreed — with the Ingress API frozen this is overdue.

I've added HTTPRoute rendering tests in rocketchat/tests/rocketchat.bats (pushed in a3ac9b3). They run helm template only, so they need no live cluster and no Gateway API CRDs, and they sit in the pre phase next to the existing lint / dry-run / package checks (added two small render_chart / render_httproute helpers in common.bash).

Coverage:

  • not rendered by default (httproute.enabled=false)
  • fails fast when enabled without a parentRef (the guard message)
  • main route renders with apiVersion / kind / fullname / parentRef
  • hostname defaults to .Values.host, and is overridable via httproute.hostnames
  • httproute.apiVersion override (e.g. v1beta1)
  • matrix /.well-known routes when httproute.federation.serveWellKnown=true
  • ddp-streamer routes present for microservices / absent for monolith

All pass locally in both modes (8/8 microservices, 8/8 monolith). Happy to adjust the style or fold them into the cluster-based detik assertions instead if you'd prefer — just let me know.

@debdutdeb

Copy link
Copy Markdown
Member

@somaz94 would you mind if i asked you to record just a small video of this working with an actual loadbalancer running and rc working through gapi?

I might not be able to test this until 2-3 weeks in. But unless this breaks existing code, I'll merge as-is as long as it works.

Comment thread rocketchat/values.yaml Outdated
Comment on lines +282 to +285
federation:
# serveWellKnown adds /.well-known/matrix/{server,client} routes to the wellknown service
# (only rendered when federation.enabled is also true)
serveWellKnown: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's remove this whole thing. We have deprecated the last federation architecture that needed deployment level proxy configuration. Not only in the new design even in the old architecture's latest iteration the app serves the endpoints itself. These are relics at this point, and no need to accumulate the debt here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in 7d7974a — removed the entire federation / well-known block (and the separate Synapse HTTPRoute). The chart now renders only the main Rocket.Chat route (plus the microservices /sockjs + /websocket rules). Thanks for the context on the deprecated arch.

Comment thread rocketchat/values.yaml Outdated
Comment on lines +260 to +261
# HTTPRoute apiVersion (defaults to "gateway.networking.k8s.io/v1" when empty)
apiVersion: ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any need to do it this way? apiversion change generally means we need the spec to also change. changing this but not the underlying generations are not making sense to me.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done — dropped the apiVersion override entirely; the template now pins gateway.networking.k8s.io/v1. Agreed that exposing it without changing the generated spec didn't make sense.

Comment thread rocketchat/README.md Outdated
| `ingress.tls` | A list of [IngressTLS](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/ingress-v1/#IngressSpec) items | `[]` |
| `httproute.enabled` | If `true`, a Gateway API [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute/) is created (requires the Gateway API CRDs) | `false` |
| `httproute.apiVersion` | HTTPRoute apiVersion override. Defaults to `gateway.networking.k8s.io/v1` when empty | `""` |
| `httproute.parentRefs` | List of [parentRefs](https://gateway-api.sigs.k8s.io/api-types/httproute/#attaching-to-gateways) the HTTPRoute attaches to. At least one is required when enabled | `[]` |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
| `httproute.parentRefs` | List of [parentRefs](https://gateway-api.sigs.k8s.io/api-types/httproute/#attaching-to-gateways) the HTTPRoute attaches to. At least one is required when enabled | `[]` |
| `httproute.parentRefs` | List of [parentRefs](https://gateway-api.sigs.k8s.io/reference/api-spec/1.5/spec/#parentreference) the HTTPRoute attaches to. At least one is required when enabled | `[]` |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Applied your suggestion in 7d7974a — the row now links to the versioned .../reference/api-spec/1.5/spec/#parentreference.

Comment thread rocketchat/values.yaml Outdated
Comment on lines +269 to +272
# hostnames matched against the HTTP Host header. Defaults to [host] when empty.
# hostnames:
# - chat.example.com
hostnames: []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why multiple hostnames? the chart is deploying rocket.chat, so only the hostnames we need should be in the generated route. This is unnecessary flexibility at this stage.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done — removed the hostnames value; the route now derives its hostname from the chart's .Values.host only. Agreed it was unnecessary flexibility here.

Comment thread rocketchat/values.yaml Outdated
# filters applied to the main Rocket.Chat rule
filters: []
# additionalRules (templated) prepends custom HTTPRoute rules to the main route
additionalRules: []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
additionalRules: []
extraRules: []

just the wording we are already using.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Applied — renamed additionalRules to extraRules to match the wording you already use.

@somaz94

somaz94 commented Jun 15, 2026

Copy link
Copy Markdown
Author

No rush at all, @debdutdeb — let's not block on the video. The bats tests added here already cover the HTTPRoute rendering path (helm template), so the chart side is verified. I'm happy to wait until you get a chance to try it against a live LoadBalancer in a couple of weeks. Ping me here whenever you get to it and I'll jump on anything that comes up. Thanks!

@somaz94

somaz94 commented Jun 15, 2026

Copy link
Copy Markdown
Author

Addressed all of the inline feedback in 7d7974a — net result is a much smaller surface (8 insertions / 99 deletions):

  • Federation routing removed — dropped the httproute.federation block, the serveWellKnown matrix well-known route, and the separate synapse HTTPRoute. Agreed these are relics now that the app serves those endpoints itself; no reason to carry the debt here.
  • Multiple hostnames removed — the route's hostname is now derived solely from .Values.host, so it only ever contains the one host the chart deploys.
  • additionalRulesextraRules — renamed to match the wording already used in the chart.
  • apiVersion override removed — you're right that flipping the apiVersion without changing the generated spec doesn't make sense; it's now pinned to gateway.networking.k8s.io/v1.
  • README parentRefs link — applied your suggested reference link.

Tests/docs updated to match (dropped the now-obsolete hostnames/apiVersion/serveWellKnown render tests). helm lint clean and I re-rendered the monolith/microservices/extraRules paths to confirm. No rush on the live LoadBalancer video — happy to wait until you can try it.

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.

3 participants