Home
Softono

Gitlab Setup

Open source MIT HCL
57
Stars
28
Forks
0
Issues
5
Watchers
8 years
Last Commit

 About Gitlab Setup

A Packer / Terraform / Ansible configuration to install Gitlab and Gitlab-CI

Platforms

Web Self-hosted

Languages

HCL

Links

Need Help Installing Gitlab Setup?

We provide expert installation service for this software. Our team will install, configure, and secure Gitlab Setup on your server. plans start at just $30.

Gitlab Setup

View on GitHub

Gitlab HA setup template on AWS

This template is a POC to setup a Gitlab system with High Availability on Amazon Web Service Cloud.

This template is heavily inspired by Gitlab university : HA on AWS.

The project tries to follow Immutable server pattern and Infrastructure-as-Code principles by using :

Requirements

  • a AWS account (Be careful this template implies creating billable resources on AWS cloud)

    You will need an AWS access key and enough admin permissions to create AWS ressources

  • a AWS Route 53 DNS zone already created (the template will add new subdomain DNS A records)

  • a SSH Key pair to connect to Gitlab and AWS instances (see Github help for examples)

  • Packer >= 0.12

  • Terraform >= 8.2

  • GNU Make or some Unix equivalent Implementation

  • (optional) Graphiz to generate Terraform config Graph Images

    # on ubuntu/debian
    sudo apt-get install graphviz
    

Usage

Download the terraform and packer templates

git clone --recursive https://github.com/csanquer/gitlab-setup.git

To create the Gitlab infrastructure

  1. Copy and edit the configuration files :
  • terraform : terraform/terraform.dist.tfvars to terraform/terraform.tfvars
  • packer : packer/config.dist.json to packer/config.json
  1. create Amazon Machine Images :
  • Gitlab
  • Gitlab-CI-multirunner
make ami
  1. check Terraform plan
make plan
  1. if terraform plan is correct, create AWS resources by applying the terraform plan
make apply
  • you can check again the terraform exported variables output
    make output
    
  • you can also get Graphviz graphs of all terraform config
    # in PNG image format
    make graphs
    # or in SVG
    make graphs format=svg
    

After creation, wait for a few minutes the autoscaled gitlab instances finish self initialization.

if variables are set in terraform/terraform.tvars like :

aws_dns_zone = "my-aws.net"
gitlab_dns_subdomain = "gitlab"

The Gitlab server should be available to http://gitlab.my-aws.net/

To destroy the Gitlab infrastructure

make destroy