Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gschier/digitalocean-nomad-terraform
Terraform to deploy Nomad to DigitalOcean
https://github.com/gschier/digitalocean-nomad-terraform
Last synced: 3 days ago
JSON representation
Terraform to deploy Nomad to DigitalOcean
- Host: GitHub
- URL: https://github.com/gschier/digitalocean-nomad-terraform
- Owner: gschier
- Created: 2020-05-16T03:21:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T20:51:09.000Z (over 4 years ago)
- Last Synced: 2024-11-09T20:38:06.721Z (about 1 month ago)
- Language: HCL
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform for Nomad on DigitalOcean
**NOTE: This is an experiment, please only use for reference**
```bash
# Bootstrap the clusterterraform init
terraform apply# A ./gen/ssh.sh and ./gen/tunnel.ssh will be generated with the
# droplet IPs populated to help get started./gen/ssh.sh # To SHH into primary node
./gen/tunnel.ssh # To start SSH tunnel for Nomad/Vault/Consul/Fabio UIs
```You will be prompted for a DigitalOcean token, SSH fingerprint, and custer size (1, 3 or 5).
## Current Status
This currently installs the following:
- [x] DigitalOcean droplets
- [x] DigitalOcean firewall
- [x] DigitalOcean load balancer
- [x] DigitalOcean VPC
- [x] DigitalOcean DNS record
- [x] [Nomad](https://www.nomadproject.io) configured as both client/server
- [x] [Consul](https://www.consul.io) for client/server usage
- [x] [Vault](https://www.vaultproject.io) for secret sharing
- [x] Example web service and [Fabio](https://fabiolb.net) Proxy for load balancing## Boostrapping Cluster
Here are the steps to get the cluster up and running:
1. Run `terraform init` and `terraform apply` to create initial resources
2. Initialize Vault with root token
3. Unseal Vault on each node
4. Set Vault token in each Nomad config file## Upgrading Cluster
To upgrade the cluster, the following steps must be taken for each node:
1. Drain the Nomad client that will be upgraded
2. Promote a new server leader if the leader is the one being upgraded
3. Taint resource using Terraform
4. Apply single resource using Terraform
5. Set Vault token in Nomad config file
6. Unseal Vault on new node