Git Product home page Git Product logo

me-gcp-sandbox's Introduction

My HashiCorp Google Cloud Sandbox

This repository contains a series of Terraform configurations that can be used to build a "HashiStack" in a single or multiple regions

  1. Each "HashiStack" consists of the following:
    • 1 Bastion host
    • 3 Consul servers
    • 3 Vault server
      • Using Integrated Storage (Raft) -or-
      • using the above Consul servers for storage
    • 3 Nomad servers
    • 3 Nomad clients

Requirements

To use these Terraform configs you will need to setup the following.

  1. A GCP project

  2. A OAuth2 token to use with Terraform

  3. A domain name or subdomain

    Use my Sandbox DNS module to create the domain.

  4. A network in your project

    You can use my Sandbox Network module to create the VPC and subnets.

  5. Wildcard SSL/TLS certificates for each zone you will be deploying your stack into.

    You can use my Sandbox SSL module to create certificates with Let's Encrypt.

Sandbox Setup

Setup of our sandbox is done in two phases. The first phase is the base network, SSL/TLS certificate, and DNS creation. These components will rarely be changed and are needed by the other modules as inputs. It is recommended to store the state files for all of these in cloud storage (Terraform Cloud, GCP Storage Bucket, etc.), as we use these remote state files as data sources for all our sandbox deployments.

The second phase will be the setup of our various testing environments.

Setup Network Foundation

We need to create the VPC and subnets that will be used by all the systems first. The Terraform config for this is in the GCP Sandbox Network repo.

Setup DNS Zone

Create subdomain for services. The Terraform config for this is in the GCP Sandbox DNS repo.

Create SSL/TLS Certificates

Create a wildcard SSL/TLS certificate for each zone you will be deploying services. The Terraform config for this is in the GCP Sandbox SSL repo.

Sandbox Image

Image login

Setup OS Login

Login to OS will be _hashicorp_com (as in your e-mail [email protected])

Building Image

We use a custom Ubuntu 20.04 image for all the "HashiStack" systems. This image is built with Packer.

Create a packer variables file: packer/local.auto.pkrvars.hcl

project_id      = "awesomeuser-sandbox"
username        = "awesomeuser"
zone            = "us-central1-f"
consul_ent      = true
nomad_ent       = true
vault_ent       = true
consul_lic_file = "/Volumes/GoogleDrive/My Drive/licenses/consul.hclic"
nomad_lic_file  = "/Volumes/GoogleDrive/My Drive/licenses/nomad.hclic"
vault_lic_file  = "/Volumes/GoogleDrive/My Drive/licenses/vault.hclic"

Build image with packer build -force . while in the packer directory.

Examples

Single stack example ./examples/1-Stack

Three region stack ./examples/3-Stacks

Three region stack (isolated) ./examples/3-Stacks No Auto

Three region stack with Nomad ACLs ./examples/3-Stacks with ACLs

me-gcp-sandbox's People

Contributors

methridge avatar

Stargazers

 avatar

Watchers

 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.