Skip to content

Feat: Add Gateway API support to Helm chart#241

Merged
teemow merged 3 commits intomainfrom
feat/issue-206-gateway-api-helm-chart
Jan 18, 2026
Merged

Feat: Add Gateway API support to Helm chart#241
teemow merged 3 commits intomainfrom
feat/issue-206-gateway-api-helm-chart

Conversation

@teemow
Copy link
Member

@teemow teemow commented Jan 18, 2026

Summary

Adds optional Gateway API (HTTPRoute) configuration to the Helm chart, allowing users to expose the service using Gateway API instead of or alongside traditional Ingress resources.

Closes #206

Changes

New Templates

  • templates/httproute.yaml: Gateway API v1 HTTPRoute with:

    • Required parentRefs validation (fails early with clear error message)
    • Support for custom hostnames, matches, filters, and timeouts
    • Default PathPrefix / rule when no custom rules specified
    • Consistent template style with ingress.yaml
  • templates/backendtrafficpolicy.yaml: Envoy Gateway BackendTrafficPolicy for timeout configuration

    • Default 300s timeout for long-running MCP sessions
    • Only created when both gatewayAPI.enabled and backendTrafficPolicy.enabled are true

Configuration

  • values.yaml: Added gatewayAPI section with comprehensive documentation
  • values.schema.json: Added schema validation for Gateway API configuration
  • README.md: Updated with Gateway API documentation and examples
  • Chart.yaml: Bumped version to 0.1.1

Testing

  • tests/gateway_api_test.yaml: 24 comprehensive Helm unit tests covering:
    • HTTPRoute creation and conditional rendering
    • parentRefs validation failure
    • Filters and timeouts in custom rules
    • BackendTrafficPolicy dual-flag requirements
    • Service reference validation
    • Custom labels/annotations propagation

Example Usage

gatewayAPI:
  enabled: true
  httpRoute:
    parentRefs:
      - name: internal
        namespace: envoy-gateway-system
    hostnames:
      - muster.example.com
    rules:
      - matches:
          - path:
              type: PathPrefix
              value: /api
        filters:
          - type: RequestHeaderModifier
            requestHeaderModifier:
              add:
                - name: X-Custom-Header
                  value: custom-value
        timeouts:
          request: 30s
  backendTrafficPolicy:
    enabled: true
    timeout: "300s"

Migration

Both Ingress and Gateway API can be enabled simultaneously for migration scenarios.

Testing

All 45 Helm unit tests pass (24 new Gateway API tests + 21 existing tests).

- Add gatewayAPI section to values.yaml with HTTPRoute and BackendTrafficPolicy config
- Create httproute.yaml template for Gateway API v1 HTTPRoute
- Create backendtrafficpolicy.yaml template for Envoy Gateway timeout config
- Update README.md with Gateway API documentation and examples
- Bump chart version to 0.1.1

Both Ingress and Gateway API can be enabled simultaneously for migration scenarios.
@teemow teemow requested a review from a team as a code owner January 18, 2026 07:55
@teemow teemow mentioned this pull request Jan 18, 2026
5 tasks
@teemow
Copy link
Member Author

teemow commented Jan 18, 2026

Alignment with mcp-kubernetes Implementation

I've been working on aligning the Gateway API implementations across our Helm charts. After comparing this PR with the mcp-kubernetes implementation, here are the recommended changes to ensure consistency:

1. Add parentRefs Validation (Recommended)

mcp-kubernetes has validation that fails early if parentRefs is empty when Gateway API is enabled. This provides better user feedback:

{{- if not .Values.gatewayAPI.httpRoute.parentRefs }}
{{- fail "gatewayAPI.httpRoute.parentRefs is required when gatewayAPI.enabled is true. Specify at least one parent Gateway reference." }}
{{- end }}

2. Support Both Filters AND Timeouts

Currently this PR supports .timeouts in rules. Consider also adding .filters support for request/response modification:

{{- if .filters }}
filters:
  {{- toYaml .filters | nindent 8 }}
{{- end }}

3. Add Default Match Fallback (Already Implemented)

This PR correctly falls back to PathPrefix / when custom rules don't specify matches.

4. Reference Implementation

The unified implementation in mcp-kubernetes now supports:

  • Per-resource labels/annotations (httpRoute.labels, httpRoute.annotations, backendTrafficPolicy.labels, backendTrafficPolicy.annotations)
  • Validation for required parentRefs
  • Both .filters and .timeouts in custom rules
  • Default PathPrefix / fallback for rules without matches

See: mcp-kubernetes feature branch

Let me know if you'd like me to update this PR with these changes.

@teemow
Copy link
Member Author

teemow commented Jan 18, 2026

Addressed all recommendations from the alignment review:

Changes Made

  1. parentRefs Validation - Added early validation that fails with a clear error message if parentRefs is empty when Gateway API is enabled:

    gatewayAPI.httpRoute.parentRefs is required when gatewayAPI.enabled is true. Specify at least one parent Gateway reference.
    
  2. Filters Support - Added .filters support alongside .timeouts in custom rules for request/response modification:

    rules:
      - matches:
          - path:
              type: PathPrefix
              value: /api
        filters:
          - type: RequestHeaderModifier
            requestHeaderModifier:
              add:
                - name: X-Custom-Header
                  value: custom-value
        timeouts:
          request: 30s
  3. Updated Documentation - Updated values.yaml comments to reflect filters support and mark parentRefs as REQUIRED

  4. Test Coverage - Added 4 new tests covering:

    • Validation failure when parentRefs is empty
    • Filters in custom rules
    • Timeouts in custom rules
    • Both filters and timeouts in the same rule

All 45 Helm unit tests pass.

@teemow teemow merged commit 0ec9b5b into main Jan 18, 2026
7 checks passed
@teemow teemow deleted the feat/issue-206-gateway-api-helm-chart branch January 18, 2026 08:18
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.

Add Gateway API support to Helm chart

1 participant