Add global.gatewayApi.externalTlsTermination for TLS at a load balancer

What does this MR do?

Adds global.gatewayApi.externalTlsTermination for deployments where a load balancer, such as an AWS NLB, terminates TLS in front of Envoy Gateway. Envoy otherwise sends X-Forwarded-Proto: http, so SAML sign-in loops, the Registry returns http:// upload URLs, and Pages HTTPS redirects misbehave. A manual setup was incomplete: HTTP listeners were fixed to port 80, and the Webservice and KAS section-scoped ClientTrafficPolicy resources conflict on shared HTTP ports and override the gateway-wide policy.

With the setting enabled:

  • Listeners that inherit the root protocol serve HTTP on gatewayApiResources.gateway.port (new, default 443). The HTTP to HTTPS redirect stays on port 80.
  • cert-manager is skipped for the Gateway.
  • Section-scoped ClientTrafficPolicy resources are skipped. The gateway-wide policy defaults to KeepUnchanged, stripTrailingHostDot, and the larger HTTP/2 flow-control windows of the Webservice policies, and user values win.
  • The Webservice, Registry, KAS, and Pages HTTPRoutes set X-Forwarded-Proto: https, merged into existing RequestHeaderModifier filters. A filter that already sets the header keeps its value.
  • The config check rejects global.hosts.https: false, smartcard, listeners set to HTTPS or TLS, and listeners other than http-default set to HTTP.
  • The docs stay provider-neutral: they list what the load balancer must do (port 443, port 80 for the redirect, ALPN for grpcs:// agents, optional PROXY protocol for client IP addresses) and link to the AWS Load Balancer Controller annotations.

Renders without the setting are unchanged.

flowchart LR
  C[Client] -->|HTTPS :443| LB["Load balancer<br/>terminates TLS, ALPN h2"]
  C -->|HTTP :80| LB
  LB -->|HTTP :443| L443["Envoy HTTP listeners :443<br/>gitlab-web, registry-web, kas-web, kas-workspaces-web, pages-web"]
  LB -->|HTTP :80| L80["Envoy http-default :80"]
  L80 -->|301 to HTTPS| C
  L443 -->|"X-Forwarded-Proto: https"| B["Webservice, Registry, KAS, Pages"]

Closes #6722

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.
  • Have you validated that your change works end-to-end on a real cluster deployment?
    • Partially: in kind with the bundled Envoy Gateway 1.9.2 and nginx stream as an NLB stand-in. Verified HTTP listeners on 443, h2c from the load balancer, gRPC with and without ALPN, header overwrite on all chart-managed routes including workspaces, the port 80 redirect, the HTTP/2 windows in the Envoy config dump, PROXY protocol with and without it at the load balancer, and the explicit HTTP listener case. Not tested with a full GitLab deployment or a real NLB.
  • Equivalent MR/issue for omnibus-gitlab opened. Not applicable, chart-only change.
  • When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.

Reviewers checklist

🤖 Generated with Claude Code

Edited by Clemens Beck

Merge request reports

Loading
Loading