diff --git a/docs/user-guide/deploying-applications.md b/docs/user-guide/deploying-applications.md index 7fb0ea1d7d1..045f152649a 100644 --- a/docs/user-guide/deploying-applications.md +++ b/docs/user-guide/deploying-applications.md @@ -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: -```bash +```console $ kubectl create -f ./nginx-rc.yaml 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`: -```bash +```console $ kubectl get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS 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: -```bash +```console $ kubectl get pods NAME READY STATUS RESTARTS AGE 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): -```bash +```console $ kubectl delete rc 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`: -```bash +```console $ kubectl get pods -L app NAME READY STATUS RESTARTS AGE APP 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 controller’s labels by default, as well -- all resources in Kubernetes support labels: -```bash +```console $ kubectl get rc my-nginx -L app CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS APP my-nginx nginx nginx app=nginx 2 nginx @@ -140,7 +140,7 @@ my-nginx nginx nginx app=nginx 2 nginx More importantly, the pod template’s 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}}" map[app:nginx] ```