File tree 4 files changed +24
-9
lines changed
4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Summary
4
4
5
- - Create a few machines in the local VirtualBox environment
5
+ - Create a few machines on your local VirtualBox
6
6
- Init a swarm (manager + worker nodes)
7
- - Deploy a docker-compose (v3) file
7
+ - Deploy a Docker stack (Docker compose v3; swarm mode)
8
8
9
9
## Prerequisites
10
10
Original file line number Diff line number Diff line change
1
+ # Deploy a swarm cluster on your local machine (using Vagrant)
2
+
3
+ ## Summary
4
+
5
+ The following tasks will be performed:
6
+
7
+ - Create a few machines on your local VirtualBox
8
+ - Init a Docker swarm (manager + worker nodes)
9
+ - Deploy a Docker stack (Docker compose v3; swarm mode)
10
+
1
11
2
12
## Prerequisites
3
13
@@ -17,17 +27,17 @@ $ vagrant up
17
27
18
28
This will
19
29
20
- - provision 1 manager ,
21
- - 3 workers and
30
+ - provision 3 managers ,
31
+ - 2 workers and
22
32
- deploy, initialize a docker swarm and
23
- - deploy the services as defined in ` .docker-stack.yml ` .
33
+ - deploy the services as defined in ` ./../lib/ docker-stack.yml ` .
24
34
25
35
## Configuration
26
36
27
37
Open the ` config.yml ` file to change the configuration options:
28
38
29
- - ` NUM_OF_MANAGERS ` - Number of managers to create (defaults to ` 1 ` ).
30
- - ` NUM_OF_WORKERS ` - Number of workers to create (defaults to ` 3 ` ).
39
+ - ` NUM_OF_MANAGERS ` - Number of managers to create (defaults to ` 3 ` ).
40
+ - ` NUM_OF_WORKERS ` - Number of workers to create (defaults to ` 2 ` ).
31
41
- ` MEMORY ` - Allocated memory for each of the machines (defaults to ` 1024 ` )
32
42
- ` NUM_CPUS ` - Allocated number of CPUs for each of the machines (defaults to ` 2 ` )
33
43
Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
116
116
node . vm . provision "shell" , inline : @initWorker
117
117
118
118
# Todo: Not really nice, but couldn't find any better way to provision one of the managers at "the end" of the process
119
+ # Todo: This ugly hack is actually the main reason why this solution is not really nice and a combination of
120
+ # - vagrant & bash
121
+ # - vagrant & ansible
122
+ # might be the better and more stable approach.
123
+
119
124
# Any hint welcome how to improve this ...
120
125
if NUM_OF_WORKERS == workerNumber
121
126
node . vm . provision :host_shell do |host_shell |
Original file line number Diff line number Diff line change 1
- NUM_OF_MANAGERS : 1
2
- NUM_OF_WORKERS : 3
1
+ NUM_OF_MANAGERS : 3
2
+ NUM_OF_WORKERS : 2
3
3
MEMORY : 1024
4
4
NUM_CPUS : 2
You can’t perform that action at this time.
0 commit comments