Add Gateway API filter and timeout support to HTTPRoute resources

What does this MR do?

Add Gateway API filter and timeout support to HTTPRoute resources

  • Add gatewayRoute.filters to all HTTPRoute resources
  • Add gatewayRoute.timeouts to MinIO, Pages

Gaps

For canary deployments, the sophisticated orchestration required would need external tooling (e.g., Argo), so I'd suggest we rule it out of scope.

Related: #6336 (closed)

Test plan

Apply the example values.yaml, then check the created HTTPRoute, we should see the filters/timeout is configured.

Example values.yaml:

nginx-ingress:
  enabled: false

global:
  hosts:
    externalIP: 127.0.0.1
  minio:
    enabled: true
  pages:
    enabled: true
  gatewayApi:
    enabled: true
    installEnvoy: true

certmanager-issuer:
  email: your-email@gmail.com

registry:
  gatewayRoute:
    filters:
      - type: ResponseHeaderModifier
        responseHeaderModifier:
          set:
            - name: X-Content-Type-Options
              value: nosniff
minio:
  gatewayRoute:
    filters:
      - type: RequestHeaderModifier
        requestHeaderModifier:
          remove:
            - X-Powered-By
    timeouts:
      request: 60s
      backendRequest: 60s
gitlab:
  gitlab-pages:
    gatewayRoute:
      filters:
        - type: ResponseHeaderModifier
          responseHeaderModifier:
            remove:
              - Server
      timeouts:
        request: 30s
        backendRequest: 30s
  kas:
    gatewayRoute:
      filters:
        - type: RequestHeaderModifier
          requestHeaderModifier:
            set:
              - name: X-Custom
                value: kas-value

If use test with caproni, clone this branch to ./gitlab and run a helm dependency update, use this caproni with the above values:

version: 2

cluster:
  driver: k3d # or colima
  network:
    hostname: gitlab.caproni.test
    additional_hostnames:
      - registry.gitlab.caproni.test
  k3d:
    agents: 1
    servers: 1
    # We need https://gitlab.com/gitlab-org/caproni/-/merge_requests/222
    # to disable the default Traefik ingress controller, which conflicts with GitLab's bundled one. 
    extra_args:
      - --k3s-arg=--disable=traefik@server:*

repositories:
  gitlab-chart:
    repository: https://gitlab.com/gitlab-org/charts/gitlab.git
    directory: ./gitlab-chart/

deployers:
  # 1. GitLab
  gitlab:
    type: helm
    repository: gitlab-chart
    helm:
      namespace: gitlab
      values_file: ./timeout.values.yaml
      release:
        name: gitlab
        chart: ./gitlab

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated, and test plan for scenarios not covered by automated tests.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Edited by Lucas Li

Merge request reports

Loading