A collection of admin tasks for a Docker Swarm cluster
Download the binary (optionally rename) and put it in your path. Execute help
to verify installation
$ swarm-tool --help
By default the tool connects to the local daemon socket. Environment variables supported by docker cli can also be used.
To connect to a secure remote daemon socket, use the below environment variables
$ export DOCKER_HOST=tcp://remote-host:remote-port DOCKER_TLS_VERIFY=1 DOCKER_CERT_PATH=/path/to/certs
Updates an existing docker swarm secret
Usage
$ swarm-tool rotate-secrets --secret secret --secret-file=/path/to/updated-secret-data
rotate-secrets
will do the following -
- Check if the
secret
exists - If there are services which are using this secret...
- Creates a new
temp_secret
with data fromsecret-file
- Updates services by removing
secret
and addingtemp_secret
- Wait for service updates to converge
- Updates the
secret
with data fromsecret-file
- Updates services again. This time removing the
temp_secret
and adding the updatedsecret
- Wait for service updates to converge
- Removes the
temp_secret
- Creates a new
- If there are no services which are using this secret...
- Removes the
secret
- Create
secret
with data from thesecret-file
- Removes the