{# docker/swarm.html — the Swarm laid out by node (#5303). A verdict, the services short of replicas, then one card per node: a node that is down or not taking work first, then managers. Each card says what its containers use against what the machine has, and lists the services placed on it. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, status_badge, status_dot %} {% from "docker/_usage.html" import cores as fmt_cores %} {% block title %}Swarm — Docker — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Docker", "/plugins/docker/"), ("Swarm", "")]) }}{% endblock %} {% block content %}

Swarm

{% if swarms %} {% for g in swarms %} {% set down_nodes = g.nodes|rejectattr("ok")|list %}

{% if down_nodes or g.troubled %}{{ down_nodes|length + g.troubled|length }} need{{ "s" if (down_nodes|length + g.troubled|length) == 1 }} attention {% else %}Every node is up and taking work{% endif %} · {{ g.nodes|length }} node{{ "s" if g.nodes|length != 1 }} · {{ g.services_healthy }}/{{ g.services_total }} services healthy · reported by {{ g.managers|join(", ") }}

{% if down_nodes or g.troubled %}
{% endif %}
{% for n in g.nodes %}

{{ status_dot('up' if n.status == 'ready' else 'down') }} {% if n.host_id %}{{ n.hostname }}{% else %}{{ n.hostname }}{% endif %} {{ "leader" if n.leader else n.role }} {% if n.availability != 'active' %}{{ status_badge('warn', n.availability|capitalize, title="Swarm places no new tasks here") }}{% endif %}

{% if n.cores_used is not none %} Containers use {{ fmt_cores(n.cores_used) }}{% if n.cores %} of {{ n.cores }}{% endif %} · {{ n.mem_used|bytes }}{% if n.mem %} of {{ n.mem|bytes }}{% endif %} {% elif n.agent %} No swarm task reports figures here yet. {% else %} No Steward agent: what runs here is Swarm's placement, without figures. {% endif %}

{% if n.tasks %} {% for t in n.tasks %} {% endfor %}
ServiceTasksCPUMemory
{%- if t.state != 'healthy' %}{{ status_dot('down' if t.state == 'down' else 'warn') }} {% endif -%} {{ t.name }} {{ t.tasks }} {% if t.cores is not none %}{{ fmt_cores(t.cores) }}{% else %}—{% endif %} {% if t.mem_bytes is not none %}{{ t.mem_bytes|bytes }}{% else %}—{% endif %}
{% else %}

No tasks placed here.

{% endif %}
{% endfor %}
{% endfor %} {% else %}
No Swarm topology reported. A Steward host agent running on a Swarm manager reports services, nodes and task placement here; workers and hosts outside a swarm contribute only their own containers.
{% endif %} {% endblock %}