Siemens-Healthineers / K2s

Kubernetes distribution for Windows & Linux workloads
https://siemens-healthineers.github.io/K2s/
MIT License
40 stars 4 forks source link

Add "k2s node exec" Command #854

Open jgriegershs opened 2 weeks ago

jgriegershs commented 2 weeks ago

Problem

The existing implementation for executing commands on remote nodes (k2s system ssh m|w) shows bad performance (#639) and is inappropriate for an arbitrary number of nodes.

Solution

Introduce the k2s node exec command similar to the existing k2s node copy command:

k2s node exec [flags]

Flags:
-i, --ip-addr string    [required] Node IP address
-u, --username string   [required] Username for remote connection
-c, --command string    [required] Command to execute on the node
-p, --port uint16       Port for remote connection (default 22)
-t, --timeout string    Connection timeout, e.g. '1m20s', allowed time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h' (default "30s")

For performance reasons, the already existing Go-based SSH connection shall be used instead of executing the ssh.exe as separate process.

See also discussion #787.

Predecessor to #856.