Swarm Management is a python application, installed with pip. The application makes it easy to manage a Docker Swarm by configuring a single *.yml file describing which stacks to deploy, and which networks, configs or secrets to create.
swm -help
Create a swarm.management.yml
file describing all properties of the swarm.
swarm.management.yml
file contains following properties:stacks:
<stack_name>: <compose_file>
networks:
<network_name>:
encrypted: false
driver: overlay
attachable: true
options:
- --ipv6
configs:
<config_name>: <config_file>
secrets:
<secret_name>: <secret_file>
volumes:
<volume_name>:
driver: local
driverOptions:
- type=tmpfs
- device=tmpfs
- o=size=100m,uid=1000
env_files:
- <environment_file>
Manage Swarm:
<stack_name>
<stack_name>
all
attribute:<network_name>
<network_name>
all
attribute:<config_name>
<config_name>
all
attribute:<secret_name>
<secret_name>
all
attribute:<volume_name>
<volume_name>
all
attribute:swarm.management.yml
file by default to configure the swarm.-f
attribute:Please have a look at an example of use here:
Deploy the swarm with swm -start
, and stop the swarm with swm -stop
. Restart the swarm with swm -restart <restart_delay_in_seconds>
. The <restart_delay_in_seconds>
argument is optional, and defaults to 10 seconds if not given.
The stacks
section lists all stacks to be deployed as: <stack_name>: <compose_file>
The networks
section lists all networks to be created as, and each network is created with the following default properties:
encrypted: false
driver: overlay
attachable: true
options:
<list_of_network_options>
The configs
section lists all configs to be created as: <config_name>: <config_file>
The secrets
section lists all secrets to be created as: <secret_name>: <secret_file>
The volumes
section lists all volumes to be created as, and each volumes is created with the following default properties:
driver: local
driverOptions:
<list_of_driver_options>
The env_files
section lists all environmnet (.env
) files with environment variables to expose. By convention, a present .env
file will automatically be loaded.
pip install twine wheel
Author: hansehe
Source: https://github.com/hansehe/SwarmManagement
License: MIT license