ıĤFY Edgelet Exec Sessions | Datasance PoT Documentation
Skip to main content
Version: v3.8.0

Microservice exec sessions

Interactive exec into microservice containers uses a multi-session model on Controller v3.8.0. Each session has its own id, WebSocket attach path, and runtime exec process.

v3.8 breaking change - WebSocket only

Controller REST POST/DELETE .../exec on microservices is removed. Open exec via WebSocket only. Legacy single-session Agent paths are not supported on Controller v3.8.

Overview​

ConcernController-initiated execLocal edgelet ms exec
Who opens the sessionPot user / EdgeOps Console via ControllerOperator CLI on the Edgelet node
Session discoveryField agent polls GET /api/v3/agent/exec/sessionsPOST /v1/ms/{id}/exec/sessions
Attach transportWebSocket .../agent/exec/microservice/{uuid}/{sessionId}GET /v1/ms/{id}/exec/sessions/{sessionId}:attach
Concurrent limit5 per microservice (Controller quota)Unlimited (node resources only)
Reported in statusYes - execSessionIds[] on agent statusNo - local sessions are excluded from Controller status

Exec sessions work like log sessions: poll a session list, attach per sessionId, reconcile when rows disappear.

Local exec (edgelet ms exec)​

edgelet ms exec <uuid|namespace.name>
edgelet ms exec <uuid> -- /bin/sh -c 'ps aux'

Flow:

  1. CLI calls POST /v1/ms/{id}/exec/sessions with the remote command (default interactive shell).
  2. EdgeletAPI waits up to 15 seconds for the shell to start before returning.
  3. CLI attaches over WebSocket and streams stdin/stdout/stderr until the remote command exits.

Multiple local sessions on the same microservice can run concurrently. Each session gets a unique runtime exec id so local CLI exec does not collide with Controller sessions.

Start timeout​

If the shell does not become ready within 15 seconds, the API returns HTTP 504 with code EXEC_START_TIMEOUT. The CLI surfaces:

Error[EXEC_START_TIMEOUT]: Interactive shell did not start within 15 seconds. Retry `edgelet ms exec`; if the problem persists, check microservice and engine logs.

Common causes: container not running, image missing /bin/sh, engine overload, or stale containerd exec state after a prior crash.

Controller-initiated exec​

When a user opens exec from Pot or EdgeOps Console:

  1. Controller creates a session row and sets execSessions: true on the next config/changes.
  2. The field agent polls the session list and opens one agent WebSocket per pending row.
  3. MessagePack relay frames use execId = sessionId (not containerd runtime ids).
  4. When the session row disappears from the poll, the agent tears down that attachment only.

Attach path on the Edgelet node:

WS .../agent/exec/microservice/{uuid}/{sessionId}

The legacy single-session path (WS /agent/exec/{microserviceUuid} with init MessagePack pairing) is removed in Edgelet v1.0.0+.

Concurrent session limit​

Controller v3.8.0 allows up to 5 concurrent exec sessions per microservice. When the quota is full, new session requests fail until an existing session closes.

Status reporting​

Agent status includes Controller attachment session ids per microservice:

"execSessionIds": ["session-uuid-1", "session-uuid-2"]

Values are Controller session ids for attachments this Edgelet node holds. They are not containerd exec process names and not local CLI sessions.

execEnabled (deprecated)​

Edgelet no longer uses the microservice execEnabled flag to open or keep exec sessions. Controller drives exec via session poll (execSessions: true).

Operators do not need to toggle execEnabled for exec to work.

  • Control plane restart stops interactive exec on the controller microservice before bounce. See Control plane on node.
  • Health checks use a separate short-lived exec path and are not part of the interactive session registry.

Troubleshooting​

See Troubleshooting - Microservice exec for timeout, orphan session, and concurrent-session scenarios.

See also​

Group 3See anything wrong with the document? Help us improve it!
˙˙˙˙