-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee90496
commit 6d04721
Showing
8 changed files
with
231 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*/temp* | ||
*/*/temp* | ||
temp? | ||
*.md | ||
!LICENSE.md | ||
.git |
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,3 @@ | ||
VAULT_TAG=0.10.4 | ||
CONSUL_TAG=1.2.2 | ||
STACK_NAME=devops |
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 @@ | ||
.DS_Store |
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,2 +1,27 @@ | ||
# vault-consul-swarm-cluster | ||
vault-consul-swarm-cluster | ||
|
||
|
||
## Deploy Stack | ||
``` | ||
env $(cat .env | grep ^[A-Z] | xargs) docker stack deploy -c stack.yml devops | ||
``` | ||
|
||
## Remove Stack | ||
``` | ||
docker stack rm devops | ||
``` | ||
|
||
## List Docker Services | ||
``` | ||
docker service ls | ||
``` | ||
|
||
## Access Vault UI | ||
``` | ||
open http://localhost:8200 | ||
``` | ||
|
||
## Access Consul UI | ||
``` | ||
open http://localhost:8500 | ||
``` |
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,32 @@ | ||
{ | ||
"server": false, | ||
"datacenter": "us-east-1", | ||
"data_dir": "/consul/data", | ||
"client_addr": "0.0.0.0", | ||
"bind_addr": "{{ GetInterfaceIP \"eth0\" }}", | ||
"advertise_addr" : "{{ GetInterfaceIP \"eth0\" }}", | ||
"ui": false, | ||
"leave_on_terminate" : true, | ||
"skip_leave_on_interrupt" : false, | ||
"disable_update_check": true, | ||
"addresses" : { | ||
"http" : "0.0.0.0" | ||
}, | ||
"ports": { | ||
"http": 8500 | ||
}, | ||
"log_level": "DEBUG", | ||
"acl_enforce_version_8": false, | ||
"acl_datacenter": "us-east-1", | ||
"acl_master_token": "w94RIMKUtQH1a4VJGN+t+vn1Y0nErc/ch93E1F1ZcHU=", | ||
"acl_default_policy": "allow", | ||
"connect" : { | ||
"enabled" : true | ||
}, | ||
"dns_config": { | ||
"allow_stale": false | ||
}, | ||
"retry_join" : [ | ||
"tasks.consulserver" | ||
] | ||
} |
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,37 @@ | ||
{ | ||
"bootstrap": true, | ||
"server": true, | ||
"datacenter": "us-east-1", | ||
"data_dir": "/consul/data", | ||
"client_addr": "0.0.0.0", | ||
"bind_addr": "{{ GetInterfaceIP \"eth0\" }}", | ||
"advertise_addr" : "{{ GetInterfaceIP \"eth0\" }}", | ||
"bootstrap_expect": 1, | ||
"ui": true, | ||
"leave_on_terminate" : true, | ||
"skip_leave_on_interrupt" : true, | ||
"disable_update_check": true, | ||
"addresses" : { | ||
"http" : "0.0.0.0" | ||
}, | ||
"ports": { | ||
"http": 8500 | ||
}, | ||
"log_level": "DEBUG", | ||
"acl_enforce_version_8": false, | ||
"acl_datacenter": "us-east-1", | ||
"acl_master_token": "w94RIMKUtQH1a4VJGN+t+vn1Y0nErc/ch93E1F1ZcHU=", | ||
"acl_default_policy": "allow", | ||
"connect" : { | ||
"enabled" : true | ||
}, | ||
"dns_config": { | ||
"allow_stale": false | ||
}, | ||
"autopilot": { | ||
"cleanup_dead_servers": true | ||
}, | ||
"retry_join" : [ | ||
"tasks.consulserver" | ||
] | ||
} |
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,126 @@ | ||
version: "3.6" | ||
|
||
services: | ||
consulserver: | ||
image: consul:${CONSUL_TAG:-latest} | ||
restart: unless-stopped | ||
volumes: | ||
- ${PWD}/consul/server:/consul/config | ||
- consul_files:/consul/data | ||
ports: | ||
- target: 8300 | ||
published: 8300 | ||
mode: host | ||
- target: 8301 | ||
published: 8301 | ||
mode: host | ||
- target: 8302 | ||
published: 8302 | ||
mode: host | ||
- target: 8400 | ||
published: 8400 | ||
mode: host | ||
- target: 8500 | ||
published: 8500 | ||
mode: host | ||
- target: 8600 | ||
published: 8600 | ||
mode: host | ||
command: | ||
- agent | ||
- -server | ||
- -config-file=/consul/config/config.json | ||
- -ui | ||
networks: | ||
- devops | ||
deploy: | ||
resources: | ||
reservations: | ||
cpus: '.25' | ||
memory: 256M | ||
restart_policy: | ||
condition: on-failure | ||
delay: 5s | ||
max_attempts: 3 | ||
window: 120s | ||
update_config: | ||
order: stop-first | ||
consulagent: | ||
image: consul:${CONSUL_TAG:-latest} | ||
restart: unless-stopped | ||
volumes: | ||
- ${PWD}/consul/agent:/consul/config | ||
- consul_agent_files:/consul/data | ||
command: | ||
- agent | ||
- -config-file=/consul/config/config.json | ||
networks: | ||
- devops | ||
deploy: | ||
resources: | ||
reservations: | ||
cpus: '.25' | ||
memory: 256M | ||
restart_policy: | ||
condition: on-failure | ||
delay: 5s | ||
max_attempts: 3 | ||
window: 120s | ||
update_config: | ||
order: stop-first | ||
vault: | ||
image: vault:${VAULT_TAG:-latest} | ||
restart: unless-stopped | ||
environment: | ||
VAULT_ADDR: http://127.0.0.1:8200 | ||
VAULT_LOCAL_CONFIG: >- | ||
{ | ||
"ui": true, | ||
"backend": { | ||
"consul": { | ||
"address" : "http://consulserver:8500", | ||
"path" : "vault/" | ||
} | ||
}, | ||
"default_lease_ttl": "168h", | ||
"max_lease_ttl": "720h", | ||
"plugin_directory" : "/vault/plugins", | ||
"listener": { | ||
"tcp": { | ||
"address": "0.0.0.0:8200", | ||
"tls_disable": true | ||
} | ||
}, | ||
"disable_mlock": true | ||
} | ||
command: | ||
- server | ||
networks: | ||
- devops | ||
volumes: | ||
- vault_logs:/vault/logs | ||
- ${PWD}/vault/plugins:/vault/plugins | ||
ports: | ||
- target: 8200 | ||
published: 8200 | ||
mode: host | ||
deploy: | ||
resources: | ||
reservations: | ||
cpus: '.25' | ||
memory: 256M | ||
restart_policy: | ||
condition: on-failure | ||
delay: 5s | ||
max_attempts: 3 | ||
window: 120s | ||
update_config: | ||
order: stop-first | ||
|
||
volumes: | ||
consul_files: | ||
consul_agent_files: | ||
vault_logs: | ||
|
||
networks: | ||
devops: |
Binary file not shown.