The Swarm Visualizer extends on the dockersamples/docker-swarm-visualizer concept demo'd at the 2015 DockerCon EU keynote.
It's goals are:
- minimize internal data being exposed to the browser
- allow for more control of the data being viewed
- implement authentication via OpenID Connect
docker service create visualizer \
-e CLUSTER_NAME="Dev Cluster" \
-p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock \
--constraint node.role==manager
jtgasper3/swarm-visualizerservice:
viz:
image: jtgasper3/swarm-visualizer:latest
deploy:
placement:
constraints:
- node.role==manager
environment:
CLUSTER_NAME: Dev Cluster
ports:
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sockGeneral Environment Variables:
CLUSTER_NAME: title to display on the main pageCONTEXT_ROOT: the context root of the web app; useful when working with reverse-proxies (default:/)LISTENER_PORT: port to listen on (default:8080)
OIDC Environment Variables:
ENABLE_AUTHN:trueenable OIDC authentication support (default:false)OIDC_CLIENT_ID: standard OAuth client idOIDC_CLIENT_SECRET_FILE: path to file containing a standard OAuth client secretOIDC_REDIRECT_URL: this app's callback url; should end in/callbackand will be registered in the identity provider. For example,https://myswarm.example.internal/visualizer/callbackOIDC_SCOPES: comma separated list of scopes. For example,openid,profile,emailOIDC_WELL_KNOWN_URL: Location to lookup the identity provider's public signing key, token and authorization endpoints. For example,https://auth.example.com/.well-known/openid-configurationOIDC_USERNAME_CLAIM:
Other Environment Variables:
DOCKER_API_VERSION: adjust the Docker api version if the server needs it. (default:1.47)
If not already enabled:
docker swarm initdocker service create --name nginx --replicas=3 nginx:latest
docker service create --name redis redis:latest
docker service create --name redis2 redis:latest
docker service create --name redis3 redis:latest
docker service create --name redis4 --mode global redis:latest
docker compose -f deployment/docker-compose.yml up --buildThe compose file mounts the static assets so they can be modified on the fly.
Stop dummy services:
docker service rm nginx redis redis2 redis3 redis4 redis5Remove Swarm mode:
docker swarm leave --force