Fix console output for deploying applications

This commit is contained in:
Satnam Singh 2015-07-19 00:01:31 +01:00
parent 715f2c488f
commit f697169347

View File

@ -78,7 +78,7 @@ Some differences compared to specifying just a pod are that the `kind` is `Repli
This replication controller can be created using `create`, just as with pods: This replication controller can be created using `create`, just as with pods:
```bash ```console
$ kubectl create -f ./nginx-rc.yaml $ kubectl create -f ./nginx-rc.yaml
replicationcontrollers/my-nginx replicationcontrollers/my-nginx
``` ```
@ -89,7 +89,7 @@ Unlike in the case where you directly create pods, a replication controller repl
You can view the replication controller you created using `get`: You can view the replication controller you created using `get`:
```bash ```console
$ kubectl get rc $ kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
my-nginx nginx nginx app=nginx 2 my-nginx nginx nginx app=nginx 2
@ -99,7 +99,7 @@ This tells you that your controller will ensure that you have two nginx replicas
You can see those replicas using `get`, just as with pods you created directly: You can see those replicas using `get`, just as with pods you created directly:
```bash ```console
$ kubectl get pods $ kubectl get pods
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
my-nginx-065jq 1/1 Running 0 51s my-nginx-065jq 1/1 Running 0 51s
@ -110,7 +110,7 @@ my-nginx-buaiq 1/1 Running 0 51s
When you want to kill your application, delete your replication controller, as in the [Quick start](quick-start.md): When you want to kill your application, delete your replication controller, as in the [Quick start](quick-start.md):
```bash ```console
$ kubectl delete rc my-nginx $ kubectl delete rc my-nginx
replicationcontrollers/my-nginx replicationcontrollers/my-nginx
``` ```
@ -123,7 +123,7 @@ If you try to delete the pods before deleting the replication controller, it wil
Kubernetes uses user-defined key-value attributes called [*labels*](labels.md) to categorize and identify sets of resources, such as pods and replication controllers. The example above specified a single label in the pod template, with key `app` and value `nginx`. All pods created carry that label, which can be viewed using `-L`: Kubernetes uses user-defined key-value attributes called [*labels*](labels.md) to categorize and identify sets of resources, such as pods and replication controllers. The example above specified a single label in the pod template, with key `app` and value `nginx`. All pods created carry that label, which can be viewed using `-L`:
```bash ```console
$ kubectl get pods -L app $ kubectl get pods -L app
NAME READY STATUS RESTARTS AGE APP NAME READY STATUS RESTARTS AGE APP
my-nginx-afv12 0/1 Running 0 3s nginx my-nginx-afv12 0/1 Running 0 3s nginx
@ -132,7 +132,7 @@ my-nginx-lg99z 0/1 Running 0 3s nginx
The labels from the pod template are copied to the replication controllers labels by default, as well -- all resources in Kubernetes support labels: The labels from the pod template are copied to the replication controllers labels by default, as well -- all resources in Kubernetes support labels:
```bash ```console
$ kubectl get rc my-nginx -L app $ kubectl get rc my-nginx -L app
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS APP CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS APP
my-nginx nginx nginx app=nginx 2 nginx my-nginx nginx nginx app=nginx 2 nginx
@ -140,7 +140,7 @@ my-nginx nginx nginx app=nginx 2 nginx
More importantly, the pod templates labels are used to create a [`selector`](labels.md#label-selectors) that will match pods carrying those labels. You can see this field by requesting it using the [Go template output format of `kubectl get`](kubectl/kubectl_get.md): More importantly, the pod templates labels are used to create a [`selector`](labels.md#label-selectors) that will match pods carrying those labels. You can see this field by requesting it using the [Go template output format of `kubectl get`](kubectl/kubectl_get.md):
```bash ```console
$ kubectl get rc my-nginx -o template --template="{{.spec.selector}}" $ kubectl get rc my-nginx -o template --template="{{.spec.selector}}"
map[app:nginx] map[app:nginx]
``` ```