hashistack-digitalocean
所属分类:聚类算法
开发工具:HCL
文件大小:17KB
下载次数:0
上传日期:2018-10-21 16:13:43
上 传 者:
sh-1993
说明: no intro
(Terraform to setup a consul cluster interacting with a nomad cluster)
文件列表:
main.tf (872, 2018-10-22)
modules (0, 2018-10-22)
modules\client-droplet (0, 2018-10-22)
modules\client-droplet\main.tf (2471, 2018-10-22)
modules\firewall (0, 2018-10-22)
modules\firewall\main.tf (1321, 2018-10-22)
modules\load-balancer (0, 2018-10-22)
modules\load-balancer\main.tf (566, 2018-10-22)
modules\server-droplet (0, 2018-10-22)
modules\server-droplet\main.tf (5071, 2018-10-22)
scripts (0, 2018-10-22)
scripts\consul (0, 2018-10-22)
scripts\consul\consul-client.service (397, 2018-10-22)
scripts\consul\consul-connect-enable.hcl (46, 2018-10-22)
scripts\consul\consul-server.service (470, 2018-10-22)
scripts\consul\install_consul.sh (1127, 2018-10-22)
scripts\nomad (0, 2018-10-22)
scripts\nomad\client (0, 2018-10-22)
scripts\nomad\client\client.hcl (377, 2018-10-22)
scripts\nomad\client\nomad-client.service (234, 2018-10-22)
scripts\nomad\install_nomad.sh (649, 2018-10-22)
scripts\nomad\jobs (0, 2018-10-22)
scripts\nomad\jobs\age-generator.ctmpl (1345, 2018-10-22)
scripts\nomad\jobs\fabio.ctmpl (632, 2018-10-22)
scripts\nomad\jobs\jwt-auth.ctmpl (865, 2018-10-22)
scripts\nomad\jobs\name-generator.ctmpl (1448, 2018-10-22)
scripts\nomad\jobs\startJob.sh (832, 2018-10-22)
scripts\nomad\server (0, 2018-10-22)
scripts\nomad\server\nomad-server.service (283, 2018-10-22)
scripts\nomad\server\server.hcl (835, 2018-10-22)
scripts\vault (0, 2018-10-22)
scripts\vault\install_vault.sh (400, 2018-10-22)
scripts\vault\setup_vault.sh (634, 2018-10-22)
scripts\vault\vault-config.hcl (140, 2018-10-22)
scripts\vault\vault-server.service (241, 2018-10-22)
variables.tf (137, 2018-10-22)
# Hashistack Digitalocean
Terraform to setup a consul and nomad cluster by building the number of servers and clients specified.
It wraps them around a firewall that can only be accesses via a bastion host (ssh) and a load balancer (http)
Uses digital ocean as a provider to create the droplets needed.
Sets up Vault to store secrets
Now also uses Consul Connect as a sidecar allocation to interact with other services
It starts nomad and consul as a service and automatically connects all nodes in the cluster
## Environment variables
* `do_token` - api token for digital ocean which can be found in your DigitalOcean Account under "API"
* `ssh_fingerprint` - the ssh fingerprint to use to connect to your newly created droplets
* `bastion_host_id` - the droplet id of the bastion host server
* `server_count` - number of server droplets to create
* `client_count` - number of client droplets to create
## Modules
### server-droplet
* Create servers and sets up nomad and consul in server mode
* `server_count` - number of server droplets to create
### client-droplet
* Create clients and sets up nomad and consul in client mode
* `client_count` - number of client droplets to create
* `consul_server_ip` - a consul server ip
### load-balancer
* Create a public load balancer to connect to all servers
* `all_server_ids` - ids of all servers (droplets)
### firewall
* Create a firewall around the server and client droplets
* `all_server_ids` - ids of all servers (droplets)
* `load_balancer_id` - the id of the digital ocean load balancer
* `bastion_id` - the droplet id of the bastion host
## Scripts
Scripts for installing required software in newly created droplets
### consul
`install_consul.sh client|server ${self.ipv4_address_private} ${var.consul_server_ip}`
* Installs required software - unzip and docker
* Sets up iptables to allow access to localhost from docker
* Downloads consul and copies the binary to the /user/bin directory
* Starts consul as a service in either server or client mode
* If in client mode, it joins the client to the cluster
### nomad
`install_nomad.sh client|server`
* Downloads nomad and copies the binary to the /user/bin directory
* Starts nomad as a service in either server or client mode
### vault
`install_vault.sh server`
* Downloads vault and copies the binary to the /user/bin directory
* Starts vault as a service in server mode
* Initializes Vault
* Unseals vaults to make it ready for use
* Exports the vault token for nomad to use
## How to run
* ``eval `ssh-agent -s` ``
* `ssh-add ~/.ssh/id_rsa` (add your private key to the ssh agent which corresponds to the ssh_fingerprint)
* `terraform init`
* `terraform plan`
* `terraform apply`
近期下载者:
相关文件:
收藏者: