Merge pull request #7973 from dchen1107/podstatus

Add kubectl log --previous support to view last terminated container log
This commit is contained in:
Victor Marmol
2015-05-11 17:08:45 -07:00
16 changed files with 96 additions and 20 deletions

View File

@@ -8,7 +8,7 @@ Print the logs for a container in a pod.
Print the logs for a container in a pod. If the pod has only one container, the container name is optional.
```
kubectl log [-f] POD [CONTAINER]
kubectl log [-f] [-p] POD [CONTAINER]
```
### Examples
@@ -17,6 +17,9 @@ kubectl log [-f] POD [CONTAINER]
// Returns snapshot of ruby-container logs from pod 123456-7890.
$ kubectl log 123456-7890 ruby-container
// Returns snapshot of previous terminated ruby-container logs from pod 123456-7890.
$ kubectl log -p 123456-7890 ruby-container
// Starts streaming of ruby-container logs from pod 123456-7890.
$ kubectl log -f 123456-7890 ruby-container
```
@@ -27,6 +30,7 @@ $ kubectl log -f 123456-7890 ruby-container
-f, --follow=false: Specify if the logs should be streamed.
-h, --help=false: help for log
--interactive=true: If true, prompt the user for input when required. Default true.
-p, --previous=false: If true, print the logs for the previous instance of the container in a pod if it exists.
```
### Options inherited from parent commands

View File

@@ -29,6 +29,10 @@ Print the logs for a container in a pod. If the pod has only one container, the
\fB\-\-interactive\fP=true
If true, prompt the user for input when required. Default true.
.PP
\fB\-p\fP, \fB\-\-previous\fP=false
If true, print the logs for the previous instance of the container in a pod if it exists.
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
@@ -136,6 +140,9 @@ Print the logs for a container in a pod. If the pod has only one container, the
// Returns snapshot of ruby\-container logs from pod 123456\-7890.
$ kubectl log 123456\-7890 ruby\-container
// Returns snapshot of previous terminated ruby\-container logs from pod 123456\-7890.
$ kubectl log \-p 123456\-7890 ruby\-container
// Starts streaming of ruby\-container logs from pod 123456\-7890.
$ kubectl log \-f 123456\-7890 ruby\-container