Skip to content

Commit 6348270

Browse files
committed
added acls
1 parent 625a8a3 commit 6348270

File tree

5 files changed

+61
-19
lines changed

5 files changed

+61
-19
lines changed

datacenter-deploy-hcdiag/README.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,34 @@ Deploy a Consul datacenter containing agents with a preconfigured DNS service an
1717

1818
1. Open an interactive shell to a Consul server:
1919
1. `docker exec -it consul-server1 /bin/sh`
20-
2. Update package sources;
20+
2. Set environment variables:
21+
1. `export CONSUL_HTTP_ADDR=http://127.0.0.1:8500`
22+
2. `export CONSUL_HTTP_TOKEN=my-master-token`
23+
3. `export CONSUL_TOKEN=my-master-token`
24+
3. Check to see if all clients have successfully joined the Consul datacenter:
25+
1. `consul members`
26+
2. `curl http://127.0.0.1:8500/v1/agent/members --header "X-Consul-Token: my-master-token"`
27+
4. Update package sources;
2128
1. `apk update`
22-
3. Add curl and unzup packages:
29+
5. Add curl and unzup packages:
2330
1. `apk add curl unzip`
24-
4. Download hcdiag:
31+
6. Download hcdiag:
2532
1. `curl --silent --remote-name https://releases.hashicorp.com/hcdiag/0.1.1/hcdiag_0.1.1_linux_amd64.zip`
26-
5. Unzip hcdiag and remove the archive:
33+
7. Unzip hcdiag and remove the archive:
2734
1. `unzip hcdiag_0.1.1_linux_amd64.zip && rm -f hcdiag_0.1.1_linux_amd64.zip`
28-
6. Move the hcdiag executable to your sbin directory:
35+
8. Move the hcdiag executable to your sbin directory:
2936
1. `mv hcdiag sbin/`
30-
7. Run hcdiag for consul:
31-
1. `hcdiag -consul`
32-
2. Let it run until completion
33-
8. Look for the support package
34-
1. `ls -l *.gz`
35-
9. Unpack the archive:
36-
1. `tar zxvf support-2021-12-10T20:47:55Z.tar.gz`
37-
10. Change directory into the unpacked folder:
37+
9. Run hcdiag for consul:
38+
2. `hcdiag -consul`
39+
3. Let it run until completion
40+
10. Look for the support package
41+
4. `ls -l *.gz`
42+
11. Unpack the archive:
43+
5. `tar zxvf support-2021-12-10T20:47:55Z.tar.gz`
44+
12. Change directory into the unpacked folder:
3845
1. `cd temp495511880/`
39-
11. Examine the contents
40-
13. Exit the terminal: `exit`
46+
13. Examine the contents
47+
14. Exit the terminal: `exit`
4148

4249
## Additional information
4350

datacenter-deploy-hcdiag/client1.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@
66
"consul-server1",
77
"consul-server2",
88
"consul-server3"
9-
]
9+
],
10+
"acl": {
11+
"enabled": true,
12+
"default_policy": "deny",
13+
"enable_token_persistence": true,
14+
"tokens": {
15+
"agent": "my-agent-token"
16+
}
17+
}
1018
}

datacenter-deploy-hcdiag/server1.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@
1111
"retry_join":[
1212
"consul-server2",
1313
"consul-server3"
14-
]
14+
],
15+
"acl": {
16+
"enabled": true,
17+
"default_policy": "deny",
18+
"enable_token_persistence": true,
19+
"tokens": {
20+
"master": "my-master-token",
21+
"agent": "my-agent-token"
22+
}
23+
}
1524
}

datacenter-deploy-hcdiag/server2.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@
1111
"retry_join":[
1212
"consul-server1",
1313
"consul-server3"
14-
]
14+
],
15+
"acl": {
16+
"enabled": true,
17+
"default_policy": "deny",
18+
"enable_token_persistence": true,
19+
"tokens": {
20+
"master": "my-master-token",
21+
"agent": "my-agent-token"
22+
}
23+
}
1524
}

datacenter-deploy-hcdiag/server3.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@
1111
"retry_join":[
1212
"consul-server1",
1313
"consul-server2"
14-
]
14+
],
15+
"acl": {
16+
"enabled": true,
17+
"default_policy": "deny",
18+
"enable_token_persistence": true,
19+
"tokens": {
20+
"master": "my-master-token",
21+
"agent": "my-agent-token"
22+
}
23+
}
1524
}

0 commit comments

Comments
 (0)