Skip to content

An example terraform + terragrunt repository. Features Google Kubernetes Engine, Google Cloud SQL, Google Cloud Proxy, NGINX.

License

Notifications You must be signed in to change notification settings

Harjot1Singh/terraform-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

terraform-example

This repository contains an example terraform + terragrunt configuration to deploy infrastructure declaratively as code.

View the accompanying blog post: http://harjot.me/blog/deploying-docker-containers-to-gke-using-terraform

The following prerequisites are required:

  • Google Cloud Project per environment (development + production)
  • Kubectl
  • Terraform
  • Terragrunt

The following will be deployed by the repo:

Structure

All terraform files in terraform. Usually, this would sit alongside application code.

terraform/modules contain Terraform-only reusable module definitions.

terraform/live/[env] contain subfolders for each service/infrastructure, each containing a terragrunt.hcl which reference the aforementioned modules.

Usage

cd into terraform/live/[development] or [production] depending on the environment you'd like to work with. You can run terragrunt plan-all or terragrunt apply-all.

Production Tips

These will be implemented in the future.

  • Use a Cloud Proxy Sidecar to allow your applications to interact with Cloud SQL.
  • Use an Ingress Controller instead of exposing each service as a LoadBalancer. This way you have one central point of entry. The Traefik controller is great.

About

An example terraform + terragrunt repository. Features Google Kubernetes Engine, Google Cloud SQL, Google Cloud Proxy, NGINX.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages