Skip to main content

Module remotecommand

Module remotecommand 

Source
Expand description

The Kubernetes remote command protocols of exec and attach sessions, as k8s.io/cri-streaming serves them for CRI-O otherwise.

Clients speak them over WebSocket, v5.channel.k8s.io and the versions before it, or over SPDY. The kubelet proxies them unchanged, but the API server translates v5.channel.k8s.io to SPDY, which kubectl arrives with then. Each transport turns the input of the client into ClientEvents, and Output sends the output of a session the way its protocol needs it.

Modulesยง

spdy ๐Ÿ”’
Exec and attach over SPDY: the protocol versions, the streams of a session and the input of the client.
status ๐Ÿ”’
The final status of a session, as the client gets it.
websocket ๐Ÿ”’
Exec and attach over a WebSocket: the framing of each subprotocol and the input of the client.

Structsยง

Output ๐Ÿ”’
The sending half of a session. A failing send means that the client went away, which ends the session. After a clean close of a WebSocket client, sends fail as well, the output gets dropped then. The session still forwards the stdin which the client sent before its close to the process and reads the output meanwhile, so that the process does not wait for it. A SPDY connection which ends after the client closed its stdin counts as a clean close.

Enumsยง

ClientEvent ๐Ÿ”’
What a client sends during a session.
Stdin ๐Ÿ”’
The stdin of a client.
Transport ๐Ÿ”’
Version ๐Ÿ”’
A version of the protocols, which decides how a session reports its status and whether the client resizes terminals.

Constantsยง

CLOSE_BYTE ๐Ÿ”’
The channel which closes another one, since v5.channel.k8s.io.
MESSAGE_TOO_LARGE ๐Ÿ”’
The failure of a session whose client sent a message larger than the server takes.
RESIZE_BYTE ๐Ÿ”’
The channel of the resize events.
STDERR_BYTE ๐Ÿ”’
The channel of stderr.
STDIN_BYTE ๐Ÿ”’
The channel of stdin, the first byte of a WebSocket message.
STDOUT_BYTE ๐Ÿ”’
The channel of stdout.
STREAM_ERR_BYTE ๐Ÿ”’
The channel of the status of the session.
SUCCESS_STATUS ๐Ÿ”’
The status of a session which succeeded. The kubelet sends it as well, some clients take an empty error stream for a failure.

Traitsยง

ClientInput ๐Ÿ”’
The input of a client.