Skip to content

Add support for custom domains in GitLab Pages

Balasankar 'Balu' C requested to merge 2442-pages-custom-domains into master

What does this MR do?

Add support for using custom domains with GitLab Pages.

Things to note

  1. When custom domains are used, a new service (gitlab-pages-custom-domains) is spun up and the default pages service is disabled. This new service, by default uses a LoadBalancer but can be made to work over noderport too.
  2. We support setting one or more external IPs. If one, we use loadBalancerIP and will hopefully take care of IP being tied to the cluster (in GKE, this is automatically done by creating a loadbalancer and forwarding rule which forwards requests hitting the IP to the cluster target pool). If multiple, users have to ensure requests hitting those IPs reach the k8s cluster (in GKE, this means create External IPs, LoadBalancers and Forwarding rules).
  3. When custom domains are used, Pages handles all requests - both via <naemspace>.<pages domain> and via custom domain. This is done by specifying listen-http and listen-https directives in Pages config file.
  4. When custom domains are used, listen-proxy is no longer used because of point above. Instead, we are reusing the internal port (8090) for HTTP requests. HTTPS requests are handled by a different port (8091).
  5. Custom domains supporting HTTPS require wildcard certificate for *.<pages domain> to be mounted in the file system.
  6. We expect users to point *.<pages domain> subdomains to point at any of (if multiple) external IPs that is tied to Pages. Ingress no longer plays a role here.

Related issues

Closes #2442 (closed)

Checklist

See Definition of done.

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

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
Edited by Balasankar 'Balu' C

Merge request reports