Docker Swarm Cluster automation - is Python based script that automates creation of Docker Swarm Cluster. Script provides a possibility to create Docker Swarm cluster and provides a mechanism to automatically add new nodes as managers and workers. Automation makes sure that Docker Swarm cluster is not inited twice, stores some sort of state lock and saves cluster information on Blob Storage.
Swarm Cluster automation script requires to have a Ptyhon3 installation available on system.
Requirements:
- Python3
- Pip
- Python packages
- azure-storage-blob
- docker
Python script uses a Azure Blob Storage as backend so it requires to have a Azure Blob Storage Connection string set. Script requires next Envrionment variables:
AZURE_BLOB_CONNECTION_STRING
- Connection string to access Azure Blob StorageAZURE_BLOB_CONTAINER_NAME
- Container name in Blob Storage that will hold state file and cluster informationHOST_IP
- IP Address of node where script is runningROLE
- Node role. Acceptmanager
andworker
Make sure script is running in user-data so that any Autoscalling process will be handled in right way and nodes will be added to Docker Swarm Cluster.
0.1.0
- Initial release that handles Docker Swarm creation with locks, cluster info saved on Blob Storage and join mechanism for managers and workers