Coder Social home page Coder Social logo

csanquer / gitlab-setup Goto Github PK

View Code? Open in Web Editor NEW
58.0 7.0 29.0 38 KB

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

License: MIT License

Makefile 5.60% Shell 6.25% HCL 86.56% Smarty 1.59%
terraform aws packer ansible gitlab gitlab-ci immutable-server infrastructure-as-code

gitlab-setup's Introduction

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

gitlab-setup's People

Contributors

barkerd427 avatar csanquer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.