Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting for docker-cli-to-kubectl doc #11523

Merged
merged 1 commit into from
Jul 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 17 additions & 17 deletions docs/user-guide/docker-cli-to-kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ How do I run an nginx container and expose it to the world? Checkout [kubectl ru

With docker:

```
```console
$ docker run -d --restart=always --name nginx-app -p 80:80 nginx
a9ec34d9878748d2f33dc20cb25c714ff21da8d40558b45bfaec9955859075d0
$ docker ps
Expand All @@ -66,7 +66,7 @@ a9ec34d98787 nginx "nginx -g 'daemon of 2 seconds ago

With kubectl:

```
```console
# start the pod running nginx
$ kubectl run --image=nginx nginx-app
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
Expand All @@ -85,15 +85,15 @@ How do I list what is currently running? Checkout [kubectl get](kubectl/kubectl_

With docker:

```
```console
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9ec34d98787 nginx "nginx -g 'daemon of About an hour ago Up About an hour 0.0.0.0:80->80/tcp, 443/tcp nginx-app
```

With kubectl:

```
```console
$ kubectl get po
NAME READY STATUS RESTARTS AGE
nginx-app-5jyvm 1/1 Running 0 1h
Expand All @@ -105,7 +105,7 @@ How do I execute a command in a container? Checkout [kubectl exec](kubectl/kubec

With docker:

```
```console
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9ec34d98787 nginx "nginx -g 'daemon of 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, 443/tcp nginx-app
Expand All @@ -115,7 +115,7 @@ a9ec34d98787

With kubectl:

```
```console
$ kubectl get po
NAME READY STATUS RESTARTS AGE
nginx-app-5jyvm 1/1 Running 0 10m
Expand All @@ -128,14 +128,14 @@ What about interactive commands?

With docker:

```
```console
$ docker exec -ti a9ec34d98787 /bin/sh
# exit
```

With kubectl:

```
```console
$ kubectl exec -ti nginx-app-5jyvm -- /bin/sh
# exit
```
Expand All @@ -149,23 +149,23 @@ How do I follow stdout/stderr of a running process? Checkout [kubectl logs](kube

With docker:

```
```console
$ docker logs -f a9e
192.168.9.1 - - [14/Jul/2015:01:04:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-"
192.168.9.1 - - [14/Jul/2015:01:04:03 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-"
```

With kubectl:

```
```console
$ kubectl logs -f nginx-app-zibvs
10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-"
10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-"
```

Now's a good time to mention slight difference between pods and containers; by default pods will not terminate if their process's exit. Instead it will restart the process. This is similar to the docker run option `--restart=always` with one major difference. In docker, the output for each invocation of the process is concatenated but for Kubernetes, each invokation is separate. To see the output from a prevoius run in kubernetes, do this:

```
```console
$ kubectl logs --previous nginx-app-zibvs
10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-"
10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-"
Expand All @@ -179,7 +179,7 @@ How do I stop and delete a running process? Checkout [kubectl delete](kubectl/ku

With docker

```
```console
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9ec34d98787 nginx "nginx -g 'daemon of 22 hours ago Up 22 hours 0.0.0.0:80->80/tcp, 443/tcp nginx-app
Expand All @@ -191,7 +191,7 @@ a9ec34d98787

With kubectl:

```
```console
$ kubectl get rc nginx-app
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
nginx-app nginx-app nginx run=nginx-app 1
Expand All @@ -217,7 +217,7 @@ How do I get the version of my client and server? Checkout [kubectl version](kub

With docker:

```
```console
$ docker version
Client version: 1.7.0
Client API version: 1.19
Expand All @@ -233,7 +233,7 @@ OS/Arch (server): linux/amd64

With kubectl:

```
```console
$ kubectl version
Client Version: version.Info{Major:"0", Minor:"20.1", GitVersion:"v0.20.1", GitCommit:"", GitTreeState:"not a git tree"}
Server Version: version.Info{Major:"0", Minor:"21+", GitVersion:"v0.21.1-411-g32699e873ae1ca-dirty", GitCommit:"32699e873ae1caa01812e41de7eab28df4358ee4", GitTreeState:"dirty"}
Expand All @@ -245,7 +245,7 @@ How do I get miscellaneous info about my environment and configuration? Checkout

With docker:

```
```console
$ docker info
Containers: 40
Images: 168
Expand All @@ -267,7 +267,7 @@ WARNING: No swap limit support

With kubectl:

```
```console
$ kubectl cluster-info
Kubernetes master is running at https://108.59.85.141
KubeDNS is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/kube-dns
Expand Down