move visualizer to service and stack (#237)

This commit is contained in:
Bret Fisher
2018-05-08 17:51:40 +02:00
committed by Jérôme Petazzoni
parent 290185f16b
commit c8d73caacd
2 changed files with 22 additions and 11 deletions

View File

@@ -439,16 +439,10 @@ class: extra-details
.exercise[ .exercise[
- Get the source code of this simple-yet-beautiful visualization app: - Run this simple-yet-beautiful visualization app:
```bash ```bash
cd ~ cd ~/container.training/stacks
git clone git://github.com/dockersamples/docker-swarm-visualizer docker-compose -f visualizer.yml up -d
```
- Build and run the Swarm visualizer:
```bash
cd docker-swarm-visualizer
docker-compose up -d
``` ```
<!-- ```longwait Creating dockerswarmvisualizer_viz_1``` --> <!-- ```longwait Creating dockerswarmvisualizer_viz_1``` -->
@@ -489,7 +483,7 @@ class: extra-details
- Instead of viewing your cluster, this could take care of logging, metrics, autoscaling ... - Instead of viewing your cluster, this could take care of logging, metrics, autoscaling ...
- We can run it within a service, too! We won't do it, but the command would look like: - We can run it within a service, too! We won't do it yet, but the command would look like:
```bash ```bash
docker service create \ docker service create \
@@ -497,12 +491,16 @@ class: extra-details
--name viz --constraint node.role==manager ... --name viz --constraint node.role==manager ...
``` ```
.footnote[
Credits: the visualization code was written by Credits: the visualization code was written by
[Francisco Miranda](https://github.com/maroshii). [Francisco Miranda](https://github.com/maroshii).
<br/>
[Mano Marks](https://twitter.com/manomarks) adapted [Mano Marks](https://twitter.com/manomarks) adapted
it to Swarm and maintains it. it to Swarm and maintains it.
]
--- ---
## Terminate our services ## Terminate our services

13
stacks/visualizer.yml Normal file
View File

@@ -0,0 +1,13 @@
version: "3"
services:
viz:
image: dockersamples/visualizer
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- "8080:8080"
deploy:
placement:
constraints:
- node.role == manager