swarmexec

swarmexec › Docs › TUI: the Stacks/Services tab

TUI: the Stacks/Services tab_

Services and their containers, and everything you can do to them.

Stacks/Services tab

Tab 1, formerly labelled Containers. It is one tree, stack → service → container, and it is where exec, logs, port-forwarding, inspect and the service editors live.

In this part

The tab has more to it than fits one page. This page has its keys; the rest is split by what you are doing:

Keys in the tree

KeyAction
/open the search bar (filters by service / container / node)
h lfold / unfold, walking all three levels. h folds the row under the cursor — a stack folds the whole group, an expanded service folds its containers — and where there is nothing left to fold it steps out to the parent instead, so repeated presses walk up container → service → stack. l expands the row under the cursor, or descends to its first child when it is already open
Enteron a container: open the action menu; on a service or a stack: expand / collapse it
stoggle stack grouping — grouped tree ⟷ flat service list (see grouped by stack)
Llogs (capital L) — on a container its own logs, on a service the aggregated logs of all its tasks; on a stack row every container of every service in the stack, each line tagged [svc.slot] (or [svc@node] for a global service), starting from the last 50 lines each — like swarmexec logs --stack. Up to 64 containers; the (no stack) row is a grouping, not a stack, and opens nothing
!open the security-risks overlay for the whole service list (see security risks)
Estack file — export the stack under the cursor, or compare a stack file against it (see stack export & diff); the footer lists it as E stack file. Remappable as stack_file
pport-forward the task under the cursor — opens the Port Forward dialog (container port, local port, address; see the Forwards tab)
iinspect the node under the cursor — a navigable overlay with a tabular summary; move the selection with ↑/↓ or j/k, y/Enter copies the selected line, a tab strip at the top names the three views and 1/2/3 select table / stats / raw daemon JSON directly while t cycles them (Esc/q/i closes). On a service the overlay also edits it: a opens the actions menu with every editor and action (ports, labels, networks, secrets, mounts, resources, placement, the why diagnosis, roll back, …); u version, d diff, s scale, f force-update and e env also work directly, and X removes it. All of it is on inspect and edit a service
Xremove a service straight from the tree (capital X, i.e. Shift+x) — no detour through the inspect overlay. What it acts on follows the row under the cursor: on a service row it removes that service; on a container row it removes that container's owning service, because a single task cannot be removed on its own — Swarm would immediately reschedule it; on a stack row it removes the whole stack, exactly what docker stack rm removes: every service, secret, config and network carrying that stack's com.docker.stack.namespace label. The confirm names the counts it found (“4 services, 2 secrets, 1 network”) before anything goes, and the networks are retried for a few seconds because a service's endpoints take a moment to drain after its tasks stop — docker stack rm gives up there and leaves the network behind. Whatever refuses is listed by name afterwards, so you know exactly what is left. The (no stack) row removes nothing: it is a display grouping, not a stack. It goes through the same confirm as the inspect X — it permanently deletes the service and stops all its tasks, cannot be undone, and afterwards offers to delete any now-orphaned secrets. Remappable as service_remove in keys.yaml (default X); the footer lists it in red as X remove and the ? overlay lists it too. The X inside the inspect overlay is unchanged

The container action menu

The action menu offers logs, bash, sh, shell as user… (prompts for a user/UID, like docker exec -u, for images whose default user lacks the tools or permissions you need), port forward (unavailable shells are greyed out after a probe), and three container actions:

A copy larger than 1 GiB is refused, the same cap cp --max-size has; the command line is where a bigger one, an owner-preserving -a or a followed symlink -L belongs. There is no progress bar and no cancel key: the copy is bounded, and a progress line that cannot be stopped would only be decoration — the notice says what arrived.

Inspect and kill need an agent from the release that introduced them; an older agent answers with agent is older than this client — update it from the Nodes tab or with swarmexec init --force. A policy can refuse them separately (actions inspect and kill). In the search bar, Enter keeps the filter and returns to the list; Esc clears the filter and closes the bar.

Auto-refresh

The tree auto-refreshes every ~10s, so a container replaced or a service scaled in the background shows up on its own — the cursor and any expanded services are preserved. r still forces an immediate refresh.