Search code examples
dnsgitlabsubdomaingitlab-cigitlab-ci-runner

I tried to setup Gitlab pages and it broke the VM?


I have been running a gitlab instance and today I was trying to setup the pages function. I followed the gitlab guides and google cloud docs, it seems my config file got corrupt or broke (by me ofc) and even the ssh was down (directly on google console) till I rebooted the VM. Now I'm able to see that the instance is working on the shell but can't get it back online, I have 3 options here, 1) I wait a day or so to see if this is a domain/dns issue, 2) keep trying to a recover the gitlab that only had 3 users and no projects, or 3) make a fresh one and try to setup everything well from the start. The only things bothering me is losing 2 users that came to my project organically.

What can I do here? I'm trying to fix the config file but at the same time I don't know if its a domain issue because I had to change some dns configs to set the subdomain. The only thing I cannot understand really is how or why did my shell went down for at least a hour after I changed the configurations for gitlab. And btw are snapshots the right way to make backups with gcloud ?


Solution

  • I decided to answer my question since I know how this problem occurred and it may occur for others.

    Conditions:

    Have a Gitlab self hosted.

    Try to setup DNS settings for Gitlab Pages and the URL stop responding even if the Gitlab instance still runs on the machine.

    Here we can see the problem was in the DNS setup. In my case I setup different DNS cases in my DOMAIN service DNS settings. Instead this DNS setup have to be made in your HOST/SERVER side.

    To properly make a Gitlab DNS:

    the wildcard domain *.mydomain.com type A should be on the server config, in my case gcloud DNS. Find out the software you use for your main machine server config.

    Its good practice to setup the domain and server without redirection and set the proper DNS on the DOMAIN settings. This way your domain will resolve the subdomains without need for redirection on the DOMAIN settings. Once you set a wildcard type A record you can or cannot make the subdomain as a CNAME example, subdomain.mydomain.com. or you can use a separate IP for the subdomain with a type A record.

    In summary, when setting up Gitlab Pages DNS do not change your DOMAIN settings, change your SERVER DNS settings.