Auto DevOps on production domain without subdomain

Hi everyone,

Everything is in the title, how to get the production environment to use the base domain, without subdomain?

I tried to add an “A” record DNS with DOMAIN and *.DOMAIN to the cluster IP
But as GitLab Auto DevOps won’t register the production environment to the base domain without a subdomain, it’s not so simple.

I also tried to add a “CNAME” record with DOMAIN to the production domain given by Auto DevOps, but it didn’t work either. (Or I misunderstood how to add the record properly?)

Thanks for your help.

Go to Settings > CI/CD > Variables

Add a variable PRODUCTION_ADDITIONAL_HOSTS
Set the value to the desired domain wanted (ex. “www.DOMAIN, DOMAIN, more.DOMAIN”)

Redeploy, enjoy

What DNS settings should be used when setting PRODUCTION_ADDITIONAL_HOSTS to DOMAIN (e.g. example.com)? With the GitLab-recommended wildcard A-record that maps all subdomains to the Ingres IP, and ADDITIONAL_HOSTS set to example.com, the deploy step succeeds but I cannot access the app at example.com. Using any subdomain, even www.example.com works fine, but I still cannot make this work without a subdomain.

I ended up having two A-records, one for the wildcard subdomain, and another as the “default” (on Google Domains DNS, they use @ for the default) both pointing at the Ingres external IP.

It’s almost perfect but when you check the certificate in your browser you see that the certificiate share the same as the base domain. ex: le123456.gitlab.domain.com if my base auto devops domain is gitlab.domain.com That is not cool ! People can see what’s your auto devops base domain.

1 Like