Executing remote commands in an OKD container

    Support for remote container command execution is built into the CLI.

    Procedure

    To run a command in a container:

    For example:

    Example output

    Protocol for initiating a remote command from a client

    In the above URL:

    • <node_name> is the FQDN of the node.

    • is the name of the target pod.

    • <container> is the name of the target container.

    • <command> is the desired command to be executed.

    Additionally, the client can add parameters to the request to indicate if:

    • the client’s terminal is a TTY.

    • the remote container’s command should send output from stdout to the client.

    • the remote container’s command should send output from stderr to the client.

    After sending an exec request to the API server, the client upgrades the connection to one that supports multiplexed streams; the current implementation uses SPDY.

    The client closes all streams, the upgraded connection, and the underlying connection when it is finished with the remote command execution request.