Skip to content

Add optional Gateway API HTTPRoute template#10

Open
TJM wants to merge 1 commit into
openspeedtest:mainfrom
TJM:feat/httproute
Open

Add optional Gateway API HTTPRoute template#10
TJM wants to merge 1 commit into
openspeedtest:mainfrom
TJM:feat/httproute

Conversation

@TJM

@TJM TJM commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Adds an optional templates/httproute.yaml that renders a gateway.networking.k8s.io/v1 HTTPRoute when gateway.enabled: true. Backend always points at this chart's Service (matching how ingress.yaml references the Service).

Bumps chart version 0.1.2 → 0.2.0 because this introduces a new templated resource (minor bump, not patch).

Motivation

Many GKE / mesh / Kubernetes-1.30+ setups use Gateway API instead of Ingress. The chart already supports ingress but had no Gateway API equivalent, forcing users to apply a sibling HTTPRoute manifest separately. With this change, a single helm install can attach the openspeedtest Service to a pre-existing shared Gateway.

Example values:

gateway:
  enabled: true
  parentRefs:
    - name: shared-gateway
      namespace: gateway
      sectionName: https
  hostnames:
    - speedtest.example.com

Design notes

  • Disabled by defaultgateway.enabled: false, so existing installs render no change.
  • No Gateway resource is created — only the HTTPRoute. Gateways are typically shared infrastructure provisioned outside the chart.
  • Backend is the chart's own Service — same {{ include "openspeedtest.fullname" . }} pattern used by ingress.yaml, so multiple route types stay consistent.
  • hostnames is optional. When empty, the route matches every hostname the parent Gateway accepts.
  • matches is optional. When empty, the rule matches every path.
  • parentRefs is required when enabled (no sensible default).

Changes

  • templates/httproute.yaml — new template guarded by .Values.gateway.enabled.
  • values.yaml — add gateway: section after ingress: with the same disabled-by-default + commented-example style.
  • Chart.yaml — bump version 0.1.20.2.0.

Test plan

  • helm lint passes.
  • helm template with gateway.enabled: false (default): no HTTPRoute is emitted.
  • helm template with gateway.enabled: true + parentRefs/hostnames/matches: HTTPRoute renders matching the spec.
  • helm template with gateway.enabled: true + matches: []: HTTPRoute renders without a matches block (catch-all route).
  • End-to-end verified on a real GKE cluster: chart-deployed HTTPRoute attaches to a Gateway (rilb-gateway) and routes traffic to the chart's Service.

Adds optional templates/httproute.yaml that produces a
gateway.networking.k8s.io/v1 HTTPRoute attached to a pre-existing
Gateway. Backend always points at the chart's Service so the same
fullname rules apply as ingress.yaml.

The new values.gateway section mirrors how values.ingress is shaped:
disabled by default, hostnames/parentRefs as passthrough lists, and an
optional matches block (defaults to a single PathPrefix `/`).

Chart version bumped 0.1.2 -> 0.2.0 because this introduces a new
templated resource.
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