diff --git a/.gitignore b/.gitignore index 82b30fb..e6c6f11 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ pyvenv.cfg TODO __pycache__ + +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..45daf52 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2018-2019 Robert Farrell + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 2c4789b..6f05449 100644 --- a/README.md +++ b/README.md @@ -1 +1,120 @@ +# Skep + ![logo](images/logo.png) + +## Overview + +_Skep_ is a monitoring dashboard for [_Docker Swarm_](https://docs.docker.com/engine/swarm/): + +![Dashboard](images/screenshots/001-dashboard.png) + +You may find _Skep_ to be a useful addition to your toolbox along with projects like these: + +* [SwarmProm](https://github.com/stefanprodan/swarmprom) +* [swarm-dashboard](https://github.com/charypar/swarm-dashboard) +* [docker-swarm-visualizer](https://github.com/dockersamples/docker-swarm-visualizer) + +_Skep_ attempts to satisfy the following design objectives: + +* Simple configuration and quick deployment +* Low resource footprint +* Reactive and clean user interface + + +## Configuration + +An [example docker-compose.yml](docker-compose.yml) is provided. + +The following environment variables are available on the `stats` service (i.e. the global agent): + +| Variable | Meaning | Example | +|-|-|-| +| `SKEP_APP_URL` | URL that agent containers will use to send metrics to _Skep_ web application | `http://skep:8080/` _(default/recommended)_ | +| `DISKS` | Comma-separated list of disk devices to monitor (disk activity) | `sda,sdc` | +| `FILE_SYSTEMS` | Comma-separated list of file systems to monitor (available space) | `/hostfs/root,/hostfs/backups` (see [file systems](#file-systems)) | +| `NETWORK_INTERFACES` | Comma-separated list of network devices to monitor (traffic) **[not yet implemented]** | `eth0,eth3` | +| `LOG_LEVEL` | By default, the agent only logs initial configuration on launch and errors. Set to `DEBUG` to log all statistics. | `INFO` _(default/recommended)_ | + +## Deployment + +_Skep_ can be deployed just like any typical [https://docs.docker.com/engine/reference/commandline/stack_deploy/](stack): +```bash +docker stack deploy -c docker-compose.yml skep +``` + + +## File Systems + +To monitor a file system it must be mounted into the agent as a [_Docker_ bind mount](https://docs.docker.com/storage/bind-mounts/). The `FILE_SYSTEMS` environment variable should refer to the **destination** of the bind mount. + +For example, to monitor the root file system, the following configuration might be used: + +```yaml + stats: + image: skep/stats + + volumes: + - "/:/hostfs/root:ro" + + environment: + FILE_SYSTEMS: '/hostfs/root' +``` + +## Architecture + +_Skep_ is comprised of an agent which should be run globally and a web server which must have one replica. + +The agent harvests system and container metrics which are sent to the web server and forwarded to the [_React_](https://reactjs.org/)-based front end. + +The front end is read-only. No changes to a swarm can be made via the web application. A best-effort approach to filter sensitive data (e.g. passwords in environment configurations) is implemented using simple heuristics. Regardless, as with all similar systems, it is highly recommended that you run _Skep_ behind a firewall and/or an authentication layer. + +## Features + +### Expanded Stack View + +View details of all tasks for each service including container metrics. + +![Dashboard](images/screenshots/002-stack-expanded.png) + +### Mount Configuration + +Display all configured mount points for a given service. + +![Dashboard](images/screenshots/003-mounts.png) + +### Environment Configuration + +Display all configured environment variables for a given service. + +_Values for keys containing "password", "key", etc. are replaced by asterisks._ + +![Dashboard](images/screenshots/004-environment.png) + +### Related Nodes and Services Highlighting + +Click any service to highlight: + +* All services that share a network with the selected service +* All nodes that are running a task belonging to the selected service + +![Dashboard](images/screenshots/005-node-network-highlight.png) + +### Node View + +Expand the node view to see further details of a node including disk activity [**not shown in screenshot**], file system usage, etc. + +![Dashboard](images/screenshots/006-nodes.png) + +### Flashing Lights + +Enjoy looking at the flashing lights telling you that your nodes are alive and well. + +![Dashboard](images/screenshots/007-flashing-lights.gif) + +## License + +[MIT License](LICENSE) + +## Contributing + +Feel free to make a pull request. diff --git a/docker-compose.yml b/docker-compose.yml index 49ed0ea..c55d61e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,11 +21,11 @@ services: - "/var/run/docker.sock:/var/run/docker.sock:ro" environment: SKEP_APP_URL: http://app:8080 - SKEP_HOST: DISKS: - FILE_SYSTEMS: '/' - NETWORK_INTERFACES: 'eth0' - LOG_LEVEL: 'INFO' + FILE_SYSTEMS: + NETWORK_INTERFACES: + LOG_LEVEL: + SKEP_HOST: networks: - skep diff --git a/images/screenshots/001-dashboard.png b/images/screenshots/001-dashboard.png new file mode 100644 index 0000000..59cb98b Binary files /dev/null and b/images/screenshots/001-dashboard.png differ diff --git a/images/screenshots/002-stack-expanded.png b/images/screenshots/002-stack-expanded.png new file mode 100644 index 0000000..c3b85cc Binary files /dev/null and b/images/screenshots/002-stack-expanded.png differ diff --git a/images/screenshots/003-mounts.png b/images/screenshots/003-mounts.png new file mode 100644 index 0000000..742a7de Binary files /dev/null and b/images/screenshots/003-mounts.png differ diff --git a/images/screenshots/004-environment.png b/images/screenshots/004-environment.png new file mode 100644 index 0000000..fa3711f Binary files /dev/null and b/images/screenshots/004-environment.png differ diff --git a/images/screenshots/005-node-network-highlight.png b/images/screenshots/005-node-network-highlight.png new file mode 100644 index 0000000..ca78b9b Binary files /dev/null and b/images/screenshots/005-node-network-highlight.png differ diff --git a/images/screenshots/006-nodes.png b/images/screenshots/006-nodes.png new file mode 100644 index 0000000..2173623 Binary files /dev/null and b/images/screenshots/006-nodes.png differ diff --git a/images/screenshots/007-flashing-lights.gif b/images/screenshots/007-flashing-lights.gif new file mode 100644 index 0000000..7db1b51 Binary files /dev/null and b/images/screenshots/007-flashing-lights.gif differ