Add custom domain support to GitLab Pages
Technically, GitLab Pages support listening on multiple listen addresses (ip:port). For custom domains to be supported, at least one such public IP is required (so that users can point their domains at this address). This issue discusses how we want to do this in k8s.
-
If we want to just support custom domains, we can make the GitLab Pages service a
LoadBalancer
one and specify aLoadBalancerIP
. At least in GKE, this will automatically create a load balancer (and a forwarding rule) which ensures requests hitting that IP will reach the cluster. -
However, if we want to support multiple IP addresses, users will have to manually create these load balancers themselves (that is, ensure the requests hitting those IPs reach the cluster), and then we specify them in
externalIPs
field of the GitLab Pages service. -
An alternative to this is making GitLab Pages the default backend of nginx-ingress and not use a separate IP at all. Any host not caught by any of the ingresses will go to Pages, and then Pages will issue a 404 if such a domain is not specified for any projects.