mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Make exec more consistent with the rest of the kubectl commands.
This commit is contained in:
@@ -141,11 +141,14 @@ Execute a command in a container.
|
||||
.RS
|
||||
|
||||
.nf
|
||||
// get output from running 'date' from pod 123456\-7890, using the first container by default
|
||||
$ kubectl exec 123456\-7890 date
|
||||
|
||||
// get output from running 'date' in ruby\-container from pod 123456\-7890
|
||||
$ kubectl exec \-p 123456\-7890 \-c ruby\-container date
|
||||
$ kubectl exec 123456\-7890 \-c ruby\-container date
|
||||
|
||||
//switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780 and sends stdout/stderr from 'bash' back to the client
|
||||
$ kubectl exec \-p 123456\-7890 \-c ruby\-container \-i \-t \-\- bash \-il
|
||||
$ kubectl exec 123456\-7890 \-c ruby\-container \-i \-t \-\- bash \-il
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
Reference in New Issue
Block a user