Support KAS gRPC Ingress with Traefik
What does this MR do?
Support KAS gRPC Ingress with Traefik
With global.ingress.provider: traefik and
global.kas.ingress.grpc.enabled: true, the KAS gRPC Ingress now works
with Traefik v3 as an external Ingress controller:
- The gRPC Ingress matches the
/gitlab.agent.path prefix through therouter.pathmatcher: PathPrefixannotation, because Traefik's PathRegexp is unanchored. - The Ingress routes to a dedicated
<release>-kas-grpcService for the agent port, annotated withservice.serversscheme: h2c(orhttpswith KAS TLS). Traefik picks the backend protocol per Service, and the KAS Kubernetes API proxy behind the main Service does not accept h2c. - With KAS TLS, the chart renders a Traefik
ServersTransport(requires Traefik v3.4 or later) that both KAS Services use with thehttpsscheme, mirroring theproxy-ssl-*annotations for NGINX.
gRPC stays opt-in for Traefik, because it also needs configuration on the Traefik entrypoint, which the chart cannot manage. The defaults are unchanged.
Split out of this MR to keep it reviewable:
- CI for the k3d Traefik environment over HTTPS and a controller-independent KAS feature spec: !5453 (merged) (stacked on this MR)
- Workspaces routing fixes, including workspaces with KAS TLS: !5454 (merged)
Related issues
Closes KAS gRPC Ingress: render and test default annot... (#6659 - closed) • Clemens Beck
Test Plan
-
Setup a fresh (GKE) cluster and install third party dependencies through
scripts/dev_dependencies.sh -
Install Traefik
ingressClass: enabled: true name: traefik ports: websecure: transport: respondingTimeouts: readTimeout: 0 # the 60s default cuts the agent's gRPC tunnel accessLog: enabled: truehelm repo add traefik https://traefik.github.io/charts helm upgrade --install traefik traefik/traefik --version 41.6.0 \ -n traefik --create-namespace -f traefik-values.yaml --wait -
Deploy GitLab
certmanager-issuer: email: webmaster@example.com global: hosts: domain: example.com gatewayApi: enabled: false installEnvoy: false ingress: enabled: true provider: traefik class: traefik configureCertmanager: true useNewIngressForCerts: true annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure kas: ingress: grpc: enabled: true -
In GitLab, create a project and register an agent under Operate > Kubernetes clusters > Connect a cluster. Copy the agent token.
-
Confirm the advertised address uses grpc(s)
-
Install the agent and confirm the agent shows as connected in Operate > Kubernetes clusters.
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?
- Describe how you did it in a comment.
-
Equivalent MR/issue foromnibus-gitlabopened. -
When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.
Reviewers checklist
- As soon as you begin reviewing, select Start a review on your first comment so the MR shows Reviewer started review.
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.