Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blamebutton/disrupt
Python script that updates Docker Swarm services, with optional notifications
https://github.com/blamebutton/disrupt
discord-webhook-notifications docker docker-swarm docker-swarm-mode notifications python slack-webhook
Last synced: 4 months ago
JSON representation
Python script that updates Docker Swarm services, with optional notifications
- Host: GitHub
- URL: https://github.com/blamebutton/disrupt
- Owner: blamebutton
- License: mpl-2.0
- Created: 2019-03-15T19:28:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T22:58:51.000Z (over 4 years ago)
- Last Synced: 2024-02-13T21:13:29.998Z (about 1 year ago)
- Topics: discord-webhook-notifications, docker, docker-swarm, docker-swarm-mode, notifications, python, slack-webhook
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 25
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Disrupt (Docker Swarm Service Updater)
[](https://github.com/BlameButton/disrupt/releases)
[](https://github.com/BlameButton/disrupt/blob/master/LICENSE)
[](https://github.com/BlameButton/disrupt/graphs/contributors)[](https://travis-ci.com/BlameButton/disrupt)
[](https://hub.docker.com/r/blamebutton/disrupt)
[](https://discord.gg/tDf2yBg)## Usage
```yaml
version: '3'services:
whoami:
image: jwilder/whoami
ports:
- 8080:8000disrupt:
image: blamebutton/disrupt
volumes:
# Mount the Docker socket, this is required for interacting with the Docker API.
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
# Disrupt needs permission to update services, only managers are allowed to do that.
- node.role == manager
```For more examples, check out the [examples folder](/.examples)
**Note**: Docker Swarm does not support running locally built images, so neither does Disrupt.
## Configuration
Configuration of Disrupt is done through environment variables. This is done to make the deployment of Disrupt
environment-agnostic.Below is a list of environment variables available to be configured.
| Name | Type | Options |
| - | - | - |
| UPDATE_DELAY | Integer | default = 300 |
| NOTIFICATION_URL | String | Any [Apprise](https://github.com/caronc/apprise#popular-notification-services) compatible URL |## Notifications
Disrupt uses the [Apprise](https://github.com/caronc/apprise) notification library for Python.
Check out their documentation for more advanced usages.Here is a small list of notification providers that Apprise supports:
- Slack
- Discord
- Telegram
- PushBullet
- Dbus
- Custom notifications to a given URL in JSON or XML format## Contributing
Feel free to make a feature request or if you have Python experience; pull requests are welcome
too!## Troubleshooting
### Could not connect to Docker Engine
Did you mount the Docker socket to the container? Check out the [example](#usage) if you want
to know how.In the special case that you are accessing Docker over TCP, you should place Disrupt in the
same network as your TCP socket. Using a Docker socket proxy (like
[docker-socket-proxy](https://hub.docker.com/r/tecnativa/docker-socket-proxy/), or
[sockguard](https://github.com/buildkite/sockguard)) is recommended for enhanced security
in this case. You could then configure the proxy to only allow `GET` requests for service info,
for example. That way, if the Disrupt container gets compromised it can't do any harm to the
cluster in the form of modifications/destructive instructions.## Support
If you're having trouble getting Disrupt to work, we have a
[Discord](https://discord.gg/tDf2yBg) for support and questions.