Repository navigation
feat(chart): Gateway API and ingress guides - #404
Merged
Merged
Conversation
foca-common 0.2.0 can expose the app with a Gateway API HTTPRoute (gateway.networking.k8s.io/v1) attached to an existing Gateway via <valuesKey>.httpRoute.parentRefs, with optional filters (e.g., an ExtensionRef for body size or rate limits) and an optional second HTTPRoute that redirects HTTP to HTTPS on the Gateway's HTTP listener (httpRoute.httpsRedirect). The Ingress and the HTTPRoute are mutually exclusive; the OpenShift Route is only created without either. The Route gets annotations from <valuesKey>.route.annotations (e.g., the router's rate limits). Existing values keep working. The petstore example adds the templates, values, NOTES and a CI values file with an HTTPRoute and the app's NetworkPolicy. Refs #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The kind install job installs Envoy Gateway with a Gateway that has an HTTP and an HTTPS listener (self-signed certificate), and installs the petstore chart with ci/gateway-values.yaml. It checks that HTTP is redirected to HTTPS, that the app is reachable via HTTPS through the Gateway and its NetworkPolicy, and that the NetworkPolicy blocks pods outside its peers. Refs #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Helm chart docs describe how to expose FOCA apps via the Gateway API (recommended for new clusters), ingress-nginx (retired, with a migration note), Traefik, OpenShift and cloud load balancers: TLS and HTTPS redirects, body size and rate limits, NetworkPolicy peers and keep-alive timeouts. The deployment guide points to it. Closes #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A parent reference with only a sectionName and one with only a port on the same Gateway may select the same listener, so the HTTPS redirect now fails for them, too. Review follow-ups: comments on the redirect route (no annotations) and the port number, the migration note adds the Gateway's NetworkPolicy peers first, and CI retries the redirect check until Envoy Gateway has programmed the routes. Refs #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app's HTTPRoute is separate from the redirect, so CI retries the HTTPS check until Envoy Gateway has programmed it, too. The migration note is a numbered list now, and the port comment is shorter. Refs #397 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR upgrades foca-common to 0.2.0 with opt-in Gateway API HTTPRoute support, including configurable Gateway attachment, filters, and safe HTTPS redirects, while enforcing mutual exclusivity with Ingress and retaining OpenShift compatibility. It updates the Petstore example, schemas, documentation, snapshots, and CI with an Envoy Gateway kind integration test covering routing, TLS redirection, and NetworkPolicy behavior. Sequence diagram for Gateway HTTPS redirect and app routingsequenceDiagram
actor Client
participant Gateway
participant Redirect as HTTPSRedirectRoute
participant AppRoute
participant Service
Client->>Gateway: HTTP request
Gateway->>Redirect: Match HTTP listener
Redirect-->>Client: 301 https://host/path
Client->>Gateway: HTTPS request
Gateway->>AppRoute: Match HTTPS listener
AppRoute->>Service: Forward request
Service-->>Client: Application response
Flow diagram for mutually exclusive exposure resourcesflowchart TD
Values[Exposure values]
Ingress{Ingress enabled?}
HTTPRoute{HTTPRoute enabled?}
Error[Rendering fails: Ingress and HTTPRoute are mutually exclusive]
Route[Render OpenShift Route]
Expose[Render selected exposure resource]
Values --> Ingress
Ingress -->|yes| HTTPRoute
HTTPRoute -->|yes| Error
Ingress -->|no| HTTPRoute
HTTPRoute -->|yes| Expose
HTTPRoute -->|no| Route
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #404 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 2510 2510
=========================================
Hits 2510 2510
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 22, 2026 20:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #397.
foca-common0.2.0 renders an optionalHTTPRoute(gateway.networking.k8s.io/v1) forhostNamevia<valuesKey>.httpRoute(enabled,annotations,parentRefs,filters), attached to an existing Gateway, routing all paths to the app's Service (same rule as the Ingress). WithhttpRoute.httpsRedirect, a second HTTPRoute (<app name>-https-redirect) on the Gateway's HTTP listener redirects to HTTPS (RequestRedirect,301); rendering fails if itsparentRefsmay attach to the same listener as the app's route (which would redirect HTTPS requests, too). Value names followhelm create'shttpRoutescaffold.<valuesKey>.route.annotations(e.g., the router's rate limits).httpRoute/routemaps are treated as disabled/empty); app charts add two template files to use the HTTPRoute. ingress-nginx stays supported with the same defaults.config.server.max_content_lengthstays the enforcing limit; the docs show implementation policies (Envoy GatewayBackendTrafficPolicy, NGINX Gateway FabricClientSettingsPolicy, TraefikMiddlewareviahttpRoute.filters).ingressFrom); the docs list values for ingress-nginx, Traefik (k3s), the OpenShift router, Envoy Gateway (verified in CI) and other Gateway implementations, plusipBlockfor cloud load balancers.docs/helm-chart.mdwith one subsection per setup (Gateway API, recommended; ingress-nginx, retired, with a migration note incl. ingress2gateway and a no-downtime switch; Traefik; OpenShift; cloud load balancers as pointers), each covering TLS/HTTPS redirect, body size, rate limits, NetworkPolicy peers and keep-alive timeouts (Gunicorn's 75 s vs. Traefik's 90 s and Envoy's 1 h idle timeouts); pointer fromdocs/deployment.md.NOTES.txt, andci/gateway-values.yaml.foca-common0.1.0 → 0.2.0 (minor, new feature); petstore depends on 0.2.0. Not tagged or released.How it was verified
pytest charts/foca-common/tests(Helm v3.22.1, as in CI): 171 passed; new tests cover the HTTPRoute, the redirect (incl. 9 parametrized overlap cases ofparentRefs), required values, mutual exclusivity, name collisions, Route annotations, schema rejections, a new snapshot (http-route) and lint with the new CI values.helm lint --strictof the library and of the petstore chart with eachci/*-values.yaml.standard-install.yaml; CEL rules not checked locally, but by the API server in CI).ruff check,ruff format --check,mypy,mkdocs build --strict,actionlint.ci/gateway-values.yaml; checks that HTTP is redirected to HTTPS (301), that the app is reachable via HTTPS through the Gateway (and through its NetworkPolicy, which admits only the Envoy proxies and the test pod), and that a pod outside the peers is blocked.HTTP: 301 https://petstore-gateway.example.org/pets,HTTPS: 200andPod outside the peers: blocked(kindnet enforces NetworkPolicies, so the documented Envoy Gateway peers are verified).Declined review findings
Two review rounds (adversarial + quality); all high/medium and most low findings fixed (mixed
sectionName/portreferences now count as overlapping, NetworkPolicy step in the migration note, CI retries until the routes are programmed, redirect route documented as having no annotations, comments and wrapping). Declined:hostNameon the redirect route: the redirect only renders together with the app's HTTPRoute, which requireshostNamewith the same message (tested).v1.Chart.yaml's description: cosmetic.httpsRedirect.annotations: not added (documented instead); can be added compatibly later if a Gateway implementation needs it.Open questions
None.
Release of foca-common 0.2.0 (after merge)
🤖 Generated with Claude Code
Summary by Sourcery
Support exposing FOCA applications through Gateway API HTTPRoutes while documenting migration and validating the setup in CI.
New Features:
Bug Fixes:
Enhancements:
CI:
Documentation:
Tests: