This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Update readme #48
Open
hngerebara
wants to merge
5
commits into
hashicorp:master
Choose a base branch
from
hngerebara:update-readme
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update readme #48
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,81 @@ | ||
<!-- | ||
:type: service | ||
:name: HashiCorp Consul | ||
:icon: /_docs/consul.png | ||
:description: Deploy a Consul cluster. Supports automatic bootstrapping, DNS, Consul UI, and auto healing. | ||
:category: Service discovery, service mesh | ||
:cloud: google | ||
:tags: consul, iam | ||
:license: open-source | ||
:built-with: terraform | ||
--> | ||
|
||
[![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_gcp_consul) | ||
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg) | ||
# Consul for Google Cloud Platform (GCP) | ||
|
||
This repo contains a Terraform Module for how to deploy a [Consul](https://www.consul.io/) cluster on | ||
[GCP](https://cloud.google.com/) using [Terraform](https://www.terraform.io/). Consul is a distributed, highly-available | ||
tool that you can use for service discovery and key/value storage. A Consul cluster typically includes a small number | ||
of server nodes, which are responsible for being part of the [consensus | ||
quorum](https://www.consul.io/docs/internals/consensus.html), and a larger number of client nodes, which you typically | ||
run alongside your apps: | ||
|
||
![Consul architecture](https://github.com/hashicorp/terraform-google-consul/blob/master/_docs/architecture.png?raw=true) | ||
|
||
|
||
|
||
## How to use this Module | ||
|
||
Each Module has the following folder structure: | ||
|
||
* [modules](https://github.com/hashicorp/terraform-google-consul/tree/master/modules): This folder contains the reusable | ||
code for this Module, broken down into one or more submodules. | ||
* [examples](https://github.com/hashicorp/terraform-google-consul/tree/master/examples): This folder contains examples | ||
of how to use the submodules. | ||
* [test](https://github.com/hashicorp/terraform-google-consul/tree/master/test): Automated tests for the submodules and | ||
examples. | ||
of server nodes, which are responsible for being part of the [consensus quorum](https://www.consul.io/docs/internals/consensus.html), and a larger number of client nodes, which you typically run alongside your apps: | ||
|
||
To deploy Consul servers using this Module: | ||
![Terraform Google Consul](https://raw.githubusercontent.com/hashicorp/terraform-google-consul/master/_docs/architecture.png) | ||
|
||
1. Create a Consul Image using a Packer template that references the [install-consul module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-consul). | ||
Here is an [example Packer template](https://github.com/hashicorp/terraform-google-consul/tree/master/examples/consul-image#quick-start). Note that Google Cloud does not support custom | ||
public Images so you must build this Packer template on your own to proceed. | ||
|
||
1. Deploy that Image across a Compute Instance Group using the Terraform [consul-cluster module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/consul-cluster) | ||
and execute the [run-consul script](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/run-consul) with the `--server` flag during boot on each | ||
Instance in the Compute Instance Group to form the Consul cluster. Here is [an example Terraform | ||
configuration](https://github.com/hashicorp/terraform-google-consul/tree/master/examples/root-example#quick-start) to provision a Consul cluster. | ||
## Features | ||
* Deploy Consul servers and agents | ||
* Automatic bootstrapping | ||
* Auto healing | ||
* Auto DNS configuration | ||
* Consul UI | ||
|
||
|
||
To deploy Consul clients using this Module: | ||
## Learn | ||
|
||
1. Use the [install-consul module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-consul) to install Consul alongside your application code. | ||
1. Before booting your app, execute the [run-consul script](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/run-consul) with `--client` flag. | ||
1. Your app can now usr the local Consul agent for service discovery and key/value storage. | ||
1. Optionally, you can use the [install-dnsmasq module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-dnsmasq) to configure Consul as the DNS for a | ||
specific domain (e.g. `.consul`) so that URLs such as `foo.service.consul` resolve automatically to the IP | ||
address(es) for a service `foo` registered in Consul (all other domain names will be continue to resolve using the | ||
default resolver on the OS). | ||
This repo is maintained by [Gruntwork](https://www.gruntwork.io), and follows the same patterns as [the Gruntwork Infrastructure as Code Library](https://gruntwork.io/infrastructure-as-code-library/), a collection of reusable, battle-tested, production ready infrastructure code. You can read [How to use the Gruntwork Infrastructure as Code Library](https://gruntwork.io/guides/foundations/how-to-use-gruntwork-infrastructure-as-code-library/) for an overview of how to use modules maintained by Gruntwork! | ||
|
||
## Core concepts | ||
|
||
* Consul Use Cases: overview of various use cases that consul is optimized for. | ||
* [Service Discovery](https://www.consul.io/discovery.html) | ||
|
||
* [Service Mesh](https://www.consul.io/mesh.html) | ||
|
||
## What's a Terraform Module? | ||
* [Consul Guides](https://learn.hashicorp.com/consul?utm_source=consul.io&utm_medium=docs&utm_content=top-nav): official guide on how to use Consul service to discover services and secure network traffic. | ||
|
||
A Terraform Module refers to a self-contained packages of Terraform configurations that are managed as a group. This repo | ||
is a Terraform Module and contains many "submodules" which can be composed together to create useful infrastructure patterns. | ||
|
||
* [Deploy Consul Servers and Clients](core-concepts.md): Learn how to deploy consul servers and clients using this repo. | ||
|
||
## Repo organization | ||
|
||
## Who maintains this Terraform Module? | ||
* [modules](https://github.com/hashicorp/terraform-google-consul/tree/master/modules): the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules. | ||
* [examples](https://github.com/hashicorp/terraform-google-consul/tree/master/examples): This folder shows examples of different ways to combine the modules in the `modules` folder to deploy Consul. | ||
* [test](https://github.com/hashicorp/terraform-google-consul/tree/master/test): Automated tests for the modules and examples. | ||
* [root](https://github.com/hashicorp/terraform-google-consul/tree/master): The root folder is *an example* of how to use the [consul-cluster module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/consul-cluster) module to deploy a [Consul](https://www.consul.io/) cluster in [GCP](https://cloud.google.com/). The Terraform Registry requires the root of every repo to contain Terraform code, so we've put one of the examples there. This example is great for learning and experimenting, but for production use, please use the underlying modules in the [modules folder](https://github.com/hashicorp/terraform-google-consul/tree/master/modules) directly. | ||
|
||
This Terraform Module is maintained by [Gruntwork](http://www.gruntwork.io/). If you're looking for help or commercial | ||
support, send an email to [[email protected]](mailto:[email protected]?Subject=Consul%20Terraform%20Module). | ||
Gruntwork can help with: | ||
|
||
* Setup, customization, and support for this Terraform Module. | ||
* Terraform Module for other types of Google Cloud infrastructure. | ||
* Terraform Modules that meet compliance requirements, such as HIPAA. | ||
* Consulting & Training on Google Cloud, AWS, Terraform, and DevOps. | ||
## Deploy | ||
|
||
### Non-production deployment (quick start for learning) | ||
If you just want to try this repo out for experimenting and learning, check out the following resources: | ||
|
||
* [examples folder](https://github.com/hashicorp/terraform-google-consul/tree/master/examples): The `examples` folder contains sample code optimized for learning, experimenting, and testing (but not production usage). | ||
|
||
## Code included in this Terraform Module: | ||
### Production deployment | ||
|
||
* [install-consul](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-consul): This module installs Consul using a [Packer](https://www.packer.io/) | ||
template to create a Consul [Custom Image](https://cloud.google.com/compute/docs/images). | ||
If you want to deploy this repo in production, check out the following resources: | ||
|
||
* [consul-cluster](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/consul-cluster): The module includes Terraform code to deploy a Consul Image across a [Managed | ||
Compute Instance Group](https://cloud.google.com/compute/docs/instance-groups/). | ||
* [Consul Setup Guide](https://learn.hashicorp.com/consul/datacenter-deploy/deployment-guide) | ||
|
||
* [run-consul](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/run-consul): This module includes the scripts to configure and run Consul. It is used | ||
by the above Packer module at build-time to set configurations, and by the Terraform module at runtime | ||
with the Instance's [Startup Script](https://cloud.google.com/compute/docs/startupscript) to create the cluster. | ||
## Support | ||
If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers [Commercial Support](https://gruntwork.io/support/) via Slack, email, and phone/video. If you're already a Gruntwork customer, hop on Slack and ask away! If not, [subscribe now](https://www.gruntwork.io/pricing/). If you're not sure, feel free to email us at [[email protected]](mailto:[email protected]). | ||
|
||
* [install-dnsmasq module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-dnsmasq): Install [Dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) | ||
and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server | ||
for URLs such as `foo.service.consul`. | ||
|
||
## How do I contribute to this Terraform Module? | ||
## How do I contribute to this Module? | ||
|
||
Contributions are very welcome! Check out the [Contribution Guidelines](https://github.com/hashicorp/terraform-google-consul/tree/master/CONTRIBUTING.md) for instructions. | ||
|
||
|
||
|
||
## How is this Terraform Module versioned? | ||
|
||
This Terraform Module follows the principles of [Semantic Versioning](http://semver.org/). You can find each new release, | ||
along with the changelog, in the [Releases Page](https://github.com/hashicorp/terraform-google-consul/releases). | ||
|
||
During initial development, the major version will be 0 (e.g., `0.x.y`), which indicates the code does not yet have a | ||
stable API. Once we hit `1.0.0`, we will make every effort to maintain a backwards compatible API and use the MAJOR, | ||
MINOR, and PATCH versions on each release to indicate any incompatibilities. | ||
|
||
|
||
|
||
## License | ||
|
||
This code is released under the Apache 2.0 License. Please see [LICENSE](https://github.com/hashicorp/terraform-google-consul/tree/master/LICENSE) and [NOTICE](https://github.com/hashicorp/terraform-google-consul/tree/master/NOTICE) for more | ||
details. | ||
|
||
Copyright © 2017 Gruntwork, Inc. | ||
Please see [LICENSE](LICENSE) for details on how the code in this repo is licensed. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#### To deploy Consul servers for production using this repo: | ||
|
||
1. Create a Consul Image using a Packer template that references the [install-consul module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-consul). | ||
Here is an [example Packer template](https://github.com/hashicorp/terraform-google-consul/tree/master/examples/consul-image#quick-start). | ||
Note that Google Cloud does not support custom | ||
public Images so you must build this Packer template on your own to proceed. | ||
|
||
|
||
2. Deploy that Image across a Compute Instance Group using the Terraform [consul-cluster module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/consul-cluster) | ||
and execute the [run-consul script](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/run-consul) with the `--server` flag during boot on each | ||
Instance in the Compute Instance Group to form the Consul cluster. Here is an example [Terraform configuration](https://github.com/hashicorp/terraform-google-consul/tree/master/examples/root-example#quick-start) to provision a Consul cluster. | ||
|
||
#### To deploy Consul clients for production using this repo: | ||
|
||
1. Use the [install-consul module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-consul) to install Consul alongside your application code. | ||
1. Before booting your app, execute the [run-consul script](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/run-consul) with `--client` flag. | ||
1. Your app can now use the local Consul agent for service discovery and key/value storage. | ||
1. Optionally, you can use the [install-dnsmasq module](https://github.com/hashicorp/terraform-google-consul/tree/master/modules/install-dnsmasq) to configure Consul as the DNS for a | ||
specific domain (e.g. `.consul`) so that URLs such as `foo.service.consul` resolve automatically to the IP | ||
address(es) for a service `foo` registered in Consul (all other domain names will be continue to resolve using the | ||
default resolver on the OS). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.