All Projects → sethvargo → Atlantis On Gke

sethvargo / Atlantis On Gke

Licence: apache-2.0
A set of @HashiCorp Terraform configurations for running Atlantis on @GoogleCloud GKE

Projects that are alternatives of or similar to Atlantis On Gke

K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+984.09%)
Mutual labels:  hashicorp, terraform, hcl
Terraform Google Vault
Terraform module to deploy Vault as a container on Google Cloud Run
Stars: ✭ 25 (-43.18%)
Mutual labels:  google-cloud, terraform, hcl
Hcloud Okd4
Deploy OKD4 (OpenShift) on Hetzner Cloud
Stars: ✭ 29 (-34.09%)
Mutual labels:  hashicorp, terraform, hcl
Airflow Toolkit
Any Airflow project day 1, you can spin up a local desktop Kubernetes Airflow environment AND one in Google Cloud Composer with tested data pipelines(DAGs) 🖥 >> [ 🚀, 🚢 ]
Stars: ✭ 51 (+15.91%)
Mutual labels:  google-cloud, terraform, hcl
Terraform Kubernetes
Example of deploying a Kubernetes cluster to Google Cloud using Terraform
Stars: ✭ 152 (+245.45%)
Mutual labels:  google-cloud, terraform, hcl
Typhoon
Minimal and free Kubernetes distribution with Terraform
Stars: ✭ 1,397 (+3075%)
Mutual labels:  google-cloud, terraform, hcl
Vaultron
🤖 Vault clusters Terraformed onto Docker for great fun and learning!
Stars: ✭ 96 (+118.18%)
Mutual labels:  hashicorp, terraform, hcl
Terraformer
CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Stars: ✭ 6,316 (+14254.55%)
Mutual labels:  google-cloud, terraform, hcl
Terraform Best Practices
Terraform Best Practices for AWS users
Stars: ✭ 931 (+2015.91%)
Mutual labels:  hashicorp, terraform, hcl
Terraform Aws Jenkins Ha Agents
A terraform module for a highly available Jenkins deployment.
Stars: ✭ 41 (-6.82%)
Mutual labels:  terraform, hcl
Terraform Best Practices
Terraform best practices (constantly updating)
Stars: ✭ 940 (+2036.36%)
Mutual labels:  terraform, hcl
Terraform Aws Ecs Fargate
Terraform module which creates ECS Fargate resources on AWS.
Stars: ✭ 35 (-20.45%)
Mutual labels:  terraform, hcl
Cloudguardiaas
Check Point CloudGuard Network Security repository containing solution templates, Terraform templates, tools and scripts for deploying and configuring CloudGuard Network Security products.
Stars: ✭ 27 (-38.64%)
Mutual labels:  terraform, hcl
Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-43.18%)
Mutual labels:  terraform, hcl
Terra Aws Core Kube
Terraform configuration to bootstrap a Kubernetes Cluster on top of CoreOS using AWS-EC2 instances
Stars: ✭ 10 (-77.27%)
Mutual labels:  terraform, hcl
Terraform Modules
Terraform Modules
Stars: ✭ 25 (-43.18%)
Mutual labels:  terraform, hcl
Terraform Reference
Terraform reference / skel Control Repo for building for building multi-tier services
Stars: ✭ 33 (-25%)
Mutual labels:  terraform, hcl
Terraform Aws Iam Role
Terraform module to create AWS IAM Role.
Stars: ✭ 28 (-36.36%)
Mutual labels:  terraform, hcl
Doact
A Terraform module for hosting your own runner for CI/CD on Digital Ocean to run jobs in your GitHub Actions workflows. 🚀
Stars: ✭ 42 (-4.55%)
Mutual labels:  terraform, hcl
Vector Test Harness
End-to-end test harness for the Vector observability data router
Stars: ✭ 32 (-27.27%)
Mutual labels:  terraform, hcl

Atlantis on GKE with Terraform

These Terraform configurations provision an Atlantis cluster on Google Kubernetes Engine using HashiCorp Terraform as the provisioning tool.

Feature Highlights

  • Google Cloud Storage Backend - Automatically creates a GSC storage bucket for use with Terraform.

  • Dedicated Service Account - There's a dedicated service account with access to the storage bucket which can be given to Terraform or attached to instances executing Terraform.

  • (Self-signed) TLS - Automatically generates certificates and secures the Atlantis server with them. This could be replaced with real certificates if needed.

  • Automatic GitHub Repo Creation & Configuration - Automatically creates a dedicated (private) GitHub repository with the Atlantis webhook configured automatically.

Requirements

  1. A Google Cloud Organization because these configurations create a new project which (through Terraform) must be associated with an organization.

  2. A GitHub Organization (not a personal account) because the Terraform GitHub provider does not support personal accounts

Tutorial

  1. Download and install Terraform

  2. Download, install, and configure the Google Cloud SDK. You will need to configure your default application credentials so Terraform can run. It will run against your default project, but all resources are created in the (new) project that it creates.

  3. Run Terraform:

    $ cd terraform/
    $ terraform init
    $ terraform apply
    

    This operation will take some time as it:

    1. Creates a new project
    2. Enables the required services on that project
    3. Creates a bucket for Terraform remote state
    4. Creates a service account with the most restrictive permissions to those resources
    5. Creates a GKE cluster with the configured service account attached
    6. Creates a public IP
    7. Generates a self-signed certificate authority (CA)
    8. Generates a certificate signed by that CA
    9. Configures Terraform to talk to Kubernetes
    10. Creates a Kubernetes secret with the TLS file contents
    11. Submits the Atlantis Pod and Service (LoadBalancer) to the Kubernetes API
    12. Creates a sample "demo" folder with Terraform configurations that are pre-configured to connect to the provisioned Google Cloud Storage backend with customer-provided encryption keys.

Run Locally

  1. Configure local Terraform with the correct credentials

    cd demo/
    source env.sh
    
  2. Run some commands

    $ terraform plan
    $ terraform apply
    
  3. Go to GitHub

  4. Make a change

    n1-standard-1 -> n1-standard-2
    
  5. Open a Pull Request with the changes on a new branch

  6. Plan changes

    atlantis plan
    
  7. Apply changes

    atlantis apply
    

Cleaning Up

$ cd terraform/

# If you ran locally
$ unset GOOGLE_PROJECT
$ unset GOOGLE_ENCRYPTION_KEY
$ unset GOOGLE_CREDENTIALS

$ terraform destroy

Note that this can sometimes fail. Re-run it and it should succeed. If things get into a bad state, you can always just delete the project.

Security

This set of Terraform configurations is designed to make your life easy. Some data, including the TLS certificates and webhook secrets will be stored in your state file in plain text.

License & Author

Copyright 2018 Google, Inc.
Copyright 2018 Seth Vargo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].