Tools for deploy a cheap Docker Swarm cluster in https://vultr.com servers over CoreOS
Tools for deploy a cheap Docker Swarm cluster in https://vultr.com servers over CoreOS
With a loadbalancer
[sudo] pip install git+https://github.com/vicobits/suarm.git
sudo apt install build-essential
make env
swarm.json
file.api-key
to swarm.json
from value generated in API Section insuarm keys --create
.swarm.json
file with selecting between your registered keys with suarm keys
suarm cluster --create
or suarm -f <config_file> cluster --create
suarm cluster --delete
or suarm -f <config_file> cluster --delete
By defaul suarm
catch swarm.json
file as configuration file in the current location
this file, contains the next values:
{
"api-key": "<MY_VULTR_API_KEY>",
"ssh-key": "<MY_VULTR_GENERATED_SSHKEYID>",
"label": "<NAME_FOR_SWARM>",
"path": "<PATH_FOR_DEPLOYMENTS>",
"domain": "<DOMAIN_FOR_SWARM_MASTER>",
"email": "<YOUR_EMAIL>",
"manager": {
"replicas": 1,
"zone": "NEW_JERSEY",
"plan": 201,
"os": "COREOS",
"nodes": []
},
"worker": {
"replicas": 2,
"zone": "NEW_JERSEY",
"plan": 201,
"os": "COREOS",
"nodes": []
}
}
Where
NEW_JERSEY CHICAGO DALLAS SILICON_VALLEY
SEATTLE LOS_ANGELES ATLANTA SYDNEY
AMSTERDAM LONDON FRANKFURT SINGAPORE
PARIS TOKYO MIAMI
201 1024 MB RAM 25 GB SSD 1.00 TB BW 1CPU 5 USD
202 2048 MB RAM 40 GB SSD 2.00 TB BW 1CPU 10 USD
203 4096 MB RAM 60 GB SSD 3.00 TB BW 2CPUs 20 USD
204 8192 MB RAM 100 GB SSD 4.00 TB BW 4CPUs 40 USD
205 16384 MB RAM 200 GB SSD 5.00 TB BW 6CPUs 80 USD
206 32768 MB RAM 300 GB SSD 6.00 TB BW 8CPUs 160 USD
207 65536 MB RAM 400 GB SSD 10.00 TB BW 16CPUs 320 USD
208 98304 MB RAM 800 GB SSD 15.00 TB BW 24 CPUs 640 USD
* **os** is OS id in Vultr obtained from the [API](https://api.vultr.com/v1/os/list)
List for supported OS are:
CENTOS_6 DEBIAN_7 UBUNTU_14_04 COREOS DEBIAN_8,
UBUNTU_16_04 FEDORA_25 UBUNTU_17_04 DEBIAN_9 FEDORA_26
# Configure cluster
#### Setup swarm
Use the command `suarm cluster --setup` to configure manager and worker nodes.
#### Setup dashboard
Use the command `suarm cluster --setup-dashboard` to install [portainer](https://portainer.io/) and [vizualizer](https://github.com/dockersamples/docker-swarm-visualizer).
#### Setup proxy
Use the command `suarm cluster --setup-proxy` to install proxy flow base on [DockerFlow](http://dockerflow.com).
## Setup cluster manually
For setup cluster manually check [Manually docs](COMMANDS.md)
##Execute commands in production
`docker exec -ti [container] python manage.py createsuperuser`
## Performance improvement
To improve performance between nodes in the cluster there should be in the same private network.
You can configure a private network.
- First enable the private network feature in all nodes
- Create a file `/etc/systemd/network/static.network` with the next configuration:
[Match]
Name=eth1
[Link]
MTUBytes=1450
[Network]
Address=10.99.0.10
Netmask=255.255.0.0
```
sudo systemctl restart systemd-networkd
For proxy config options check dockerflow-proxy
For letsencrypt config options check dockerflow-le
This code is licensed under the MIT License
_.
.. _MIT License
: https://github.com/vicobits/suarm/blob/master/LICENSE