Swarm health depends, essentially, on the availability of the nodes in cluster and on the reliability of the managers (odd number, available, up).
Nodes can be listed with the usual:
docker node ls
This can use the --filter
option to filter the output. For example:
docker node ls --filter name=manager # prints nodes named *manager* docker node ls --filter "type=mysql" # prints nodes with a label type tagged "mysql"
To get details about a specific node, use inspect as shown:
docker inspect worker1
Also, filtering options are available to extract specific data from the output JSON:
docker node inspect --format '{{ .Description.Resources }}' worker2 {1000000000 1044140032}
Outputting the number of cores (one) and the quantity of assigned memory (1044140032
bytes, or 995M).