https://github.com/edenreich/docker-cluster
Helps to create, destroy, scale, remove and test a docker-swarm locally.
https://github.com/edenreich/docker-cluster
Last synced: 7 months ago
JSON representation
Helps to create, destroy, scale, remove and test a docker-swarm locally.
- Host: GitHub
- URL: https://github.com/edenreich/docker-cluster
- Owner: edenreich
- License: mit
- Created: 2018-03-08T23:05:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-14T15:19:43.000Z (about 7 years ago)
- Last Synced: 2025-01-16T16:42:58.391Z (9 months ago)
- Language: Shell
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Cluster
Helps to create, destroy, scale, remove and test a docker-swarm locally.
## Requirements
This assumed you have virtualbox installed.
## Installation
Clone the repository:
```sh
git clone https://github.com/edenreich/docker-cluster.git && cd docker-cluster
```Run the following to add the script to your system path.\
On Windows(assumed you have git bash installed):
```sh
cp ./bin/docker-cluster $HOME/bin
```
On Linux
```sh
sudo chmod +x ./bin/docker-cluster && sudo cp ./bin/docker-cluster /usr/local/bin
```Then run:
```sh
docker-cluster --help
```## Usage
To get started run:
```sh
docker-cluster create --workers 2
```There are options you may apply.
If you wish specificy the amount of memory for the workers:
```sh
docker-cluster create --workers 2 --memory 1016
```
This command will create 1 manager, 2 workers and each one will contain 1016 MB of RAM.Everytime you need another worker run the following command:
```sh
docker-cluster scale --workers 2
```
This command will create additonally 2 workers and join them to the swarm.To get details about the swarm run:
```sh
docker-cluster ls
```To remove a worker run:
```sh
docker-cluster destroy worker-1
```
This command will shut down worker-1, remove it from the swarm and delete it.To remove all of the machines run:
```
docker-cluster destroy all
```
This command will delete all existing docker machinesYou can create your own presets(=stack files) inside of the presets folder(see default as an example).
Once the preset is ready, run:
```sh
docker-cluster run --preset [preset-name]
```## Monitoring and Visualising
To monitor incomming requests, you can lunch grafana by typing(default credentials: admin/admin):
```sh
docker-cluster monitor
```If you wish to visualize the swarm, run:
```sh
docker-cluster visual
```## Testing
To check the preformance of your cluster you can run:
```sh
docker-cluster create --clients 2
```
Then:
```sh
docker-cluster test --requests 1000
```
This commands will create 2 client machines and fire off 2x1000 of 2x100 concurrency requests to the manager machine on port 80## Notes
The idea behind this tool is to speed up the workflow locally before going to production.
It has been tested on windows 10 using bash, but might work on linux, mac as well.## Bugs Reporting
Please feel free to report any bugs you find :)