You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's create a docker swarm with master and worker node using private networking. Before starting make sure you have `docker-machine` and `jq` installed.
76
+
## Examples
103
77
104
-
1. Create install.sh bash script and replace LINODE_TOKEN with your actual linode access token.
105
-
```sh
106
-
#!/bin/bash
107
-
set -e
78
+
### Simple Example
108
79
109
-
LINODE_TOKEN=<YOUR LINODE TOKEN>
80
+
```bash
81
+
LINODE_TOKEN=e332cf8e1a78427f1368a5a0a67946ad1e7c8e28e332cf8e1a78427f1368a5a0 # Should be 65 lowercase hex chars
110
82
LINODE_ROOT_PASSWORD=$(openssl rand -base64 32);echo Password for root: $LINODE_ROOT_PASSWORD
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
169
-
f8x7zutegt2dn1imeiw56v9hc * master01 Ready Active Leader 18.09.0
170
-
ja8b3ut6uaivz5hf98gah469y worker01 Ready Active 18.09.0
94
+
$ docker-machine rm linode
95
+
About to remove linode
96
+
WARNING: This action will delete both local reference and remote instance.
97
+
Are you sure? (y/n): y
98
+
(default) Removing linode: 8753395
99
+
Successfully removed linode
171
100
```
172
101
173
-
3. Cleanup resources
174
-
175
-
```sh
176
-
docker-machine rm worker01 -y
177
-
docker-machine rm master01 -y
178
-
```
102
+
### Provisioning Docker Swarm
103
+
104
+
The following script serves as an example for creating a [Docker Swarm](https://docs.docker.com/engine/swarm/) with master and worker nodes using the Linode Docker machine driver and private networking.
105
+
106
+
This script is provided for demonstrative use. A production swarm environment would require hardening.
107
+
108
+
1. Create an `install.sh` bash script using the source below. Run `bash install.sh` and provide a Linode APIv4 Token when prompted.
109
+
110
+
```sh
111
+
#!/bin/bash
112
+
set -e
113
+
114
+
read -p "Linode Token: " LINODE_TOKEN
115
+
# LINODE_TOKEN=...
116
+
LINODE_ROOT_PASSWORD=$(openssl rand -base64 32);echo Password for root: $LINODE_ROOT_PASSWORD
0 commit comments